Generating Random Numbers
Generating Random Numbers
This example demonstrates how to use the Intel Hardware Random Number Generator to seed a
1.Use the Intel Random Number Generator to generate a random seed. In general, you should use a seed that is at least 256 bits long.
2.Seed a
If you are already using a
Obtaining a Random Seed from Hardware
First, use the Intel Random Number Generator to acquire a random seed. To do this, you can write a function, GenerateSeed, that will retrieve random bytes from hardware.
Step 0: Create the Session Chooser
Before you can create an application that can access the Intel Random Number Generator, you need to create the session chooser that associates Intel’s hardware method, HW_INTEL_RANDOM, with
B_ALGORITHM_METHOD *SOFTWARE_CHOOSER[] = { &AM_HW_RANDOM,
(B_ALGORITHM_METHOD *)NULL_PTR };
1 6 | R S A B S A F E C r y p t o - C I n t e l H a r d w a r e U s e r ’s G u i d e |