GithubHelp home page GithubHelp logo

thep's People

Stargazers

 avatar

thep's Issues

Doing math before serialization null pointer

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

Copy constructor does not properly initialize rng

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.