浏览代码

Fix AES key derivation function

maxep 5 年之前
父节点
当前提交
c60597dc61
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      Sources/Crypto/AES.swift

+ 3 - 3
Sources/Crypto/AES.swift

@@ -103,10 +103,10 @@ public final class AESKeyDerivation: KeyDerivation {
         let cryptor = UnsafeMutablePointer<CCCryptorRef?>.allocate(capacity: 1)
 
         var status = CCCryptorCreate(CCOperation(kCCEncrypt),
-                                     CCAlgorithm(kCCAlgorithmAES128),
+                                     CCAlgorithm(kCCAlgorithmAES),
                                      CCOptions(kCCOptionECBMode),
-                                     key.rawValue,
-                                     key.lenght,
+                                     seed.rawValue,
+                                     seed.lenght,
                                      nil,
                                      cryptor)