RSA Security Projection Television 5.2.2 Instrukcja Użytkownika Strona 325

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 376
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 324
Chapter 7 Public-Key Operations 303
Performing Elliptic Curve Operations
Step 5: Final
Step 6: Destroy
Destroy any objects that are no longer needed. Also, be sure to zeroize and free any
allocated memory when it is no longer needed.
unsigned char *decryptedData;
unsigned int maxDecryptedDataLen;
unsigned int outputLenUpdate;
maxDecryptedDataLen = outputLenTotal; /* Use the outputLenTotal from */
/* Step 5 of ECAES encryption */
decryptedData = T_malloc(maxDecryptedDataLen);
if ((status = (decryptedData == NULL_PTR)) != 0)
break;
if ((status = B_DecryptUpdate
(ecESDecrypt, decryptedData, &outputLenUpdate,
maxDecryptedDataLen, encryptedData, outputLenTotal,
(B_ALGORITHM_OBJ)NULL_PTR,
(A_SURRENDER_CTX *)NULL_PTR)) != 0)
break;
unsigned int outputLenFinal, outputLenTotal;
if ((status = B_DecryptFinal
(ecESDecrypt, decryptedData + outputLenUpdate,
&outputLenFinal, maxDecryptedDataLen - outputLenUpdate,
(B_ALGORITHM_OBJ)NULL_PTR,
(A_SURRENDER_CTX *)NULL_PTR)) != 0)
break;
outputLenTotal = outputLenUpdate + outputLenFinal;
B_DestroyAlgorithmObject (&ecESDecrypt);
B_DestroyKeyObject (&privateKey);
T_free (decryptedData);
Przeglądanie stron 324
1 2 ... 320 321 322 323 324 325 326 327 328 329 330 ... 375 376

Komentarze do niniejszej Instrukcji

Brak uwag