diff --git a/mp_prime_extra_strong_lucas.c b/mp_prime_extra_strong_lucas.c index b9173afb..8cad30a7 100644 --- a/mp_prime_extra_strong_lucas.c +++ b/mp_prime_extra_strong_lucas.c @@ -37,6 +37,7 @@ mp_err mp_prime_extra_strong_lucas(const mp_int *N, bool *result) mp_int Dz, s, Vk, Vk1, tmp1, Nm2; uint32_t D, P; int32_t j, r, nbits; + int i; mp_err err = MP_OKAY; *result = false; @@ -83,7 +84,7 @@ mp_err mp_prime_extra_strong_lucas(const mp_int *N, bool *result) mp_set_u32(&Vk1, P); nbits = mp_count_bits(&s); /* Compute Lucas sequence of V */ - for (int i = nbits; i >= 0; i--) { + for (i = nbits; i >= 0; i--) { if ((err = mp_mul(&Vk, &Vk1, &tmp1)) != MP_OKAY) goto LTM_ERR; if ((err = mp_add(&tmp1, N, &tmp1)) != MP_OKAY) goto LTM_ERR; if ((err = mp_sub_d(&tmp1, P, &tmp1)) != MP_OKAY) goto LTM_ERR; @@ -114,7 +115,7 @@ mp_err mp_prime_extra_strong_lucas(const mp_int *N, bool *result) } } /* Check for V_{2^t k} = 0 mod N for some t 0 <= t < r - 1 ([3])*/ - for (int i = 0; i < (r - 1); i++) { + for (i = 0; i < (r - 1); i++) { if (mp_iszero(&Vk)) { *result = true; goto LTM_ERR;