Commit Graph
37 Commits
Author SHA1 Message Date
Piotr Dyraga 3acf9e6948 Explained how do we handle negative lambda parameter value 2018-06-05 13:11:50 +02:00
Piotr Dyraga ba2c5aaa5f Shortened name of the partial decryption verification function 2018-06-01 21:42:49 +02:00
Piotr Dyraga 9d17da0d33 ThresholdKey renamed to ThresholdPublicKey 2018-06-01 21:36:04 +02:00
Piotr Dyraga 86b9f01f99 PartialDecryptionZKP self-ref renamed from this to pd 2018-06-01 21:31:04 +02:00
Piotr Dyraga 3f301a765d ThresholdPrivateKey self-ref renamed from this to tpk 2018-06-01 21:29:43 +02:00
Piotr Dyraga 00f21c0b6f ThresholdKey self-ref renamed from this to tk 2018-06-01 21:28:13 +02:00
Piotr Dyraga df9231e7b2 ThresholdKeyGenerator self-ref renamed from this to tkg 2018-06-01 20:51:15 +02:00
Piotr Dyraga bb8c3928d2 Explained how Fiat-Shamir heuristic works on a high level 2018-06-01 20:45:22 +02:00
Piotr Dyraga e43575684d Removed G parameter serialization code for ThresholdKey 2018-05-30 15:37:53 +02:00
Piotr Dyraga 5d49cb0f72 Added documentation to code evaluating ZKP 2018-05-30 14:49:41 +02:00
Piotr Dyraga b715df420a Removed unneeded return statements from tests 2018-05-30 14:49:29 +02:00
Piotr Dyraga f05e5219c2 Added documentation describing how partial decryptions are combined 2018-05-30 14:49:18 +02:00
Piotr Dyraga 76f8f63a47 Added test ensuring threshold Paillier is a partially homomorphic system 2018-05-30 14:49:05 +02:00
Piotr Dyraga 915950cb35 Removed unused ThresholdKey.divide function 2018-05-30 14:48:50 +02:00
Piotr Dyraga 1dc8db4cb2 Improved documentation for ThresholdKey functions 2018-05-30 14:48:39 +02:00
Piotr Dyraga adcb812a08 Do not export internal ThresholdKey functions 2018-05-30 14:48:28 +02:00
Piotr Dyraga e25bc358e8 G parameter removed from ThresholdKey
G _MUST_ be always n+1 to make the threshold encryption algorithm safe. We assume G=n+1 both for standard and threshold version.
2018-05-30 14:48:15 +02:00
Piotr Dyraga e10b02e420 Small improvements to the threshold key generator tests
First of all, we should check both `p,p1` and `q,q1` in the `TestInitPsAndQs`. Moreover, it's better to operate on primes in `TestArePsAndQsGood` and in `TestInitShortcuts` because non-prime numbers are not allowed there in a real world and tests were a bit misleading because of it.
2018-05-30 14:47:56 +02:00
Piotr Dyraga 92c3842e5f Improved documentation for a secret share computation fn 2018-05-30 14:47:41 +02:00
Piotr Dyraga 27dcab18e0 Do not export internal threshold generator functions 2018-05-30 14:47:27 +02:00
Piotr Dyraga ad44ab64cb Added documentation to the threshold Paillier key generator 2018-05-30 14:46:54 +02:00
Piotr Dyraga 7c2ec95fb8 Explained how do we compute D from Chinese Remainder Theorem 2018-05-30 14:46:41 +02:00
Matt Luongo 83928fcadb Merge pull request #1 from keep-network/evaluate-and-fix
Paillier scheme API - evaluation and clearing up
2018-05-25 08:47:25 -07:00
Piotr Dyraga 9fe64ff57b Comment about G value moved to ThresholdKey
G is no longer a parameter of PublicKey.
2018-05-25 09:58:26 +02:00
Piotr Dyraga 013296b8e4 Removed PrivateKey's String() method
It's better to have no code encouraging to turn key into a string and printing it somewhere, especially that string contains private key Lambda parameter.
2018-05-24 19:15:48 +02:00
Piotr Dyraga 4595f69872 G parameter moved from PublicKey to ThresholdKey
We don't need G for our PublicKey since it's now always equal N+1. It's required by the `ThresholdKey` to compile, so I moved it there. I will investigate if for a threshold Paillier scheme G is really needed in the pkey.
2018-05-24 19:13:29 +02:00
Piotr Dyraga 69c60e90d5 Do not cache N^2 value in PublicKey
Let's keep this structure clean. Computing N^2 is just a really small piece of encryption/decryption work and if we decide we need to tweak performance, we will need a different approach anyway.
2018-05-24 19:02:01 +02:00
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