forked from wolfSSL/wolfssl
MP small: mp_add_d doesn't support adding a digit greater than MP_DIGIT_MAX
This commit is contained in:
@ -4302,6 +4302,8 @@ int mp_add_d (mp_int* a, mp_digit b, mp_int* c)
|
|||||||
int res, ix, oldused;
|
int res, ix, oldused;
|
||||||
mp_digit *tmpa, *tmpc, mu;
|
mp_digit *tmpa, *tmpc, mu;
|
||||||
|
|
||||||
|
if (b > MP_DIGIT_MAX) return MP_VAL;
|
||||||
|
|
||||||
/* grow c as required */
|
/* grow c as required */
|
||||||
if (c->alloc < a->used + 1) {
|
if (c->alloc < a->used + 1) {
|
||||||
if ((res = mp_grow(c, a->used + 1)) != MP_OKAY) {
|
if ((res = mp_grow(c, a->used + 1)) != MP_OKAY) {
|
||||||
|
Reference in New Issue
Block a user