Save/restore 64-bit registers for Padlock on x86_64

pull/696/head
Jeffrey Walton 2018-07-27 11:21:54 -04:00
parent 5ea410c1d3
commit 7afd05c336
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 4 additions and 6 deletions

View File

@ -27,10 +27,8 @@ PadlockRNG::PadlockRNG(word32 divisor)
{
#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
);