Montgomery abbreviation form using OpenSSL library
1 answer
The following should work if you are using the bignum package from OpenSSL directly.
Use a function BN_mod_exp
to calculate your R = 2 ^ 512 (mod N).
Then you compute the modulo multiplicative inverse of R by calling BN_mod_inverse
. This will give you R ^ -1.
Once done, you just compute your M 'by calling BN_mod_mul
to perform the multiplication using the R ^ -1 you just computed and your original message.
You will find the features mentioned above in the OpenSSL BigNum package. They are in the include file: openssl / bn.h
+2
source to share