Эх сурвалжийг харах

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

Brandon Toms 3 жил өмнө
parent
commit
4d1c69552a

+ 2 - 2
Tests/CryptoSwiftTests/RSASecKeyTests.swift

@@ -229,10 +229,10 @@
         // Encrypt with SecKey
         // Encrypt with SecKey
         let skEncryption = try secKeyEncrypt(messageToSign.bytes, usingVariant: .rsaEncryptionRaw, withKey: rsaSecKey)
         let skEncryption = try secKeyEncrypt(messageToSign.bytes, usingVariant: .rsaEncryptionRaw, withKey: rsaSecKey)
         // Decrypt with CryptoSwift Key
         // 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
         // Encrypt with CryptoSwift
-        let csEncryption = try rsaCryptoSwift.encrypt(messageToSign.bytes, variant: .unsafe)
+        let csEncryption = try rsaCryptoSwift.encrypt(messageToSign.bytes, variant: .raw)
         // Decrypt with SecKey
         // Decrypt with SecKey
         XCTAssertEqual(try self.secKeyDecrypt(csEncryption, usingVariant: .rsaEncryptionRaw, withKey: rsaSecKey).bytes, messageToSign.bytes, "SecKey Decryption of CryptoSwift Encryption Failed")
         XCTAssertEqual(try self.secKeyDecrypt(csEncryption, usingVariant: .rsaEncryptionRaw, withKey: rsaSecKey).bytes, messageToSign.bytes, "SecKey Decryption of CryptoSwift Encryption Failed")