 CONSTANT: S43 15
 CONSTANT: S44 21
 
+CONSTANT: a 0
+CONSTANT: b 1
+CONSTANT: c 2
+CONSTANT: d 3
 
-
-
-SYMBOLS: a b c d old-a old-b old-c old-d ;
-
-: initialize-md5 ( -- )
-    0 bytes-read set
-    HEX: 67452301 dup a set old-a set
-    HEX: efcdab89 dup b set old-b set
-    HEX: 98badcfe dup c set old-c set
-    HEX: 10325476 dup d set old-d set ;
-
-: update-md ( -- )
-    old-a a update-old-new
-    old-b b update-old-new
-    old-c c update-old-new
-    old-d d update-old-new ;
-
-
-:: (ABCD) ( x a b c d k s i func -- )
+:: (ABCD) ( x V a b c d k s i quot -- )
     #! a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s)
-    a [
-        b get c get d get func call w+
+    a V [
+        b V nth-unsafe
+        c V nth-unsafe
+        d V nth-unsafe quot call w+
         k x nth-unsafe w+
         i T w+
         s bitroll-32
-        b get w+
-    ] change ; inline
+        b V nth-unsafe w+
+    ] change-nth ; inline
 
-MACRO: with-md5-round ( ops func -- )
-    '[ [ _ (ABCD) ] compose ] map '[ _ cleave ] ;
+MACRO: with-md5-round ( ops quot -- )
+    '[ [ _ (ABCD) ] compose ] map '[ _ 2cleave ] ;
 
-: (process-md5-block-F) ( block -- )
+: (process-md5-block-F) ( block v -- )
     {
         [ a b c d 0  S11 1  ]
         [ d a b c 1  S12 2  ]

        [ d a b c 2  S22 30 ]
        [ c d a b 7  S23 31 ]
        [ b c d a 12 S24 32 ]
    } [ G ] with-md5-round ;

: (process-md5-block-H) ( block -- )
    {
        [ a b c d 5  S31 33 ]
        [ d a b c 8  S32 34 ]

        [ d a b c 13 S12 14 ]
        [ c d a b 14 S13 15 ]
        [ b c d a 15 S14 16 ]
    } [ F ] with-md5-round ; inline

: (process-md5-block-G) ( block v -- )
    {
        [ a b c d 1  S21 17 ]
        [ d a b c 6  S22 18 ]
