DO NOT MERGE
Always use Fermat's Little Theorem in ecdsa_sign_setup.
The case where ec_group_get_mont_data is NULL is only for arbitrary groups
which we now require to be prime order. BN_mod_exp_mont is fine with a NULL
BN_MONT_CTX. It will just compute it. Saves a bit of special-casing.
Also don't mark p-2 as BN_FLG_CONSTTIME as the exponent is public anyway.
(cherry picked from commit 8cf79af7d1497c07bd684764b96c9659e7b32ae1)
(cherry picked from commit c5f118738a61b533d90b01841664e6480e0692fe)
2 files changed