Silence MSVC warning C4210.
The warning is:
C4210: nonstandard extension used : function given file scope.
It is caused by function declarations that aren't at the top level in a
file.
Change-Id: Ib1c2ae64e15e66eb0a7255a29c0e560fbf55c2b2
Reviewed-on: https://boringssl-review.googlesource.com/6210
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c1a6a37..38dfe45 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,7 +25,6 @@
"C4127" # conditional expression is constant
"C4200" # nonstandard extension used : zero-sized array in
# struct/union.
- "C4210" # nonstandard extension used : function given file scope
"C4242" # 'function' : conversion from 'int' to 'uint8_t',
# possible loss of data
"C4244" # 'function' : conversion from 'int' to 'uint8_t',
diff --git a/crypto/bn/exponentiation.c b/crypto/bn/exponentiation.c
index 6c5e11b..ef18812 100644
--- a/crypto/bn/exponentiation.c
+++ b/crypto/bn/exponentiation.c
@@ -123,6 +123,17 @@
#define RSAZ_ENABLED
#include "rsaz_exp.h"
+
+void bn_mul_mont_gather5(BN_ULONG *rp, const BN_ULONG *ap, const void *table,
+ const BN_ULONG *np, const BN_ULONG *n0, int num,
+ int power);
+void bn_scatter5(const BN_ULONG *inp, size_t num, void *table, size_t power);
+void bn_gather5(BN_ULONG *out, size_t num, void *table, size_t power);
+void bn_power5(BN_ULONG *rp, const BN_ULONG *ap, const void *table,
+ const BN_ULONG *np, const BN_ULONG *n0, int num, int power);
+int bn_from_montgomery(BN_ULONG *rp, const BN_ULONG *ap,
+ const BN_ULONG *not_used, const BN_ULONG *np,
+ const BN_ULONG *n0, int num);
#endif
int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) {
@@ -994,19 +1005,6 @@
/* Dedicated window==4 case improves 512-bit RSA sign by ~15%, but as
* 512-bit RSA is hardly relevant, we omit it to spare size... */
if (window == 5 && top > 1) {
- void bn_mul_mont_gather5(BN_ULONG * rp, const BN_ULONG * ap,
- const void * table, const BN_ULONG * np,
- const BN_ULONG * n0, int num, int power);
- void bn_scatter5(const BN_ULONG * inp, size_t num, void * table,
- size_t power);
- void bn_gather5(BN_ULONG * out, size_t num, void * table, size_t power);
- void bn_power5(BN_ULONG * rp, const BN_ULONG * ap, const void * table,
- const BN_ULONG * np, const BN_ULONG * n0, int num,
- int power);
- int bn_from_montgomery(BN_ULONG * rp, const BN_ULONG * ap,
- const BN_ULONG * not_used, const BN_ULONG * np,
- const BN_ULONG * n0, int num);
-
BN_ULONG *np = mont->N.d, *n0 = mont->n0, *np2;
/* BN_to_montgomery can contaminate words above .top