RSA Security Projection Television 5.2.2 Manual de usuario Pagina 142

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 376
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 141
System Considerations In Crypto-C
120 RSA BSAFE Crypto-C Developers Guide
A routine that calls Crypto-C functions would use the above surrender function as
follows:
For this surrender function, the
handle
contains a flag passed from the user. If
handle
is 0, this is the first time the surrender function has been called by the particular
Crypto-C routine currently executing. Then the surrender function will reset the flag
and the next time it is called, it will skip the
if clause and execute the else clause.
The coding examples in this manual use the example in this section as their surrender
context. The examples also note when a routine is lengthy enough to warrant use of a
surrender context. When a surrender context is not necessary, you can pass a properly
cast
NULL_PTR.
Saving State
Crypto-C v5.1 offers two new functions: B_GetAlgorithmState and
B_SetAlgorithmState. Use these functions to serialize (create and use) an algorithm
if ((int)*handle == 0) {
printf (\nSurrender function ...\n);
*handle = 1;
time (&currentTime);
}
else {
time (&getTime);
if (currentTime != getTime) {
printf .");
currentTime = getTime;
}
}
return (0);
}
A_SURRENDER_CTX generalSurrenderContext;
int generalFlag;
generalSurrenderContext.Surrender = GeneralSurrenderFunction;
generalSurrenderContext.handle = (POINTER)&generalFlag;
generalSurrenderContext.reserved = NULL_PTR;
generalFlag = 0;
if ((status = B_<function>
(<other arguments>, &generalSurrenderContext)) != 0)
break;
Vista de pagina 141
1 2 ... 137 138 139 140 141 142 143 144 145 146 147 ... 375 376

Comentarios a estos manuales

Sin comentarios