# HG changeset patch # User Janus Dam Nielsen <janus.niel...@alexandra.dk> # Date 1245395100 -7200 # Node ID ad19cc189a5bf04ba37c0a9e25600040585cc1e9 # Parent cd787f04de1f3be2e7c969e963ed7bcd94f81305 Added a variant of the encryption method which takes a random value as argument.
diff --git a/viff/paillier.py b/viff/paillier.py --- a/viff/paillier.py +++ b/viff/paillier.py @@ -56,6 +56,9 @@ def encrypt(m, (n, g)): r = rand.randint(1, long(n)) + return encrypt_r(m, r, (n, g)) + +def encrypt_r(m, r, (n, g)): nsq = n*n return (pow(g, m, nsq)*pow(r, n, nsq)) % nsq _______________________________________________ viff-devel mailing list (http://viff.dk/) viff-devel@viff.dk http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk