title: Difference between SecKeyCreateEncryptedData and SecKeyEncrypt in Swift 3
body: <p>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 </p>
  
  <pre><code>SecKeyCreateEncryptedData(publicKey.underlying,SecKeyAlgorithm.eciesEncryptionSt
      andardX963SHA1AESGCM,cdata!, &amp;error)
  </code></pre>
  
  <p>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 </p>
  
  <pre><code>SecKeyEncrypt(publicKey.underlying as SecKey, .PKCS1, digestBytes, 
      newdata.length, &amp;signatureBytes, &amp;signatureLength)
  </code></pre>
  
  <p>And I am also unable to get the error description for the error code -50.</p>