Commit Graph
10 Commits
Author SHA1 Message Date
Piotr Dyraga d892a58e4b Cleared up Paillier scheme API
The code for generating private key is based on approach described in [KL 08], construction 11.32 which is compatible with the one described in [DJN 10], section 3.2 except that instead of generating Lamda private key compontent from LCM of `p` and `q` we use Euler's totient function as suggested in [KL 08]. I cleared up naming as well as removed G and Mu parameters from Paillier key. For the modification of Paillier scheme we use, where g = n + 1, N is the only one parameter needed for a public key. Also, Mu is needed only for Decrypting and can be computed there from Lambda and N so there is no need to keep it in the private key.

I added documentation to <Key, Enc, Dec> functions with an important note that `p` and `q` supplied to `CreatePrivateKey` must be either of equal length or `gcd(pq, (p-1)(q-1)) = 1` which is assured if both primes are of equal length. This requirement is mentioned both in [KL 08] and [DJN 10].

[KL 08]:  Jonathan Katz, Yehuda Lindell, (2008)
          Introduction to Modern Cryptography: Principles and Protocols,
          Chapman & Hall/CRC

[DJN 10]: Ivan Damgard, Mads Jurik, Jesper Buus Nielsen, (2010)
          A Generalization of Paillier’s Public-Key System
          with Applications to Electronic Voting
          Aarhus University, Dept. of Computer Science, BRICS
2018-05-24 18:41:10 +02:00
Piotr Dyraga f550c00e74 Added test for Lambda parameter computation 2018-05-23 18:43:14 +02:00
Piotr Dyraga 622644f19d Fixed test for LCM
The LCM test was expecting GCD result and because assertion was flipped (missing negation), the test was passing.
2018-05-23 18:37:15 +02:00
didier amyot 06a4b756bb Merge pull request #1 from kilink/master
run tests on Go 1.4 and tip
2015-02-22 13:04:44 -08:00
patrick strawderman 900e1f5b07 run tests on Go 1.4 and tip 2015-02-22 13:02:08 -08:00
didier amyot b2d17e0eb6 removed dependency to old code 2014-11-29 23:29:34 -08:00
didier amyot 959098cd25 added travis 2014-11-29 22:47:18 -08:00
didier amyot 8a9743f08e imported from https://bitbucket.org/ustraca/crypto 2014-11-29 22:40:35 -08:00
didier amyot ca20730438 imported from https://bitbucket.org/ustraca/crypto 2014-11-29 22:39:45 -08:00
didier amyot 8c414dc22a Initial commit 2014-11-29 22:22:14 -08:00