samettonyali / thep

Automatically exported from code.google.com/p/thep

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doing math before serialization null pointer

GoogleCodeExporter opened this issue · 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