Browse Source

Merge branch 'hotfix/ctr-32-bit'

Marcin Krzyżanowski 10 years ago
parent
commit
dca3934c94
1 changed files with 1 additions and 1 deletions
  1. 1 1
      CryptoSwift/CipherBlockMode.swift

+ 1 - 1
CryptoSwift/CipherBlockMode.swift

@@ -177,7 +177,7 @@ private struct CTRMode: BlockMode {
     private func buildNonce(iv: [UInt8], counter: UInt) -> [UInt8] {
         let noncePartLen = AES.blockSize / 2
         let noncePrefix = Array(iv[0..<noncePartLen])
-        let nonceSuffix = arrayOfBytes(counter)
+        let nonceSuffix = arrayOfBytes(counter, length: noncePartLen)
         
         var nonce = noncePrefix
         nonce += nonceSuffix