When trying to encrypt a block of plain data using SecKeyCreateEncryptedData, it encrypts the plain data using the specified algorithm and it works fine.The code snippet which i used for encryption is
SecKeyCreateEncryptedData(publicKey.underlying,SecKeyAlgorithm.eciesEncryptionSt
andardX963SHA1AESGCM,cdata!, &error)
But when i am trying to do the same encryption using SecKeyEncrypt, it fails with a return value of (-50).The code snippet used for my encryption is
SecKeyEncrypt(publicKey.underlying as SecKey, .PKCS1, digestBytes,
newdata.length, &signatureBytes, &signatureLength)
And I am also unable to get the error description for the error code -50.