forked from wolfSSL/wolfssl
Maintenance: Integers
In TFM and Integer, rshb() shouldn't try to shift a value that is 0. This leads to using a negative offset to a pointer, but isn't used.
This commit is contained in:
@ -572,6 +572,8 @@ void mp_rshb (mp_int *c, int x)
|
||||
mp_digit r, rr;
|
||||
mp_digit D = x;
|
||||
|
||||
if (mp_iszero(c)) return;
|
||||
|
||||
/* mask */
|
||||
mask = (((mp_digit)1) << D) - 1;
|
||||
|
||||
|
@ -3174,6 +3174,8 @@ void fp_rshb(fp_int *c, int x)
|
||||
fp_digit r, rr;
|
||||
fp_digit D = x;
|
||||
|
||||
if (fp_iszero(c)) return;
|
||||
|
||||
/* mask */
|
||||
mask = (((fp_digit)1) << D) - 1;
|
||||
|
||||
|
Reference in New Issue
Block a user