Pass a public key bit length when creating a threshold key generator #11

Merged
pdyraga merged 16 commits from master into master 2018-08-10 06:50:47 -04:00
16 Commits
Author SHA1 Message Date
pdyraga f6ed66f4be Merge pull request #11 from keep-network/gitignore
Add IDE's workspace configuration directories to gitignore
2018-08-09 14:11:26 +02:00
Jakub Nowakowski 88d1beaf50 Added IDEs specific directories to gitignore 2018-08-09 14:04:41 +02:00
Jakub Nowakowski 3571790b8a Merge pull request #10 from keep-network/public-key-bit-length
Pass a public key bit length when creating a threshold key generator
2018-08-08 15:31:49 +02:00
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 0084a3762b Fixed documentation about the bit length of p,q and n 2018-08-08 13:50:23 +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 5332558625 ThresholdKeyGenerator random reference is no longer exported 2018-08-08 13:22:02 +02:00
Piotr Dyraga e726ad489b PublicKeyBitLength made an exported value just like all the others 2018-08-08 13:19:20 +02:00
Piotr Dyraga 51b5bac262 Create and return ThresholdKeyGenerator in one shot. 2018-08-08 13:16:25 +02:00
Piotr Dyraga 0d2a123af7 Fixed comment for safe primes required bit length
Safe primes bit length is n-1 for n-bit public key
2018-08-08 11:28:25 +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 d5973f86a7 Improved GetThresholdKeyGenerator documentation
Added information about the required minimum bit length of the public
key. Removed the threshold information as we are not sure now if it's
valid. We'll investigate it separately and make sure a proper validation
for threshold is made.
2018-08-08 10:56:26 +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