From 55863ae1d9990f4f17d4485a674d6a00e5e2a2aa Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 7 Nov 2019 20:37:42 +0100 Subject: [PATCH] fix sqr_comba warnings for comba3&4 --- src/generators/comba_sqr_gen.c | 11 +++++++++-- src/sqr/fp_sqr_comba_12.c | 3 ++- src/sqr/fp_sqr_comba_17.c | 3 ++- src/sqr/fp_sqr_comba_20.c | 3 ++- src/sqr/fp_sqr_comba_24.c | 3 ++- src/sqr/fp_sqr_comba_28.c | 3 ++- src/sqr/fp_sqr_comba_3.c | 2 +- src/sqr/fp_sqr_comba_32.c | 3 ++- src/sqr/fp_sqr_comba_4.c | 2 +- src/sqr/fp_sqr_comba_48.c | 3 ++- src/sqr/fp_sqr_comba_6.c | 3 ++- src/sqr/fp_sqr_comba_64.c | 3 ++- src/sqr/fp_sqr_comba_7.c | 3 ++- src/sqr/fp_sqr_comba_8.c | 3 ++- src/sqr/fp_sqr_comba_9.c | 3 ++- 15 files changed, 35 insertions(+), 16 deletions(-) diff --git a/src/generators/comba_sqr_gen.c b/src/generators/comba_sqr_gen.c index 1886240..316bfed 100644 --- a/src/generators/comba_sqr_gen.c +++ b/src/generators/comba_sqr_gen.c @@ -20,7 +20,14 @@ printf( "#if defined(TFM_SQR%d) && FP_SIZE >= %d\n" "void fp_sqr_comba%d(fp_int *A, fp_int *B)\n" "{\n" -" fp_digit *a, b[%d], c0, c1, c2, sc0, sc1, sc2;\n" +" fp_digit *a, b[%d], c0, c1, c2;\n", N, N+N, N, N+N); + +if (N > 4) { +printf( +" fp_digit sc0, sc1, sc2;\n"); +} + +printf( "#ifdef TFM_ISO\n" " fp_word tt;\n" "#endif\n" @@ -33,7 +40,7 @@ printf( "\n" " /* output 0 */\n" " SQRADD(a[0],a[0]);\n" -" COMBA_STORE(b[0]);\n", N, N+N, N, N+N); +" COMBA_STORE(b[0]);\n"); for (x = 1; x < N+N-1; x++) { printf( diff --git a/src/sqr/fp_sqr_comba_12.c b/src/sqr/fp_sqr_comba_12.c index f63c184..f55c925 100644 --- a/src/sqr/fp_sqr_comba_12.c +++ b/src/sqr/fp_sqr_comba_12.c @@ -8,7 +8,8 @@ #if defined(TFM_SQR12) && FP_SIZE >= 24 void fp_sqr_comba12(fp_int *A, fp_int *B) { - fp_digit *a, b[24], c0, c1, c2, sc0, sc1, sc2; + fp_digit *a, b[24], c0, c1, c2; + fp_digit sc0, sc1, sc2; #ifdef TFM_ISO fp_word tt; #endif diff --git a/src/sqr/fp_sqr_comba_17.c b/src/sqr/fp_sqr_comba_17.c index b279767..30b27f5 100644 --- a/src/sqr/fp_sqr_comba_17.c +++ b/src/sqr/fp_sqr_comba_17.c @@ -8,7 +8,8 @@ #if defined(TFM_SQR17) && FP_SIZE >= 34 void fp_sqr_comba17(fp_int *A, fp_int *B) { - fp_digit *a, b[34], c0, c1, c2, sc0, sc1, sc2; + fp_digit *a, b[34], c0, c1, c2; + fp_digit sc0, sc1, sc2; #ifdef TFM_ISO fp_word tt; #endif diff --git a/src/sqr/fp_sqr_comba_20.c b/src/sqr/fp_sqr_comba_20.c index c581e3f..c4d80bf 100644 --- a/src/sqr/fp_sqr_comba_20.c +++ b/src/sqr/fp_sqr_comba_20.c @@ -8,7 +8,8 @@ #if defined(TFM_SQR20) && FP_SIZE >= 40 void fp_sqr_comba20(fp_int *A, fp_int *B) { - fp_digit *a, b[40], c0, c1, c2, sc0, sc1, sc2; + fp_digit *a, b[40], c0, c1, c2; + fp_digit sc0, sc1, sc2; #ifdef TFM_ISO fp_word tt; #endif diff --git a/src/sqr/fp_sqr_comba_24.c b/src/sqr/fp_sqr_comba_24.c index 4677b11..ecbcf5e 100644 --- a/src/sqr/fp_sqr_comba_24.c +++ b/src/sqr/fp_sqr_comba_24.c @@ -8,7 +8,8 @@ #if defined(TFM_SQR24) && FP_SIZE >= 48 void fp_sqr_comba24(fp_int *A, fp_int *B) { - fp_digit *a, b[48], c0, c1, c2, sc0, sc1, sc2; + fp_digit *a, b[48], c0, c1, c2; + fp_digit sc0, sc1, sc2; #ifdef TFM_ISO fp_word tt; #endif diff --git a/src/sqr/fp_sqr_comba_28.c b/src/sqr/fp_sqr_comba_28.c index 1105d15..7cfe7f9 100644 --- a/src/sqr/fp_sqr_comba_28.c +++ b/src/sqr/fp_sqr_comba_28.c @@ -8,7 +8,8 @@ #if defined(TFM_SQR28) && FP_SIZE >= 56 void fp_sqr_comba28(fp_int *A, fp_int *B) { - fp_digit *a, b[56], c0, c1, c2, sc0, sc1, sc2; + fp_digit *a, b[56], c0, c1, c2; + fp_digit sc0, sc1, sc2; #ifdef TFM_ISO fp_word tt; #endif diff --git a/src/sqr/fp_sqr_comba_3.c b/src/sqr/fp_sqr_comba_3.c index 233c293..a185e50 100644 --- a/src/sqr/fp_sqr_comba_3.c +++ b/src/sqr/fp_sqr_comba_3.c @@ -8,7 +8,7 @@ #if defined(TFM_SQR3) && FP_SIZE >= 6 void fp_sqr_comba3(fp_int *A, fp_int *B) { - fp_digit *a, b[6], c0, c1, c2, sc0, sc1, sc2; + fp_digit *a, b[6], c0, c1, c2; #ifdef TFM_ISO fp_word tt; #endif diff --git a/src/sqr/fp_sqr_comba_32.c b/src/sqr/fp_sqr_comba_32.c index 59e899a..a34a1c9 100644 --- a/src/sqr/fp_sqr_comba_32.c +++ b/src/sqr/fp_sqr_comba_32.c @@ -8,7 +8,8 @@ #if defined(TFM_SQR32) && FP_SIZE >= 64 void fp_sqr_comba32(fp_int *A, fp_int *B) { - fp_digit *a, b[64], c0, c1, c2, sc0, sc1, sc2; + fp_digit *a, b[64], c0, c1, c2; + fp_digit sc0, sc1, sc2; #ifdef TFM_ISO fp_word tt; #endif diff --git a/src/sqr/fp_sqr_comba_4.c b/src/sqr/fp_sqr_comba_4.c index 3e3fcaa..60adda5 100644 --- a/src/sqr/fp_sqr_comba_4.c +++ b/src/sqr/fp_sqr_comba_4.c @@ -8,7 +8,7 @@ #if defined(TFM_SQR4) && FP_SIZE >= 8 void fp_sqr_comba4(fp_int *A, fp_int *B) { - fp_digit *a, b[8], c0, c1, c2, sc0, sc1, sc2; + fp_digit *a, b[8], c0, c1, c2; #ifdef TFM_ISO fp_word tt; #endif diff --git a/src/sqr/fp_sqr_comba_48.c b/src/sqr/fp_sqr_comba_48.c index 638a4ff..0bc7cc2 100644 --- a/src/sqr/fp_sqr_comba_48.c +++ b/src/sqr/fp_sqr_comba_48.c @@ -8,7 +8,8 @@ #if defined(TFM_SQR48) && FP_SIZE >= 96 void fp_sqr_comba48(fp_int *A, fp_int *B) { - fp_digit *a, b[96], c0, c1, c2, sc0, sc1, sc2; + fp_digit *a, b[96], c0, c1, c2; + fp_digit sc0, sc1, sc2; #ifdef TFM_ISO fp_word tt; #endif diff --git a/src/sqr/fp_sqr_comba_6.c b/src/sqr/fp_sqr_comba_6.c index 63a739d..ffa4d39 100644 --- a/src/sqr/fp_sqr_comba_6.c +++ b/src/sqr/fp_sqr_comba_6.c @@ -8,7 +8,8 @@ #if defined(TFM_SQR6) && FP_SIZE >= 12 void fp_sqr_comba6(fp_int *A, fp_int *B) { - fp_digit *a, b[12], c0, c1, c2, sc0, sc1, sc2; + fp_digit *a, b[12], c0, c1, c2; + fp_digit sc0, sc1, sc2; #ifdef TFM_ISO fp_word tt; #endif diff --git a/src/sqr/fp_sqr_comba_64.c b/src/sqr/fp_sqr_comba_64.c index d95be7a..7620ea9 100644 --- a/src/sqr/fp_sqr_comba_64.c +++ b/src/sqr/fp_sqr_comba_64.c @@ -8,7 +8,8 @@ #if defined(TFM_SQR64) && FP_SIZE >= 128 void fp_sqr_comba64(fp_int *A, fp_int *B) { - fp_digit *a, b[128], c0, c1, c2, sc0, sc1, sc2; + fp_digit *a, b[128], c0, c1, c2; + fp_digit sc0, sc1, sc2; #ifdef TFM_ISO fp_word tt; #endif diff --git a/src/sqr/fp_sqr_comba_7.c b/src/sqr/fp_sqr_comba_7.c index 6f2b076..a7b14ce 100644 --- a/src/sqr/fp_sqr_comba_7.c +++ b/src/sqr/fp_sqr_comba_7.c @@ -8,7 +8,8 @@ #if defined(TFM_SQR7) && FP_SIZE >= 14 void fp_sqr_comba7(fp_int *A, fp_int *B) { - fp_digit *a, b[14], c0, c1, c2, sc0, sc1, sc2; + fp_digit *a, b[14], c0, c1, c2; + fp_digit sc0, sc1, sc2; #ifdef TFM_ISO fp_word tt; #endif diff --git a/src/sqr/fp_sqr_comba_8.c b/src/sqr/fp_sqr_comba_8.c index 33da00f..3746793 100644 --- a/src/sqr/fp_sqr_comba_8.c +++ b/src/sqr/fp_sqr_comba_8.c @@ -8,7 +8,8 @@ #if defined(TFM_SQR8) && FP_SIZE >= 16 void fp_sqr_comba8(fp_int *A, fp_int *B) { - fp_digit *a, b[16], c0, c1, c2, sc0, sc1, sc2; + fp_digit *a, b[16], c0, c1, c2; + fp_digit sc0, sc1, sc2; #ifdef TFM_ISO fp_word tt; #endif diff --git a/src/sqr/fp_sqr_comba_9.c b/src/sqr/fp_sqr_comba_9.c index 5ad3981..91503d6 100644 --- a/src/sqr/fp_sqr_comba_9.c +++ b/src/sqr/fp_sqr_comba_9.c @@ -8,7 +8,8 @@ #if defined(TFM_SQR9) && FP_SIZE >= 18 void fp_sqr_comba9(fp_int *A, fp_int *B) { - fp_digit *a, b[18], c0, c1, c2, sc0, sc1, sc2; + fp_digit *a, b[18], c0, c1, c2; + fp_digit sc0, sc1, sc2; #ifdef TFM_ISO fp_word tt; #endif