Hi,
I am having few issues with commoncrypto api. I am using commoncrypto api for aes-ctr encryption/decryption. I am creating a commoncrypto object with the below code
CCCryptorStatus status = CCCryptorCreateWithMode(kCCDecrypt, kCCModeCTR, kCCAlgorithmAES128, ccNoPadding,
iv->bytes, key->bytes, key->len, NULL, 0, 0, kCCModeOptionCTR_BE, &cryptor);
then
status = CCCryptorUpdate(cryptor, inputData, len, ptr,remainingBytes,&movedBytes);
ptr += movedBytes;
remainingBytes -= movedBytes;
totalBytesWritten += movedBytes;
status = CCCryptorFinal(cryptor,
ptr,
remainingBytes,
&movedBytes
);
Initially I had few memory issues with my code, to resolve those issue I have enabeld " Guard malloc", "Enable Scribble", "Enable Guard Edges". With these setting enabled my app is working as expected on the simulator, however when I disable the above setting, Encryption and decryption are not working as expected.
Any ideas what I am I missing here?
0 comments:
Post a Comment