Commit Graph
13 Commits
Author SHA1 Message Date
Piotr Dyraga 1d535dc740 Simplified ThresholdKeyGenerator factory function tests 2018-08-08 15:11:43 +02:00
Piotr Dyraga 695e73602d Updated test to make sure all generator ctor values are set correctly 2018-08-08 14:03:35 +02:00
Piotr Dyraga 5d09ad8609 Added test ensuring correct n,p,q bit length for threshold key-gen 2018-08-08 13:46:51 +02:00
Piotr Dyraga 12b3dadef7 Make sure public key bit length is an even number
For an odd n-bit number, we can't find two n-1-bit numbers which
multiplied gives an n-bit number. That's why public key length n must be
an even number.

I have also renamed AreSafePrimes to IsSafePrime since only the first
function argument is considered to be a safe prime according to a safe
prime definition.
2018-08-08 11:11:05 +02:00
Piotr Dyraga 3394a6136a Check threshold public key bit length 2018-08-08 10:44:28 +02:00
Piotr Dyraga 408bafa61a Use GenThresholdKeyGenerator whenever it's possible 2018-08-08 10:44:12 +02:00
Piotr Dyraga 3c6123c0e3 Accept PubKey bit length when constructing TKey generator
Instead of passing safe prime bit length which is a kind of an
implementation detail, we should pass a public key bit length. Public
key is a Paillier modulus defining plaintext space. This information is
more important than the safe prime value/bit length used under the hood.
2018-08-08 10:44:02 +02:00
Piotr Dyraga b715df420a Removed unneeded return statements from tests 2018-05-30 14:49:29 +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 27dcab18e0 Do not export internal threshold generator functions 2018-05-30 14:47:27 +02:00
didier amyot b2d17e0eb6 removed dependency to old code 2014-11-29 23:29:34 -08:00
didier amyot 8a9743f08e imported from https://bitbucket.org/ustraca/crypto 2014-11-29 22:40:35 -08:00