RSA Security Home Security System 4.3 Manual de usuario Pagina 26

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 38
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 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);
Vista de pagina 25
1 2 ... 21 22 23 24 25 26 27 28 29 30 31 ... 37 38

Comentarios a estos manuales

Sin comentarios