1

OpenSSL performs modular reductions when doing RSA but in order to maximize it's efficiency for elliptic curves over finite fields it'd need to do modular reduction for those as well.

I'm curious in what file in the OpenSSL source code does OpenSSL perform these modular reductions. I'm specifically interested in where it does it for binary finite fields but knowing where it does it for prime finite fields might give me insight into where it's doing it for binary finite fields.

neubert
  • 15,947
  • 24
  • 120
  • 212
  • Did you read this concerning P-224: [Fast Elliptic Curve Cryptography in OpenSSL](https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/37376.pdf)? The exact reduction steps are explained in section 3.2, you can follow it in the functions [point_double()](https://github.com/openssl/openssl/blob/OpenSSL_1_1_0i/crypto/ec/ecp_nistp224.c#L826) and [point_add()](https://github.com/openssl/openssl/blob/OpenSSL_1_1_0i/crypto/ec/ecp_nistp224.c#L914), wherever `felem_reduce()` is invoked. Implementations for P-256 and P-521 seem to be based on this as well. – Reinier Torenbeek Sep 10 '18 at 19:45

0 Answers0