Skip to content

Commit

Permalink
add intel documentation link explaining why trying 10x for RDRAND is
Browse files Browse the repository at this point in the history
fine
  • Loading branch information
Gijs Kwakkel committed Jul 17, 2024
1 parent 2f08d21 commit 89b5885
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mbedtls/src/rng/rdrand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ use core::arch::x86_64::{_rdrand64_step as _rdrand_step, _rdseed64_step as _rdse

// Intel documentation claims that if hardware is working RDRAND will produce
// output after at most 10 attempts
// https://www.intel.com/content/www/us/en/developer/articles/guide/intel-digital-random-number-generator-drng-software-implementation-guide.html
// section 5.2.1
const RDRAND_READ_ATTEMPTS: usize = 10;

// Intel does not document the number of times RDSEED might consecutively fail,
Expand Down

0 comments on commit 89b5885

Please sign in to comment.