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
pdyraga commented 2018-08-08 09:54:26 -04:00 (Migrated from github.com)

So far, GetThresholdKeyGenerator accepted bit length of safe primes p and q which multiplied together create a public key n = pq. For l-bit prime p and q, public key n was a 2l-bit number.

This ia a bit clumsy. I'd rather expect to specify a bit length of the public key, especially that n (public key) defines a plaintext space. Also, I think p and q safe primes are rather implementation details.

In this PR, GenThresholdKeyGenerator accepts bit length of a public key. Two validation rules have been added:

  • bit length must be an even number
    For an odd l-bit number, we can't find two l/2-bit numbers with two the most significant bits set on which multiplied gives an l-bit number,
  • bit length must be minimum 18
    we need to find two l/2-bit safe primes, p and q which are not equal. This is not possible for l<18.

I removed the comment about required threshold as I am not sure it's correct (active adversary attack against SSS). We'll investigate it separately and add the required validation.

I have also renamed AreSafePrimes to IsSafePrime - according to the safe prime definition, only the first function argument can be considered a safe prime.

Here is our internal PR with review for a reference.

So far, `GetThresholdKeyGenerator` accepted bit length of safe primes `p` and `q` which multiplied together create a public key `n = pq`. For `l`-bit prime `p` and `q`, public key `n` was a `2l`-bit number. This ia a bit clumsy. I'd rather expect to specify a bit length of the public key, especially that `n` (public key) defines a plaintext space. Also, I think `p` and `q` safe primes are rather implementation details. In this PR, `GenThresholdKeyGenerator` accepts bit length of a public key. Two validation rules have been added: - bit length must be an even number For an odd `l`-bit number, we can't find two `l/2`-bit numbers with two the most significant bits set on which multiplied gives an `l`-bit number, - bit length must be minimum `18` we need to find two `l/2`-bit safe primes, `p` and `q` which are not equal. This is not possible for `l<18`. I removed the comment about required threshold as I am not sure it's correct (active adversary attack against SSS). We'll investigate it separately and add the required validation. I have also renamed `AreSafePrimes` to `IsSafePrime` - according to the safe prime definition, only the first function argument can be considered a safe prime. Here is our [internal PR](https://github.com/keep-network/paillier/pull/10) with review for a reference.
didiercrunch commented 2018-08-10 06:50:41 -04:00 (Migrated from github.com)

There is absolutely no reason why I would not merge this PR right away.

Next time you are in montreal I'll pay the beers.

cheers,

didier

There is absolutely no reason why I would not merge this PR right away. Next time you are in montreal I'll pay the beers. cheers, didier
pdyraga commented 2018-08-10 07:41:06 -04:00 (Migrated from github.com)

😆 🍻

😆 🍻
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: didier/paillier#11