RSA Security 5.2.2 manual Asurrenderctx *NULLPTR != 0 break

Models: 5.2.2

1 376
Download 376 pages 13.91 Kb
Page 211
Image 211

Block Ciphers

if ((status = (encryptedData == NULL_PTR)) != 0) break;

if ((status = B_EncryptUpdate

(rc2Encrypter, encryptedData, &outputLenUpdate, encryptedDataLen, dataToEncrypt, dataToEncryptLen, (B_ALGORITHM_OBJ)NULL_PTR,

(A_SURRENDER_CTX *)NULL_PTR)) != 0) break;

Step 5: Final

unsigned int outputLenFinal; if ((status = B_EncryptFinal

(rc2Encrypter, encryptedData + outputLenUpdate, &outputLenFinal, encryptedDataLen - outputLenUpdate, (B_ALGORITHM_OBJ)NULL_PTR,

(A_SURRENDER_CTX *)NULL_PTR)) != 0) break;

Step 6: Destroy

Remember to destroy all objects created and free up any memory allocated:

B_DestroyKeyObject (&rc2Key);

B_DestroyAlgorithmObject (&rc2Encrypter);

B_DestroyAlgorithmObject (&randomAlgorithm);

if (encryptedData != NULL_PTR) {

T_memset (encryptedData, 0, encryptedDataLen); T_free (encryptedData);

encryptedData = NULL_PTR;

}

if (rc2KeyItem.data != NULL_PTR) {

T_memset (rc2KeyItem.data, 0, rc2KeyItem.len); T_free (rc2KeyItem.data);

rc2KeyItem.data = NULL_PTR; rc2KeyItem.len = 0;

}

C h a p t e r 6 S y m m e t r i c - K e y O p e r a t i o n s

1 8 9

Page 211
Image 211
RSA Security 5.2.2 manual Asurrenderctx *NULLPTR != 0 break, EncryptedData = Nullptr If rc2KeyItem.data != Nullptr