CryptoKit.CryptoKitError error 1 when using Symmetric key of size 512

Hi,

Not working and error above. let key512 = SymmetricKey(size: .init(bitCount: 512)) let encryptedData512 = try ChaChaPoly.seal(clear_data2!, using: key512).combined

If I change the bitcount to 256, no error. Same error even if I use AES.GCM

Thanks

The Apple CryptoKit ChaChaPoly type implements ChaCha20-Poly1305 which always uses a 256-bit key. For this and other details, see RFC 8439.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

CryptoKit.CryptoKitError error 1 when using Symmetric key of size 512
 
 
Q