Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

follow manual for rdrand usage for seeding when rdseed is not available #252

Open
edwintorok opened this issue Jan 7, 2025 · 0 comments

Comments

@edwintorok
Copy link
Contributor

When RDSEED isn't available according to the manual using it as a random seed (as opposed to a random value) is not as simple as calling RDRAND: https://www.intel.com/content/www/us/en/developer/articles/guide/intel-digital-random-number-generator-drng-software-implementation-guide.html

Processors that do not support the RDSEED instruction can leverage the reseeding guarantee of the DRBG to generate random seeds from values obtained via RDRAND.

How do we guarantee reseeding?

See https://www.intel.com/content/www/us/en/developer/articles/guide/intel-digital-random-number-generator-drng-software-implementation-guide.html

Iteratively execute RDRAND beyond the DRBG upper bound by executing more than 1022 64-bit RDRANDs

Iteratively execute 32 RDRAND invocations with a 10 us wait period per iteration.

There is sample code in the manual on how to implement the 1st approach

The program below takes the first approach of guaranteed reseeding—generating 512 128-bit random numbers—and mixes the intermediate values together using the CBC-MAC mode of AES. This method of turning 512 128-bit samples from the DRNG into a 128-bit seed value is sometimes referred to as the “512:1 data reduction” and results in a random value that is fully forward and backward prediction resistant, suitable for seeding a NIST SP800-90 compliant, FIPS 140-2 certifiable, software DRBG.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant