Sfoglia il codice sorgente

Fix AES key derivation function

maxep 5 anni fa
parent
commit
c60597dc61
1 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  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)