Re-enable SSE2 probes for Solaris

Fix VMAC-64 crash on 32-bit Solaris i86pc
This commit is contained in:
Jeffrey Walton 2020-02-22 16:18:43 -05:00
parent cd16435544
commit 5d68850041
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
3 changed files with 7 additions and 9 deletions

View File

@ -511,9 +511,9 @@ void DetectX86Features()
#endif
// Solaris 11 i86pc does not signal SSE support using
// OSXSAVE. We need to probe for SSE support. CR4 and
// bit 18 is not available to userland.
// TODO: cut something in when testing is available.
// OSXSAVE. We need to probe for SSE support.
if (g_hasSSE2 == false)
g_hasSSE2 = CPU_ProbeSSE2();
if (g_hasSSE2 == false)
goto done;

View File

@ -207,7 +207,6 @@ void VMAC_Base::VHASH_Update_SSE2(const word64 *data, size_t blocksRemainingInWo
#ifdef __GNUC__
__asm__ __volatile__
(
AS1( push %%ebx)
AS1( push %0) // L1KeyLength
AS1( pop %%ebx)
INTEL_NOPREFIX
@ -429,11 +428,10 @@ void VMAC_Base::VHASH_Update_SSE2(const word64 *data, size_t blocksRemainingInWo
AS1( emms)
#ifdef __GNUC__
ATT_PREFIX
AS1( pop %%ebx)
:
: "m" (L1KeyLength), "c" (blocksRemainingInWord64), "S" (data),
"D" (nhK+tagPart*2), "d" (m_isFirstBlock), "a" (polyS+tagPart*4)
: "esp", "memory", "cc"
: "ebx", "memory", "cc"
);
#endif
}

6
vmac.h
View File

@ -68,10 +68,10 @@ protected:
/// \tparam T_BlockCipher block cipher
/// \tparam T_DigestBitSize digest size, in bits
/// \details VMAC is a block cipher-based message authentication code algorithm
/// using a universal hash proposed by Ted Krovetz and Wei Dai in April 2007. The
/// algorithm was designed for high performance backed by a formal analysis.
/// using a universal hash proposed by Ted Krovetz and Wei Dai in April 2007. The
/// algorithm was designed for high performance backed by a formal analysis.
/// \details The implementation is based on Ted Krovetz's public domain vmac.c
/// and <a href="http://tools.ietf.org/html/draft-krovetz-vmac-01">draft-krovetz-vmac-01.txt</a>.
/// and <a href="http://tools.ietf.org/html/draft-krovetz-vmac-01">draft-krovetz-vmac-01.txt</a>.
/// \sa <a href="http://www.cryptolounge.org/wiki/VMAC">VMAC</a>.
/// \since Crypto++ 5.5
template <class T_BlockCipher, int T_DigestBitSize = 128>