I am looking at this answer:
https://stackoverflow.com/a/53807793/1634905
When using Elliptic Curve key pair, it has the following:
private let keyType = kSecAttrKeyTypeECSECPrimeRandom // kSecAttrKeyTypeECSECPrimeRandom
private let algorithm = SecKeyAlgorithm.eciesEncryptionCofactorVariableIVX963SHA512AESGCM
private let keySize = 384
The algorithm
is used in the SecKeyCreateEncryptedData
function.
What is eciesEncryptionCofactorVariableIVX963SHA512AESGCM
here?
Apple’s doc doesn’t explain it much:
I see there are other possible options such as eciesEncryptionCofactorVariableIVX963SHA384AESGCM
. Why did that SO answer pick the one with SHA512 when it picked 384 as the keySize
?