Skip to content

Commit

Permalink
Resolve invalidPrintfArgTypeError-like warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
vil02 authored and Legrandin committed Aug 18, 2024
1 parent 6ecbbfe commit e76a488
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions src/make_p256_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ int main(void)
EcContext *ec_ctx;
EcPoint *g = NULL;
EcPoint **window = NULL;
int i, j;
unsigned i, j;
unsigned n_tables, points_per_table, window_size;

ec_ws_new_context(&ec_ctx, p256_mod, b, order, 32, 0);
Expand All @@ -55,12 +55,12 @@ int main(void)
printf("/* This file was automatically generated, do not edit */\n");
printf("#include \"common.h\"\n");
printf("#include \"p256_table.h\"\n");
printf("const unsigned p256_n_tables = %d;\n", n_tables);
printf("const unsigned p256_window_size = %d;\n", window_size);
printf("const unsigned p256_points_per_table = %d;\n", points_per_table);
printf("const unsigned p256_n_tables = %u;\n", n_tables);
printf("const unsigned p256_window_size = %u;\n", window_size);
printf("const unsigned p256_points_per_table = %u;\n", points_per_table);
printf("/* Affine coordinates in Montgomery form */\n");
printf("/* Table size: %u kbytes */\n", (unsigned)(n_tables*points_per_table*2*WORDS*sizeof(uint64_t)));
printf("const uint64_t p256_tables[%d][%d][2][4] = {\n", n_tables, points_per_table);
printf("const uint64_t p256_tables[%u][%u][2][4] = {\n", n_tables, points_per_table);

for (i=0; i<n_tables; i++) {

Expand All @@ -77,7 +77,7 @@ int main(void)
memcpy(yw, window[j]->y, sizeof yw);
}

printf(" { /* Point #%d */\n", j);
printf(" { /* Point #%u */\n", j);
printf(" { ");
print_64bit_array(xw, 4);
printf(" },\n");
Expand Down
12 changes: 6 additions & 6 deletions src/make_p384_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ int main(void)
EcContext *ec_ctx;
EcPoint *g = NULL;
EcPoint **window = NULL;
int i, j;
unsigned i, j;
unsigned n_tables, points_per_table, window_size;

ec_ws_new_context(&ec_ctx, p384_mod, b, order, BYTES, 0);
Expand All @@ -55,12 +55,12 @@ int main(void)
printf("/* This file was automatically generated, do not edit */\n");
printf("#include \"common.h\"\n");
printf("#include \"p384_table.h\"\n");
printf("const unsigned p384_n_tables = %d;\n", n_tables);
printf("const unsigned p384_window_size = %d;\n", window_size);
printf("const unsigned p384_points_per_table = %d;\n", points_per_table);
printf("const unsigned p384_n_tables = %u;\n", n_tables);
printf("const unsigned p384_window_size = %u;\n", window_size);
printf("const unsigned p384_points_per_table = %u;\n", points_per_table);
printf("/* Affine coordinates in Montgomery form */\n");
printf("/* Table size: %u kbytes */\n", (unsigned)(n_tables*points_per_table*2*WORDS*sizeof(uint64_t)));
printf("const uint64_t p384_tables[%d][%d][2][%d] = {\n", n_tables, points_per_table, WORDS);
printf("const uint64_t p384_tables[%u][%u][2][%d] = {\n", n_tables, points_per_table, WORDS);

for (i=0; i<n_tables; i++) {

Expand All @@ -77,7 +77,7 @@ int main(void)
memcpy(yw, window[j]->y, sizeof yw);
}

printf(" { /* Point #%d */\n", j);
printf(" { /* Point #%u */\n", j);
printf(" { ");
print_64bit_array(xw, 6);
printf(" },\n");
Expand Down
12 changes: 6 additions & 6 deletions src/make_p521_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ int main(void)
EcContext *ec_ctx;
EcPoint *g = NULL;
EcPoint **window = NULL;
int i, j;
unsigned i, j;
unsigned n_tables, points_per_table, window_size;

ec_ws_new_context(&ec_ctx, p521_mod, b, order, BYTES, 0);
Expand All @@ -55,12 +55,12 @@ int main(void)
printf("/* This file was automatically generated, do not edit */\n");
printf("#include \"common.h\"\n");
printf("#include \"p521_table.h\"\n");
printf("const unsigned p521_n_tables = %d;\n", n_tables);
printf("const unsigned p521_window_size = %d;\n", window_size);
printf("const unsigned p521_points_per_table = %d;\n", points_per_table);
printf("const unsigned p521_n_tables = %u;\n", n_tables);
printf("const unsigned p521_window_size = %u;\n", window_size);
printf("const unsigned p521_points_per_table = %u;\n", points_per_table);
printf("/* Affine coordinates in plain form (not Montgomery) */\n");
printf("/* Table size: %u kbytes */\n", (unsigned)(n_tables*points_per_table*2*WORDS*sizeof(uint64_t)));
printf("const uint64_t p521_tables[%d][%d][2][%d] = {\n", n_tables, points_per_table, WORDS);
printf("const uint64_t p521_tables[%u][%u][2][%d] = {\n", n_tables, points_per_table, WORDS);

for (i=0; i<n_tables; i++) {

Expand All @@ -77,7 +77,7 @@ int main(void)
memcpy(yw, window[j]->y, sizeof yw);
}

printf(" { /* Point #%d */\n", j);
printf(" { /* Point #%u */\n", j);
printf(" { ");
print_64bit_array(xw, WORDS);
printf(" },\n");
Expand Down

0 comments on commit e76a488

Please sign in to comment.