RSA Security Home Security System 4.3 Manuel d'utilisateur Page 21

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 38
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 20
Chapter 3 Using the Intel Random Number Generator 17
Generating Random Numbers
Step 1: Create an Algorithm Object
The next task is to create the algorithm object. This object will control the random byte
generation. Creating the object only allocates the memory needed for the process. It
does not initialize the object for random number generation.
Step 2: Set the Algorithm Object
Set the algorithm info. We will specify AI_HW_Random, which will point to the
hardware method that is associated to
AM_HW_RANDOM via B_CreateSessionChooser.
Step 3: Initialize the Random Object
Initialize
randomAlgorithm
to generate random bytes. Here we pass the
CHOOSER
that
was created via the call to
B_CreateSessionChooser above. This chooser contains
pointers to the hardware method that was associated with
AM_HW_RANDOM.
HW_TABLE_ENTRY *HARDWARE_CHOOSER[] = {
&HW_INTEL_RANDOM,
(HW_TABLE_ENTRY *)NULL_PTR
};
B_ALGORITHM_METHOD **CHOOSER = (B_ALGORITHM_METHOD **)NULL_PTR;
if ((status = B_CreateSessionChooser
(SOFTWARE_CHOOSER, &CHOOSER, (POINTER *)HARDWARE_CHOOSER,
(ITEM *)NULL_PTR, (POINTER *)NULL_PTR, &oemTagList)) != 0)
break;
B_ALGORITHM_OBJ randomAlgorithm = (B_ALGORITHM_OBJ)NULL_PTR;
if ((status = B_CreateAlgorithmObject (&randomAlgorithm)) != 0)
break;
if ((status = B_SetAlgorithmInfo
(randomAlgorithm, AI_HW_Random, NULL_PTR)) != 0)
break;
Vue de la page 20
1 2 ... 16 17 18 19 20 21 22 23 24 25 26 ... 37 38

Commentaires sur ces manuels

Pas de commentaire