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

  • 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 25
Generating Random Numbers
22 RSA BSAFE Crypto-C Intel Hardware User’s Guide
call would be identical in a software implementation:
Step 5: Generate Random Numbers
Before calling B_GenerateRandomBytes, prepare a buffer for receiving the random
bytes. This is a little different than the software implementation.
Now you can generate the random bytes. Since generating 128 bytes is quick, you can
use a
NULL_PTR for the surrender context:
Step 6: Destroy all Objects
Remember to destroy all objects when you are done with them, and free all memory.
Again, this is identical to the software implementation:
if ((status = B_RandomUpdate
(randomAlgorithm, randomSeed, randomSeedLen,
(A_SURRENDER_CTX *)NULL_PTR)) != 0)
break;
randomByteBuffer = T_malloc (BYTES_TO_GENERATE);
if ((status = (randomByteBuffer == NULL_PTR)) != 0)
break;
T_memset (randomByteBuffer, 0, BYTES_TO_GENERATE);
if ((status = B_GenerateRandomBytes
(randomAlgorithm, randomByteBuffer, BYTES_TO_GENERATE,
(A_SURRENDER_CTX *)NULL_PTR)) != 0)
break;
B_DestroyAlgorithmObject (&randomAlgorithm);
T_memset (randomSeed, 0, randomSeedLen);
T_free (randomSeed);
T_free (randomByteBuffer);
Vue de la page 25
1 2 ... 21 22 23 24 25 26 27 28 29 30 31 ... 37 38

Commentaires sur ces manuels

Pas de commentaire