소스 검색

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)