forked from wolfSSL/wolfssl
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:
@ -15076,7 +15076,7 @@ int sp_mont_norm(sp_int* norm, sp_int* m)
|
|||||||
}
|
}
|
||||||
if (err == MP_OKAY) {
|
if (err == MP_OKAY) {
|
||||||
bits = sp_count_bits(m);
|
bits = sp_count_bits(m);
|
||||||
if (bits == m->size * SP_WORD_SIZE) {
|
if (bits >= norm->size * SP_WORD_SIZE) {
|
||||||
err = MP_VAL;
|
err = MP_VAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user