There is some GCM crypt functions in the CommonCryptorSPI.h, they are not public yet.
But you can use them if you add them to the bridging header.
#include <CommonCrypto/CommonCryptor.h>
CCCryptorStatus CCCryptorGCM(
CCOperation op, /* kCCEncrypt, kCCDecrypt */
CCAlgorithm alg,
const void *key, /* raw key material */
size_t keyLength,
const void *iv,
size_t ivLen,
const void *aData,
size_t aDataLen,
const void *dataIn,
size_t dataInLength,
void *dataOut,
const void *tag,
size_t *tagLength);
Or you can try the SwCrypt library.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…