SP int: mp_init_size fix for sp_mont_norm

sp_mont_norm should check wrong parameter when determining whether the
calculation values will fit.
This commit is contained in:
Sean Parkinson
2022-09-19 10:04:30 +10:00
parent 02e51953fd
commit e7dba670d6

View File

@ -15076,7 +15076,7 @@ int sp_mont_norm(sp_int* norm, sp_int* m)
}
if (err == MP_OKAY) {
bits = sp_count_bits(m);
if (bits == m->size * SP_WORD_SIZE) {
if (bits >= norm->size * SP_WORD_SIZE) {
err = MP_VAL;
}
}