 ! Copyright (C) 2006, 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.c-types alien.data kernel io io.binary io.files
-io.streams.byte-array math math.functions math.parser namespaces
-splitting grouping strings sequences byte-arrays locals
-sequences.private macros fry io.encodings.binary math.bitwise
-checksums accessors checksums.common checksums.stream
-combinators combinators.smart specialized-arrays literals hints ;
+USING: accessors alien.c-types alien.data byte-arrays checksums
+checksums.common checksums.stream combinators fry grouping hints
+kernel kernel.private literals locals macros math math.bitwise
+math.functions sequences sequences.private specialized-arrays ;
 FROM: sequences.private => change-nth-unsafe ;
 SPECIALIZED-ARRAY: uint
 IN: checksums.md5

    '[ [ _ (ABCD) ] compose ] map '[ _ 2cleave ] ;

: (process-md5-block-F) ( block state -- )
    {
        [ a b c d 0  S11 1  ]
        [ d a b c 1  S12 2  ]
        [ c d a b 2  S13 3  ]

        [ d a b c 12 S32 46 ]
        [ c d a b 15 S33 47 ]
        [ b c d a 2  S34 48 ]
    } [ H ] with-md5-round ;

: (process-md5-block-I) ( block state -- )
    { uint-array uint-array } declare {
        [ a b c d 0  S41 49 ]
        [ d a b c 7  S42 50 ]
        [ c d a b 14 S43 51 ]
