MD5/Implementation: Difference between revisions
Content added Content deleted
Alextretyak (talk | contribs) m (→{{header|11l}}) |
Alextretyak (talk | contribs) |
||
Line 47: | Line 47: | ||
functions [+]= (b, c, d) -> c (+) (b [|] (-)d) |
functions [+]= (b, c, d) -> c (+) (b [|] (-)d) |
||
[( |
[(Int -> Int)] index_functions |
||
index_functions [+]= i -> i |
index_functions [+]= i -> i |
||
index_functions [+]= i -> (5 * i + 1) % 16 |
index_functions [+]= i -> (5 * i + 1) % 16 |
||
Line 68: | Line 68: | ||
V f = :functions[i I/ 16](b, c, d) |
V f = :functions[i I/ 16](b, c, d) |
||
V g = :index_functions[i I/ 16](i) |
V g = :index_functions[i I/ 16](i) |
||
V to_rotate = a + f + :constants[i] + UInt32(bytes' chunk[4 * |
V to_rotate = a + f + :constants[i] + UInt32(bytes' chunk[4 * g .+ 4]) |
||
V new_b = UInt32(b + rotl(to_rotate, :rotate_amounts[i])) |
V new_b = UInt32(b + rotl(to_rotate, :rotate_amounts[i])) |
||
(a, b, c, d) = (d, new_b, b, c) |
(a, b, c, d) = (d, new_b, b, c) |