summaryrefslogtreecommitdiffstats
path: root/mac-x86_64/crypto/rand/rdrand-x86_64.S
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2015-07-24 21:10:53 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-07-24 21:10:53 +0000
commitdc35386c92b2c545de07d711009d3e8f7e25db00 (patch)
tree4d210b442e8e6742e9b0ff9dca4fc158c1a6a03e /mac-x86_64/crypto/rand/rdrand-x86_64.S
parentffd8e0a5b40ce124e6dce4cb7546a26680d33d16 (diff)
parent07f4f42347557420f105a72d9a93bc8ee88a3dc5 (diff)
downloadexternal_boringssl-dc35386c92b2c545de07d711009d3e8f7e25db00.zip
external_boringssl-dc35386c92b2c545de07d711009d3e8f7e25db00.tar.gz
external_boringssl-dc35386c92b2c545de07d711009d3e8f7e25db00.tar.bz2
am 07f4f423: Merge changes Icdc56a50,I63d5dc28,Ia7d0c5d8,I47406533
* commit '07f4f42347557420f105a72d9a93bc8ee88a3dc5': Handle RDRAND failures. dsa_pub_encode: Write out DSA parameters (p, q, g) in addition to key. Fix for CVE-2015-1789. Fixes for CVE-2015-1791.
Diffstat (limited to 'mac-x86_64/crypto/rand/rdrand-x86_64.S')
-rw-r--r--mac-x86_64/crypto/rand/rdrand-x86_64.S39
1 files changed, 38 insertions, 1 deletions
diff --git a/mac-x86_64/crypto/rand/rdrand-x86_64.S b/mac-x86_64/crypto/rand/rdrand-x86_64.S
index 1ba990f..f0df296 100644
--- a/mac-x86_64/crypto/rand/rdrand-x86_64.S
+++ b/mac-x86_64/crypto/rand/rdrand-x86_64.S
@@ -1,11 +1,48 @@
#if defined(__x86_64__)
.text
+
+
+
.globl _CRYPTO_rdrand
.private_extern _CRYPTO_rdrand
.p2align 4
_CRYPTO_rdrand:
-.byte 0x48, 0x0f, 0xc7, 0xf0
+ xorq %rax,%rax
+
+
+.byte 0x48, 0x0f, 0xc7, 0xf1
+
+ adcq %rax,%rax
+ movq %rcx,0(%rdi)
+ .byte 0xf3,0xc3
+
+
+
+
+
+.globl _CRYPTO_rdrand_multiple8_buf
+.private_extern _CRYPTO_rdrand_multiple8_buf
+
+.p2align 4
+_CRYPTO_rdrand_multiple8_buf:
+ testq %rsi,%rsi
+ jz L$out
+ movq $8,%rdx
+L$loop:
+
+
+.byte 0x48, 0x0f, 0xc7, 0xf1
+ jnc L$err
+ movq %rcx,0(%rdi)
+ addq %rdx,%rdi
+ subq %rdx,%rsi
+ jnz L$loop
+L$out:
+ movq $1,%rax
+ .byte 0xf3,0xc3
+L$err:
+ xorq %rax,%rax
.byte 0xf3,0xc3
#endif