summaryrefslogtreecommitdiff
path: root/whrlpool.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2015-11-18 15:32:28 -0500
committerJeffrey Walton <noloader@gmail.com>2015-11-18 15:32:28 -0500
commit6ac1e46a1fb01f01705b67dd553d5ba317b1dc3e (patch)
treef0d873d0b377a91dce5ee384e60426ef57efc92b /whrlpool.cpp
parentd2fda9bd4231a7dfcb44e59150f11246d992843f (diff)
downloadcryptopp-git-6ac1e46a1fb01f01705b67dd553d5ba317b1dc3e.tar.gz
Cleared issues 11,12,13 (Clang integrated assembler), 58 (RC rollup), 66 (Coverity rollup)
Diffstat (limited to 'whrlpool.cpp')
-rw-r--r--whrlpool.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/whrlpool.cpp b/whrlpool.cpp
index bf20aee4..087966fa 100644
--- a/whrlpool.cpp
+++ b/whrlpool.cpp
@@ -74,12 +74,23 @@
#include "misc.h"
#include "cpu.h"
+// "Inline assembly operands don't work with .intel_syntax",
+// http://llvm.org/bugs/show_bug.cgi?id=24232
+#if defined(CRYPTOPP_DISABLE_INTEL_ASM)
+# undef CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE
+# undef CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE
+# define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 0
+# define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 0
+#endif
+
NAMESPACE_BEGIN(CryptoPP)
+#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void Whirlpool_TestInstantiations()
{
Whirlpool x;
}
+#endif
void Whirlpool::InitState(HashWordType *state)
{
@@ -407,7 +418,7 @@ void Whirlpool::Transform(word64 *digest, const word64 *block)
#endif
__asm__ __volatile__
(
- ".intel_syntax noprefix;"
+ INTEL_NOPREFIX
AS_PUSH_IF86( bx)
AS2( mov AS_REG_6, WORD_REG(ax))
#else
@@ -579,7 +590,7 @@ void Whirlpool::Transform(word64 *digest, const word64 *block)
AS_POP_IF86( bx)
#endif
#ifdef __GNUC__
- ".att_syntax prefix;"
+ ATT_PREFIX
:
: "a" (Whirlpool_C), "c" (digest), "d" (block)
#if CRYPTOPP_BOOL_X64
@@ -656,8 +667,9 @@ void Whirlpool::Transform(word64 *digest, const word64 *block)
int r=0;
while (true)
{
- word64 w0, w1, w2, w3, w4, w5, w6, w7; // temporary storage
- word32 t;
+ // Added initialization due to Coverity findings.
+ word64 w0=0, w1=0, w2=0, w3=0, w4=0, w5=0, w6=0, w7=0;
+ word32 t=0;
KSL(0, 4, 3, 2, 1, 0)
KSL(0, 0, 7, 6, 5, 4)