|
|
|
|
|
by bren2013
4201 days ago
|
|
About ElGamal: Agreed. I only planned to implement it for my own satisfaction, more than for anything else. The addition law only leaks general cases--doubling, negatives, one argument is zero. Is that not generally considered okay? Intuitively, it doesn't seem like terribly valuable information--in the case of the Montgomery ladder, the attacker already knows we do one doubling and one addition per bit. Earlier, I was using Euler's theorem for inversions, which should have been more constant-time than Euclid's algorithm. The only problem is, it took slightly over a minute to do one scalar multiplication. Could you describe an attack that would come from knowing information about the z-coordinate? Is there a good way to do constant-time inversion? Edit: I just added a second benchmark testing scalar multiplication for a random value vs one with lots of zeros, and they produce different distributions with or without the #[const_time] (assuming I'm using it right). Thank you for bringing this up! I'll look into what needs tweaking. |
|
I actually take the above back. Scalar multiplication on a point IS constant-time (the two distributions are indistinguishable).
Field exponentiation isn't constant-time and I will work on that.