|
@@ -101,10 +101,14 @@ public final class MD5: DigestType {
|
|
|
|
|
|
// break chunk into sixteen 32-bit words M[j], 0 ≤ j ≤ 15 and get M[g] value
|
|
// break chunk into sixteen 32-bit words M[j], 0 ≤ j ≤ 15 and get M[g] value
|
|
let gAdvanced = g << 2
|
|
let gAdvanced = g << 2
|
|
- var Mg = UInt32(chunk[chunk.startIndex &+ gAdvanced]) | UInt32(chunk[chunk.startIndex &+ gAdvanced &+ 1]) << 8 | UInt32(chunk[chunk.startIndex &+ gAdvanced &+ 2]) << 16
|
|
|
|
- Mg = Mg | UInt32(chunk[chunk.startIndex &+ gAdvanced &+ 3]) << 24
|
|
|
|
|
|
|
|
- B = B &+ rotateLeft(A &+ F &+ k[j] &+ Mg, by: s[j])
|
|
|
|
|
|
+ let mg0 = UInt32(chunk[chunk.startIndex &+ gAdvanced])
|
|
|
|
+ let mg1 = UInt32(chunk[chunk.startIndex &+ gAdvanced &+ 1]) << 8
|
|
|
|
+ let mg2 = UInt32(chunk[chunk.startIndex &+ gAdvanced &+ 2]) << 16
|
|
|
|
+ let mg3 = UInt32(chunk[chunk.startIndex &+ gAdvanced &+ 3]) << 24
|
|
|
|
+ let mg = (mg0 | mg1 | mg2) | mg3
|
|
|
|
+
|
|
|
|
+ B = B &+ rotateLeft(A &+ F &+ k[j] &+ mg, by: s[j])
|
|
A = dTemp
|
|
A = dTemp
|
|
}
|
|
}
|
|
|
|
|