|
@@ -101,8 +101,12 @@ 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
|
|
|
|
|
|
+
|
|
|
|
+ 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])
|
|
B = B &+ rotateLeft(A &+ F &+ k[j] &+ Mg, by: s[j])
|
|
A = dTemp
|
|
A = dTemp
|