Commit Graph
17 Commits
Author SHA1 Message Date
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 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 b21e0d7d97 Name parameters for the safe prime generator call
`4` and `120*time.Seconds` were just some magic numbers in the code.
We decided to move them to separate value declarations to make the
code more self-explanatory.
2018-07-30 12:27:59 +02:00
Piotr Dyraga ca756b481b Removed deprecated GenerateSafePrimes function
The new function should be now called directly.
2018-07-27 17:42:05 +02:00
Piotr Dyraga df9231e7b2 ThresholdKeyGenerator self-ref renamed from this to tkg 2018-06-01 20:51:15 +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 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
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