haresh14 / thep Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/thep
Automatically exported from code.google.com/p/thep
What steps will reproduce the problem?
1. Create EI (Encrypted Integer)
2. Multiply with another EI
3. writeObject (Serialize)
4. readObject (Deserialize)
What is the expected output? Number multiplied together.
What do you see instead? Null pointer exception
The issue is the copy contructor is missing copying 'bigi' . . . I fixed it
locally by adding this.bigi = other.bigi. See modified constructor below:
/**
* Constructs a copy of the other encrypted integer
*
* @param other the other encrypted integer
*/
public EncryptedInteger(EncryptedInteger other) {
this.rng = new SecureRandom();
this.cipherval = other.getCipherVal();
this.pub = other.getPublicKey();
this.rngCons = other.rngCons;
this.biCons = other.biCons;
this.bigi = other.bigi; //new line
}
What version of the product are you using? Thep 0.2
On what operating system? Ubuntu
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 12 Apr 2014 at 1:58
Hi Mike,
I'm using the "thep-0.1.jar" (http://code.google.com/p/thep/). It works well,
but recently I met one problem on the "EncryptedInteger.rerandomize" which
fires "java.lang.NullPointerException". My test code as follows, am I using
something wrong?
========
import java.math.*;
import thep.paillier.*;
import thep.paillier.exceptions.*;
public class testHE {
public static void main(String[] args) throws PublicKeysNotEqualException {
PrivateKey pri_key = new PrivateKey(1024);
PublicKey pub_key = pri_key.getPublicKey();
EncryptedInteger[] ei = new EncryptedInteger[100];
for (int i = 0; i < 100; ++i)
{
ei[i] = new EncryptedInteger (new BigInteger (String.valueOf(i + 1)), pub_key);
}
EncryptedInteger sum = new EncryptedInteger (BigInteger.ZERO, pub_key);
for (int i = 0; i < 100; ++i)
{
sum = sum.add(ei[i]);
}
System.out.println(sum.decrypt(pri_key));
sum.rerandomize();
System.out.println(sum.decrypt(pri_key));
}
}
========
Original issue reported on code.google.com by undefinedspace
on 23 Mar 2011 at 10:55
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.