forked from wolfSSL/wolfssl
Merge pull request #3733 from SparkiDev/sp_int_mont_red_size
SP int: mont_red - check size of a relative to m
This commit is contained in:
@ -12369,6 +12369,9 @@ int sp_mont_red(sp_int* a, sp_int* m, sp_int_digit mp)
|
||||
if ((a == NULL) || (m == NULL) || sp_iszero(m)) {
|
||||
err = MP_VAL;
|
||||
}
|
||||
else if (a->size < m->used * 2 + 1) {
|
||||
err = MP_VAL;
|
||||
}
|
||||
else {
|
||||
err = _sp_mont_red(a, m, mp);
|
||||
}
|
||||
|
Reference in New Issue
Block a user