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:
John Safranek
2019-11-20 13:55:57 -08:00
parent 71690fc73a
commit ce0136e968
2 changed files with 4 additions and 0 deletions

View File

@ -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;

View File

@ -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;