summaryrefslogtreecommitdiff
path: root/vmac.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2019-07-05 03:38:03 -0400
committerJeffrey Walton <noloader@gmail.com>2019-07-05 03:38:03 -0400
commitf7986129dfe3203ad8d754a213c977452cacf709 (patch)
tree165a52c87676c557f0d6b05644279b2546c8619c /vmac.cpp
parent6bead34bd9fc875c155aecc8ec25cdccd6d9ce56 (diff)
downloadcryptopp-git-f7986129dfe3203ad8d754a213c977452cacf709.tar.gz
Clear Asan finding in VMAC under 32-bit inline ASM (GH #860)
This one has been nagging us for a while. Tested OK under i686 and x86_64.
Diffstat (limited to 'vmac.cpp')
-rw-r--r--vmac.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/vmac.cpp b/vmac.cpp
index 535cce21..cd5dcbc3 100644
--- a/vmac.cpp
+++ b/vmac.cpp
@@ -184,23 +184,21 @@ __attribute__ ((noinline)) // Intel Compiler 9.1 workaround
#endif
VMAC_Base::VHASH_Update_SSE2(const word64 *data, size_t blocksRemainingInWord64, int tagPart)
{
- CRYPTOPP_ASSERT(IsAlignedOn(m_polyState(),GetAlignmentOf<word64>()));
- CRYPTOPP_ASSERT(IsAlignedOn(m_nhKey(),GetAlignmentOf<word64>()));
-
const word64 *nhK = m_nhKey();
word64 *polyS = (word64*)(void*)m_polyState();
word32 L1KeyLength = m_L1KeyLength;
- // These are used in the ASM, but some analysis engines cnnot determine it.
- CRYPTOPP_UNUSED(data); CRYPTOPP_UNUSED(tagPart); CRYPTOPP_UNUSED(L1KeyLength);
+ // These are used in the ASM, but some analysis services miss it.
+ CRYPTOPP_UNUSED(data); CRYPTOPP_UNUSED(tagPart);
+ CRYPTOPP_UNUSED(L1KeyLength);
CRYPTOPP_UNUSED(blocksRemainingInWord64);
#ifdef __GNUC__
- word32 temp;
+
__asm__ __volatile__
(
- AS2( mov %%ebx, %0)
- AS2( mov %1, %%ebx)
+ AS1( push %%ebx)
+ AS2( mov %0, %%ebx)
INTEL_NOPREFIX
#else
#if defined(__INTEL_COMPILER)
@@ -419,10 +417,11 @@ VMAC_Base::VHASH_Update_SSE2(const word64 *data, size_t blocksRemainingInWord64,
AS_POP_IF86( bp)
AS1( emms)
#ifdef __GNUC__
+ AS1( pop %%ebx)
ATT_PREFIX
- AS2( mov %0, %%ebx)
- : "=m" (temp)
- : "m" (L1KeyLength), "c" (blocksRemainingInWord64), "S" (data), "D" (nhK+tagPart*2), "d" (m_isFirstBlock), "a" (polyS+tagPart*4)
+ :
+ : "m" (L1KeyLength), "c" (blocksRemainingInWord64), "S" (data),
+ "D" (nhK+tagPart*2), "d" (m_isFirstBlock), "a" (polyS+tagPart*4)
: "memory", "cc"
);
#endif