         [ 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 ;
+    } [ H ] with-md5-round ; inline
 
 : (process-md5-block-I) ( block state -- )
     {

        nip update-md5
    ] 2bi ;

: md5>checksum ( md5 -- bytes ) state>> uint-array>byte-array-le ;

M: md5-state clone ( md5 -- new-md5 )
    call-next-method
    [ clone ] change-state
    [ clone ] change-old-state ;

M: md5-state get-checksum ( md5 -- bytes )
    clone [ bytes>> f ] [ bytes-read>> pad-last-block ] [ ] tri
    [ [ checksum-block ] curry each ] [ md5>checksum ] bi ;

M: md5 checksum-stream ( stream checksum -- byte-array )
    drop
    [ <md5-state> ] dip add-checksum-stream get-checksum ;



INSTANCE: md5 stream-checksum

TUPLE: md5-state < checksum-state
{ state uint-array }
{ old-state uint-array } ;

: <md5-state> ( -- md5 )
    md5-state new-checksum-state
