diff options
author | Jeffrey Walton <noloader@gmail.com> | 2018-07-27 11:21:54 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2018-07-27 11:21:54 -0400 |
commit | 7afd05c3366a1dfc28fed603e32a281b2912b7a1 (patch) | |
tree | bf32219586a8ce43db3677a6d64440a7097117cb /padlkrng.cpp | |
parent | 5ea410c1d33e4201c24e52b343110b90a3d9f85e (diff) | |
download | cryptopp-git-7afd05c3366a1dfc28fed603e32a281b2912b7a1.tar.gz |
Save/restore 64-bit registers for Padlock on x86_64
Diffstat (limited to 'padlkrng.cpp')
-rw-r--r-- | padlkrng.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/padlkrng.cpp b/padlkrng.cpp index f1401543..e7e1cc2b 100644 --- a/padlkrng.cpp +++ b/padlkrng.cpp @@ -23,14 +23,12 @@ std::string PadlockRNG::AlgorithmProvider() const }
PadlockRNG::PadlockRNG(word32 divisor)
-: m_divisor(DivisorHelper(divisor)), m_msr(0)
+ : m_divisor(DivisorHelper(divisor)), m_msr(0)
{
#if defined(CRYPTOPP_X86_ASM_AVAILABLE)
if (!HasPadlockRNG())
- throw PadlockRNG_Err("PadlockRNG", "PadlockRNG generator not available");
-#else
- throw PadlockRNG_Err("PadlockRNG", "PadlockRNG generator not available");
#endif
+ throw PadlockRNG_Err("PadlockRNG", "PadlockRNG generator not available");
}
void PadlockRNG::GenerateBlock(byte *output, size_t size)
@@ -54,9 +52,9 @@ void PadlockRNG::GenerateBlock(byte *output, size_t size) : "=g" (m_msr) : "g" (m_buffer.data()), "g" (m_divisor)
#if (CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64)
- : "eax", "edx", "rdi", "cc"
+ : "rax", "rbx", "rdx", "rdi", "cc"
#else
- : "eax", "edx", "edi", "cc"
+ : "eax", "ebx", "edx", "edi", "cc"
#endif
);
|