RDSEED / RDRAND
Simple interface to rdseed / rdrand instructions.
API
get64, 32, 16 - nonblocking variants returning random number as an Option.fill_bytes- fills byte slice with random values. blocking function.blocking- wrapper returning random number when ready and panicking if operation is not supported by hardware.is_available- query if hardware supports random operations.randmodule - strong pseudo random RDRAND operations. These operations will less likely to block. Useful for generating lot of random numbers quickly.- Crate defaults to true random RDSEED operations.
Portability
Intel or AMD x64 CPU with RDSEED / RDRAND instructions.
Security
- AMD Zen 5 / Ryzen 9000HX - 16 and 32-bit version of RDSEED can return 0 if entropy is exhaused by attacker.
- Intel SRBSD Crosstalk - Side channel access to shared internal buffers including SGX. Possible to read result of RDRAND and RDSEED.
- AMD Cyan Skillfish - RDSEED returned fixed value 0xFFFFFFFF.
License
This is free and unencumbered software released into the public domain.
This code can be used under terms of CC0 or the Unlicense.
![]()