소스 검색

Use explicit 64bit type. Fixes #741.

Marcin Krzyzanowski 5 년 전
부모
커밋
572cac3cb6
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      Sources/CryptoSwift/SHA2.swift

+ 1 - 1
Sources/CryptoSwift/SHA2.swift

@@ -284,7 +284,7 @@ extension SHA2: Updatable {
         accumulated += bytes
 
         if isLast {
-            let lengthInBits = (processedBytesTotalCount + accumulated.count) * 8
+            let lengthInBits = UInt64((processedBytesTotalCount + accumulated.count) * 8)
             let lengthBytes = lengthInBits.bytes(totalBytes: blockSize / 8) // A 64-bit/128-bit representation of b. blockSize fit by accident.
 
             // Step 1. Append padding