rsa exp: move declarations before code (3.0)
authorPauli <pauli@openssl.org>
Sat, 18 Dec 2021 04:21:38 +0000 (15:21 +1100)
committerTomas Mraz <tomas@openssl.org>
Tue, 21 Dec 2021 10:16:27 +0000 (11:16 +0100)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17305)

crypto/bn/rsaz_exp_x2.c

index 15db0c1f05aa9c9364ce702e6cca79cb34d7d94c..0e0aff1f85d7700f09c828bf994c8dfcde73f263 100644 (file)
@@ -318,6 +318,8 @@ static void RSAZ_exp52x20_x2_256(BN_ULONG *out,          /* [2][20] */
         int exp_chunk_no = exp_bit_no / 64;
         int exp_chunk_shift = exp_bit_no % 64;
 
+        BN_ULONG red_table_idx_0, red_table_idx_1;
+
         /*
          * If rem == 0, then
          *      exp_bit_no = modulus_bitsize - exp_win_size
@@ -329,8 +331,8 @@ static void RSAZ_exp52x20_x2_256(BN_ULONG *out,          /* [2][20] */
         OPENSSL_assert(rem != 0);
 
         /* Process 1-st exp window - just init result */
-        BN_ULONG red_table_idx_0 = expz[0][exp_chunk_no];
-        BN_ULONG red_table_idx_1 = expz[1][exp_chunk_no];
+        red_table_idx_0 = expz[0][exp_chunk_no];
+        red_table_idx_1 = expz[1][exp_chunk_no];
         /*
          * The function operates with fixed moduli sizes divisible by 64,
          * thus table index here is always in supported range [0, EXP_WIN_SIZE).