summaryrefslogtreecommitdiff
path: root/sha.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2019-05-20 17:03:57 -0400
committerJeffrey Walton <noloader@gmail.com>2019-05-20 17:03:57 -0400
commitb1b6ea5b78c2e38cf43c3fb4a4531625d7352df0 (patch)
tree37da5cf1a0c9167e7ba1fa5e835e8df8ffe7b066 /sha.cpp
parent5c7c09233640de1ba29941ac67f2b6df8c4c6c17 (diff)
downloadcryptopp-git-b1b6ea5b78c2e38cf43c3fb4a4531625d7352df0.tar.gz
Fold declarations for CRYPTOGAMS_armcaps
Also declare storage for CRYPTOGAMS_armcaps. This moves the symbol from BSS to initialized data. The Cryptogams module declares the symbol as common, so they are weak and use our declaration.
Diffstat (limited to 'sha.cpp')
-rw-r--r--sha.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/sha.cpp b/sha.cpp
index 587405b5..4f465532 100644
--- a/sha.cpp
+++ b/sha.cpp
@@ -59,6 +59,11 @@
# undef CRYPTOPP_SSE2_ASM_AVAILABLE
#endif
+#if CRYPTOGAMS_ARM_SHA1 || CRYPTOGAMS_ARM_SHA256 || CRYPTOGAMS_ARM_SHA512
+extern "C" unsigned int CRYPTOGAMS_armcaps;
+unsigned int CRYPTOGAMS_armcaps = 0;
+#endif
+
NAMESPACE_BEGIN(CryptoPP)
#if CRYPTOPP_SHANI_AVAILABLE
@@ -67,7 +72,6 @@ extern void SHA256_HashMultipleBlocks_SHANI(word32 *state, const word32 *data, s
#endif
#if CRYPTOGAMS_ARM_SHA1
-extern "C" unsigned int CRYPTOGAMS_armcaps;
extern "C" int sha1_block_data_order(word32* state, const word32 *data, size_t blocks);
#endif
@@ -80,7 +84,6 @@ extern void SHA256_HashMultipleBlocks_ARMV8(word32 *state, const word32 *data, s
#endif
#if CRYPTOGAMS_ARM_SHA256
-extern "C" unsigned int CRYPTOGAMS_armcaps;
extern "C" int sha256_block_data_order(word32* state, const word32 *data, size_t blocks);
#endif
@@ -94,7 +97,6 @@ extern void SHA512_HashMultipleBlocks_POWER8(word64 *state, const word64 *data,
#endif
#if CRYPTOGAMS_ARM_SHA512
-extern "C" unsigned int CRYPTOGAMS_armcaps;
extern "C" int sha512_block_data_order(word64* state, const word64 *data, size_t blocks);
#endif