mirror of https://github.com/wolfSSL/wolfssl.git
Update with a proper check
parent
44903ff8ae
commit
4bd49d2b28
|
@ -1027,12 +1027,10 @@ void fp_mod_2d(fp_int *a, int b, fp_int *c)
|
|||
c->dp[x] = 0;
|
||||
}
|
||||
/* clear the digit that is not completely outside/inside the modulus */
|
||||
x = DIGIT_BIT - b;
|
||||
if (x > 0) {
|
||||
c->dp[b / DIGIT_BIT] &= ~((fp_digit)0) >> x;
|
||||
x = DIGIT_BIT - (b % DIGIT_BIT);
|
||||
if (x != DIGIT_BIT) {
|
||||
c->dp[b / DIGIT_BIT] &= ~((fp_digit)0) >> x;
|
||||
}
|
||||
else
|
||||
c->dp[b / DIGIT_BIT] &= ~((fp_digit)0) << -x;
|
||||
|
||||
fp_clamp (c);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue