aboutsummaryrefslogtreecommitdiff
path: root/rsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'rsa.c')
-rw-r--r--rsa.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/rsa.c b/rsa.c
index 44ad84e..b5e52c5 100644
--- a/rsa.c
+++ b/rsa.c
@@ -830,7 +830,7 @@ static hal_error_t find_prime(const unsigned prime_length,
fp_read_unsigned_bin(result, buffer, sizeof(buffer));
- for (int i = 0; i < sizeof(small_prime)/sizeof(*small_prime); i++) {
+ for (size_t i = 0; i < sizeof(small_prime)/sizeof(*small_prime); i++) {
fp_digit d;
fp_mod_d(result, small_prime[i], &d);
remainder[i] = d;
@@ -839,10 +839,10 @@ static hal_error_t find_prime(const unsigned prime_length,
for (;;) {
int possible = 1;
- for (int i = 0; i < sizeof(small_prime)/sizeof(*small_prime); i++)
+ for (size_t i = 0; i < sizeof(small_prime)/sizeof(*small_prime); i++)
possible &= remainder[i] != 0;
- for (int i = 0; possible && i < HAL_RSA_MILLER_RABIN_TESTS; i++) {
+ for (size_t i = 0; possible && i < HAL_RSA_MILLER_RABIN_TESTS; i++) {
fp_set(t, small_prime[i]);
fp_prime_miller_rabin(result, t, &possible);
}
@@ -860,7 +860,7 @@ static hal_error_t find_prime(const unsigned prime_length,
fp_add_d(result, 2, result);
- for (int i = 0; i < sizeof(small_prime)/sizeof(*small_prime); i++)
+ for (size_t i = 0; i < sizeof(small_prime)/sizeof(*small_prime); i++)
if ((remainder[i] += 2) >= small_prime[i])
remainder[i] -= small_prime[i];
}