diff options
author | Kenny Root <kroot@google.com> | 2015-07-24 21:10:53 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-07-24 21:10:53 +0000 |
commit | dc35386c92b2c545de07d711009d3e8f7e25db00 (patch) | |
tree | 4d210b442e8e6742e9b0ff9dca4fc158c1a6a03e /win-x86_64/crypto/rand/rdrand-x86_64.asm | |
parent | ffd8e0a5b40ce124e6dce4cb7546a26680d33d16 (diff) | |
parent | 07f4f42347557420f105a72d9a93bc8ee88a3dc5 (diff) | |
download | external_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 'win-x86_64/crypto/rand/rdrand-x86_64.asm')
-rw-r--r-- | win-x86_64/crypto/rand/rdrand-x86_64.asm | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/win-x86_64/crypto/rand/rdrand-x86_64.asm b/win-x86_64/crypto/rand/rdrand-x86_64.asm index a63ea69..4c03791 100644 --- a/win-x86_64/crypto/rand/rdrand-x86_64.asm +++ b/win-x86_64/crypto/rand/rdrand-x86_64.asm @@ -5,6 +5,9 @@ default rel section .text code align=64 + + + global CRYPTO_rdrand ALIGN 16 @@ -16,7 +19,52 @@ $L$SEH_begin_CRYPTO_rdrand: mov rdi,rcx -DB 0x48,0x0f,0xc7,0xf0 + xor rax,rax + + +DB 0x48,0x0f,0xc7,0xf1 + + adc rax,rax + mov QWORD[rdi],rcx + mov rdi,QWORD[8+rsp] ;WIN64 epilogue + mov rsi,QWORD[16+rsp] + DB 0F3h,0C3h ;repret + + + + + +global CRYPTO_rdrand_multiple8_buf + +ALIGN 16 +CRYPTO_rdrand_multiple8_buf: + mov QWORD[8+rsp],rdi ;WIN64 prologue + mov QWORD[16+rsp],rsi + mov rax,rsp +$L$SEH_begin_CRYPTO_rdrand_multiple8_buf: + mov rdi,rcx + mov rsi,rdx + + + test rsi,rsi + jz NEAR $L$out + mov rdx,8 +$L$loop: + + +DB 0x48,0x0f,0xc7,0xf1 + jnc NEAR $L$err + mov QWORD[rdi],rcx + add rdi,rdx + sub rsi,rdx + jnz NEAR $L$loop +$L$out: + mov rax,1 + mov rdi,QWORD[8+rsp] ;WIN64 epilogue + mov rsi,QWORD[16+rsp] + DB 0F3h,0C3h ;repret +$L$err: + xor rax,rax mov rdi,QWORD[8+rsp] ;WIN64 epilogue mov rsi,QWORD[16+rsp] DB 0F3h,0C3h ;repret |