| 1 |
; This file is generated from a similarly-named Perl script in the BoringSSL |
| 2 |
; source tree. Do not edit by hand. |
| 3 |
|
| 4 |
%ifidn __OUTPUT_FORMAT__, win64 |
| 5 |
default rel |
| 6 |
%define XMMWORD |
| 7 |
%define YMMWORD |
| 8 |
%define ZMMWORD |
| 9 |
|
| 10 |
%ifdef BORINGSSL_PREFIX |
| 11 |
%include "boringssl_prefix_symbols_nasm.inc" |
| 12 |
%endif |
| 13 |
section .text code align=64 |
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
global CRYPTO_rdrand |
| 20 |
|
| 21 |
ALIGN 16 |
| 22 |
CRYPTO_rdrand: |
| 23 |
|
| 24 |
xor rax,rax |
| 25 |
DB 73,15,199,240 |
| 26 |
|
| 27 |
adc rax,rax |
| 28 |
mov QWORD[rcx],r8 |
| 29 |
DB 0F3h,0C3h ;repret |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
global CRYPTO_rdrand_multiple8_buf |
| 38 |
|
| 39 |
ALIGN 16 |
| 40 |
CRYPTO_rdrand_multiple8_buf: |
| 41 |
|
| 42 |
test rdx,rdx |
| 43 |
jz NEAR $L$out |
| 44 |
mov r8,8 |
| 45 |
$L$loop: |
| 46 |
DB 73,15,199,241 |
| 47 |
jnc NEAR $L$err |
| 48 |
mov QWORD[rcx],r9 |
| 49 |
add rcx,r8 |
| 50 |
sub rdx,r8 |
| 51 |
jnz NEAR $L$loop |
| 52 |
$L$out: |
| 53 |
mov rax,1 |
| 54 |
DB 0F3h,0C3h ;repret |
| 55 |
$L$err: |
| 56 |
xor rax,rax |
| 57 |
DB 0F3h,0C3h ;repret |
| 58 |
|
| 59 |
|
| 60 |
%else |
| 61 |
; Work around https://bugzilla.nasm.us/show_bug.cgi?id=3392738 |
| 62 |
ret |
| 63 |
%endif |