Skip to content

Commit 5d68850

Browse files
committed
Re-enable SSE2 probes for Solaris
Fix VMAC-64 crash on 32-bit Solaris i86pc
1 parent cd16435 commit 5d68850

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

cpu.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -511,9 +511,9 @@ void DetectX86Features()
511511
#endif
512512

513513
// Solaris 11 i86pc does not signal SSE support using
514-
// OSXSAVE. We need to probe for SSE support. CR4 and
515-
// bit 18 is not available to userland.
516-
// TODO: cut something in when testing is available.
514+
// OSXSAVE. We need to probe for SSE support.
515+
if (g_hasSSE2 == false)
516+
g_hasSSE2 = CPU_ProbeSSE2();
517517

518518
if (g_hasSSE2 == false)
519519
goto done;

vmac.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ void VMAC_Base::VHASH_Update_SSE2(const word64 *data, size_t blocksRemainingInWo
207207
#ifdef __GNUC__
208208
__asm__ __volatile__
209209
(
210-
AS1( push %%ebx)
211210
AS1( push %0) // L1KeyLength
212211
AS1( pop %%ebx)
213212
INTEL_NOPREFIX
@@ -429,11 +428,10 @@ void VMAC_Base::VHASH_Update_SSE2(const word64 *data, size_t blocksRemainingInWo
429428
AS1( emms)
430429
#ifdef __GNUC__
431430
ATT_PREFIX
432-
AS1( pop %%ebx)
433431
:
434432
: "m" (L1KeyLength), "c" (blocksRemainingInWord64), "S" (data),
435433
"D" (nhK+tagPart*2), "d" (m_isFirstBlock), "a" (polyS+tagPart*4)
436-
: "esp", "memory", "cc"
434+
: "ebx", "memory", "cc"
437435
);
438436
#endif
439437
}

vmac.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ class VMAC_Base : public IteratedHashBase<word64, MessageAuthenticationCode>
6868
/// \tparam T_BlockCipher block cipher
6969
/// \tparam T_DigestBitSize digest size, in bits
7070
/// \details VMAC is a block cipher-based message authentication code algorithm
71-
/// using a universal hash proposed by Ted Krovetz and Wei Dai in April 2007. The
72-
/// algorithm was designed for high performance backed by a formal analysis.
71+
/// using a universal hash proposed by Ted Krovetz and Wei Dai in April 2007. The
72+
/// algorithm was designed for high performance backed by a formal analysis.
7373
/// \details The implementation is based on Ted Krovetz's public domain vmac.c
74-
/// and <a href="http://tools.ietf.org/html/draft-krovetz-vmac-01">draft-krovetz-vmac-01.txt</a>.
74+
/// and <a href="http://tools.ietf.org/html/draft-krovetz-vmac-01">draft-krovetz-vmac-01.txt</a>.
7575
/// \sa <a href="http://www.cryptolounge.org/wiki/VMAC">VMAC</a>.
7676
/// \since Crypto++ 5.5
7777
template <class T_BlockCipher, int T_DigestBitSize = 128>

0 commit comments

Comments
 (0)