zacheusz/thep

Doing math before serialization null pointer

Opened this issue · 0 comments

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 wphardi...@gmail.com on 12 Apr 2014 at 1:58