The signature of one-shot crypto method CCCrypt
is this (from CommonCryptor.h
):
CCCryptorStatus CCCrypt(
CCOperation op, /* kCCEncrypt, etc. */
CCAlgorithm alg, /* kCCAlgorithmAES128, etc. */
CCOptions options, /* kCCOptionPKCS7Padding, etc. */
const void *key,
size_t keyLength,
const void *iv, /* optional initialization vector */
const void *dataIn, /* optional per op and alg */
size_t dataInLength,
void *dataOut, /* data RETURNED here */
size_t dataOutAvailable,
size_t *dataOutMoved)
None of the parameter seems to accept a CCMode
value (maybe sneakily, since all the enums are integers?). I have tried around combining it with the CCOptions
parameter, but to no avail; the two enums are not options, and don't combine unambiguously.
It's not explicitly documented there, but I surmise from what I find around the web that the mode used with kCCAlgorithmAES
is CBC.
How can I change the AES mode CCCrypt
uses?