RSA Security Projection Television 5.2.2 Uživatelský manuál Strana 217

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 376
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 216
Chapter 6 Symmetric-Key Operations 195
Block Ciphers
Step 5: Final
Step 6: Destroy
Remember to destroy all objects that you created and free up any memory that you
allocated.
encryptedDataLen = dataToEncryptLen + 8;
encryptedData = T_malloc (encryptedDataLen);
if ((status = (encryptedData == NULL_PTR)) != 0)
break;
if ((status = B_EncryptUpdate
(rc5Encrypter, encryptedData, &outputLenUpdate,
encryptedDataLen, dataToEncrypt, dataToEncryptLen,
(B_ALGORITHM_OBJ)NULL_PTR,
(A_SURRENDER_CTX *)NULL_PTR)) != 0)
break;
unsigned int outputLenFinal;
if ((status = B_EncryptFinal
(rc5Encrypter, encryptedData + outputLenUpdate,
&outputLenFinal, dataToEncryptLen + 8 - outputLenUpdate,
(B_ALGORITHM_OBJ)NULL_PTR,
(A_SURRENDER_CTX *)NULL_PTR)) != 0)
break;
B_DestroyKeyObject (&rc5Key);
B_DestroyAlgorithmObject (&rc5Encrypter);
B_DestroyAlgorithmObject (&randomAlgorithm);
if (rc5KeyItem.data != NULL_PTR) {
T_memset (rc5KeyItem.data, 0, rc5KeyItem.len);
T_free (rc5KeyItem.data);
rc5KeyItem.data = NULL_PTR;
rc5KeyItem.len = 0;
}
Zobrazit stránku 216
1 2 ... 212 213 214 215 216 217 218 219 220 221 222 ... 375 376

Komentáře k této Příručce

Žádné komentáře