summaryrefslogtreecommitdiff
path: root/rdrand.cpp
diff options
context:
space:
mode:
authorName <jowehrli>2016-01-26 02:15:16 -0500
committerJeffrey Walton <noloader@gmail.com>2016-01-26 02:15:16 -0500
commitb0fb747182e3b83f0713b6d1f1531515efacc1e1 (patch)
tree43f5ff6d1dcc03c7424998da69a4ab808c05318d /rdrand.cpp
parent0f4b86c62a33f73556a5bea6680a65afc9f13de1 (diff)
downloadcryptopp-git-b0fb747182e3b83f0713b6d1f1531515efacc1e1.tar.gz
Fix missing clobbered registers (Issue 124)
Diffstat (limited to 'rdrand.cpp')
-rw-r--r--rdrand.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/rdrand.cpp b/rdrand.cpp
index 55fde3ab..5d7b8e2e 100644
--- a/rdrand.cpp
+++ b/rdrand.cpp
@@ -253,7 +253,11 @@ static int GCC_RRA_GenerateBlock(byte *output, size_t size, unsigned int safety)
"setc %1; "
: "=a" (val), "=qm" (rc)
:
- : "cc"
+#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32
+ : "rax", "cc"
+#else
+ : "eax", "cc"
+#endif
);
if (rc)
@@ -434,7 +438,11 @@ static int GCC_RSA_GenerateBlock(byte *output, size_t size, unsigned int safety)
"setc %1; "
: "=a" (val), "=qm" (rc)
:
- : "cc"
+#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32
+ : "rax", "cc"
+#else
+ : "eax", "cc"
+#endif
);
if (rc)