rdrand-x86_64.asm 731 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. ; This file is generated from a similarly-named Perl script in the BoringSSL
  2. ; source tree. Do not edit by hand.
  3. default rel
  4. %define XMMWORD
  5. %define YMMWORD
  6. %define ZMMWORD
  7. %ifdef BORINGSSL_PREFIX
  8. %include "boringssl_prefix_symbols_nasm.inc"
  9. %endif
  10. section .text code align=64
  11. global CRYPTO_rdrand
  12. ALIGN 16
  13. CRYPTO_rdrand:
  14. xor rax,rax
  15. DB 73,15,199,240
  16. adc rax,rax
  17. mov QWORD[rcx],r8
  18. DB 0F3h,0C3h ;repret
  19. global CRYPTO_rdrand_multiple8_buf
  20. ALIGN 16
  21. CRYPTO_rdrand_multiple8_buf:
  22. test rdx,rdx
  23. jz NEAR $L$out
  24. mov r8,8
  25. $L$loop:
  26. DB 73,15,199,241
  27. jnc NEAR $L$err
  28. mov QWORD[rcx],r9
  29. add rcx,r8
  30. sub rdx,r8
  31. jnz NEAR $L$loop
  32. $L$out:
  33. mov rax,1
  34. DB 0F3h,0C3h ;repret
  35. $L$err:
  36. xor rax,rax
  37. DB 0F3h,0C3h ;repret