Changed the encrypt and decrypt variant from .unsafe to .raw in order to match that of the SecKey counterpart.

This commit is contained in:
Brandon Toms
2022-08-19 10:48:53 -07:00
parent 7f4b5d1d8a
commit 4d1c69552a
+2 -2
View File
@@ -229,10 +229,10 @@
// Encrypt with SecKey
let skEncryption = try secKeyEncrypt(messageToSign.bytes, usingVariant: .rsaEncryptionRaw, withKey: rsaSecKey)
// Decrypt with CryptoSwift Key
XCTAssertEqual(try rsaCryptoSwift.decrypt(skEncryption.bytes, variant: .unsafe), messageToSign.bytes, "CryptoSwift Decryption of SecKey Encryption Failed")
XCTAssertEqual(try rsaCryptoSwift.decrypt(skEncryption.bytes, variant: .raw), messageToSign.bytes, "CryptoSwift Decryption of SecKey Encryption Failed")
// Encrypt with CryptoSwift
let csEncryption = try rsaCryptoSwift.encrypt(messageToSign.bytes, variant: .unsafe)
let csEncryption = try rsaCryptoSwift.encrypt(messageToSign.bytes, variant: .raw)
// Decrypt with SecKey
XCTAssertEqual(try self.secKeyDecrypt(csEncryption, usingVariant: .rsaEncryptionRaw, withKey: rsaSecKey).bytes, messageToSign.bytes, "SecKey Decryption of CryptoSwift Encryption Failed")