RSA Security Projection Television 5.2.2 Manual de usuario Pagina 281

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 376
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 280
Chapter 7 Public-Key Operations 259
Performing Diffie-Hellman Key Agreement
parties might only need eight bytes for a session key. If that is the case, it is the
applications responsibility to specify which bytes of the agreed-upon secret value
will be used. This function does not return immediately, so a surrender context is
useful:
Step 6: Destroy
Remember to destroy all objects and free up any allocated memory:
Saving the Object State
Refer to Saving State on page 120 for information on how to receive a buffer that
contains all of the data necessary to reconstruct the object, using the call
B_SetAlgorithmState, to the state it was in at the time of calling the Get routine. You
may call
B_GetAlgorithmState after calling B_KeyAgreePhase1. When the application
is ready to resume the key agreement operation, create an algorithm object and
restore the state using
B_SetAlgorithmState. See the dhagrsv.c sample for details.
/* The other party should send their public value and its length. */
unsigned char *otherPublicValue;
unsigned int otherPublicValueLen;
unsigned char *agreedUponSecretValue = NULL_PTR;
unsigned int agreedUponSecretValueLen;
agreedUponSecretValue = T_malloc (getParams->prime.len);
if ((status = (agreedUponSecretValue == NULL_PTR)) != 0)
break;
/* generalFlag is for the surrender function.*/
generalFlag = 0;
if ((status = B_KeyAgreePhase2
(dhKeyAgreeAlg, agreedUponSecretValue,
&agreedUponSecretValueLen, getParams->prime.len,
otherPublicValue, otherPublicValueLen,
&generalSurrenderContext)) != 0)
break;
B_DestroyAlgorithmObject (&dhKeyAgreeAlg);
B_DestroyAlgorithmObject (&randomAlgorithm);
T_free (myPublicValue);
T_free (agreedUponSecretValue);
Vista de pagina 280
1 2 ... 276 277 278 279 280 281 282 283 284 285 286 ... 375 376

Comentarios a estos manuales

Sin comentarios