Skip to content

Commit

Permalink
Fix int / size_t comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
SWilson4 committed Jan 22, 2024
1 parent 231611c commit df4f7f0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/KATs/kem/kats.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@
"all": "36e1e53d4e6e295e8fb804449958ad9a3719aa350e91933c65791b9117382d57",
"single": "afc42c3a5b10f4ef69654250097ebda9b9564570f4086744b24a6daf2bd1f89a"
}
}
}
6 changes: 3 additions & 3 deletions tests/kat_kem.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static OQS_STATUS kem_kat(const char *method_name, bool all) {
uint8_t *shared_secret_d = NULL;
OQS_STATUS rc, ret = OQS_ERROR;
int rv;
int max_count;
size_t max_count;
OQS_KAT_PRNG *prng;

prng = OQS_KAT_PRNG_new(method_name);
Expand Down Expand Up @@ -67,8 +67,8 @@ static OQS_STATUS kem_kat(const char *method_name, bool all) {

max_count = all ? prng->max_kats : 1;

for (int count = 0; count < max_count; ++count) {
fprintf(fh, "count = %d\n", count);
for (size_t count = 0; count < max_count; ++count) {
fprintf(fh, "count = %zu\n", count);
OQS_randombytes(seed, 48);
OQS_fprintBstr(fh, "seed = ", seed, 48);

Expand Down
6 changes: 3 additions & 3 deletions tests/kat_sig.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ OQS_STATUS sig_kat(const char *method_name, bool all) {
size_t signed_msg_len = 0;
OQS_STATUS rc, ret = OQS_ERROR;
OQS_KAT_PRNG *prng = NULL;
int max_count;
size_t max_count;

prng = OQS_KAT_PRNG_new(method_name);
if (prng == NULL) {
Expand Down Expand Up @@ -277,8 +277,8 @@ OQS_STATUS sig_kat(const char *method_name, bool all) {
goto err;
}

for (int count = 0; count < max_count; ++count) {
fprintf(fh, "count = %d\n", count);
for (size_t count = 0; count < max_count; ++count) {
fprintf(fh, "count = %zu\n", count);
OQS_randombytes(seed, 48);
OQS_fprintBstr(fh, "seed = ", seed, 48);

Expand Down

0 comments on commit df4f7f0

Please sign in to comment.