RSA Security Projection Television 5.2.2 Manual de usuario Pagina 322

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 376
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 321
Performing Elliptic Curve Operations
300 RSA BSAFE Crypto-C Developers Guide
Step 3: Init
You must initialize the algorithm object to perform encryption. You also need to
provide the key that will be used for encryption. The algorithm chooser should
contain the encryption algorithm methods listed in the Reference Manual for
AI_EC_ES:
Step 4: Update
To update, first find the field element length in bytes. Remember that, earlier in
Using Elliptic Curve Parameters on page 298, you placed the elliptic curve
parameters in your algorithm object,
ecParamsObj
. You can use this object to retrieve
the field element length:
Next, you must allocate space to hold the encrypted data. According to the Reference
Manual Chapter 2 entry for
AI_EC_ES, the length of the encrypted data will be as much
as (21 + 2 · (the size of a field element in bytes) + (length of input in bytes)) bytes.
B_ALGORITHM_METHOD *EC_CHOOSER[] = {
&AM_ECFP_ENCRYPT,
&AM_ECF2POLY_ENCRYPT,
(B_ALGORITHM_METHOD *)NULL_PTR
};
if ((status = B_EncryptInit (ecESEncrypt, publicKey, EC_CHOOSER,
(A_SURRENDER_CTX *)NULL_PTR)) != 0)
break;
A_EC_PARAMS *ecParamInfo;
unsigned int fieldElementLen;
if ((status = B_GetAlgorithmInfo ((POINTER *)&ecParamInfo, ecParamsObj,
AI_ECParameters)) != 0)
break;
fieldElementLen = (ecParamInfo->fieldElementBits + 7) / 8;
Vista de pagina 321
1 2 ... 317 318 319 320 321 322 323 324 325 326 327 ... 375 376

Comentarios a estos manuales

Sin comentarios