Account for sp_sqr failure in _sp_exptmod_nct

ZD 12039
This commit is contained in:
Guido Vranken
2021-04-06 01:34:09 +02:00
parent 6b46669641
commit 52e6ff7c56

View File

@@ -8874,7 +8874,7 @@ static int _sp_exptmod_nct(sp_int* b, sp_int* e, sp_int* m, sp_int* r)
/* Sqaure until we find bit that is 1 or there's less than a /* Sqaure until we find bit that is 1 or there's less than a
* window of bits left. * window of bits left.
*/ */
while ((i >= 0) || (c >= winBits)) { while (err == MP_OKAY && ((i >= 0) || (c >= winBits))) {
sp_digit n2 = n; sp_digit n2 = n;
int c2 = c; int c2 = c;
int i2 = i; int i2 = i;