RSA Security Projection Television 5.2.2 Manual de usuario Pagina 317

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 376
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 316
Chapter 7 Public-Key Operations 295
Performing Elliptic Curve Operations
Step 5: Final
First you must allocate space to store the signature. The output of the ECDSA
signature is the BER encoding of a sequence of two integers, (r,s). At most, the size of
the output will be six bytes more than twice the length of the order. Retrieve the field
element length from
ecParamsObj and do a simple manipulation to find the field
element length in bytes.
Now, finalize the process and retrieve the signature. Note that the Reference Manual
entry for
AI_EC_DSA requires that you pass in a properly initialized random algorithm
in
B_SignFinal:
Step 6: Destroy
Destroy all objects that are no longer needed:
A_EC_PARAMS *ecParamsInfo;
unsigned int order, maxSignatureLen;
unsigned char *signature;
if((status = B_GetAlgorithmInfo((POINTER *)&ecParamsInfo, ecParamsObj,
AI_ECParameters)) != 0)
break;
orderLen = ecParamInfo->order.len;
maxSignatureLen = 2 * orderLen;
signature = T_malloc(maxSignatureLen);
if ((status = (signature == NULL_PTR)) != 0)
break;
unsigned int signatureLen;
if ((status = B_SignFinal (ecDSASign, signature, &signatureLen,
maxSignatureLen, randomAlgorithm,
(A_SURRENDER_CTX *)NULL_PTR)) != 0)
break;
B_DestroyAlgorithmObject (&ecParamsObj);
B_DestroyAlgorihmObject (&ecParamsSign);
B_DestroyKeyObject (&publicKey);
B_DestroyKeyObject (&privateKey);
T_free (signature);
Vista de pagina 316
1 2 ... 312 313 314 315 316 317 318 319 320 321 322 ... 375 376

Comentarios a estos manuales

Sin comentarios