     [ [ bitand ] [ bitor ] 2bi ] dip bitand bitor ;
 
 : prepare-message-schedule ( seq -- w-seq )
-    word-size get <sliced-groups> [ be> ] map block-size get 0 pad-tail
+    sha2 get word-size>> <sliced-groups> [ be> ] map sha2 get block-size>> 0 pad-tail
     16 64 [a,b) over '[ _ process-M-256 ] each ;
 
 : slice3 ( n seq -- a b c )


<PRIVATE

SYMBOLS: H word-size block-size ;

CONSTANT: a 0
CONSTANT: b 1


INSTANCE: sha-256 checksum

TUPLE: sha2-state K H word-size block-size ;

TUPLE: sha-256-state < sha2-state ;

: <sha-256-state> ( -- sha2-state )
    sha-256-state new
        K-256 >>K
        initial-H-256 >>H
        4 >>word-size
        64 >>block-size ; 

M: sha-256 checksum-bytes
    drop
    <sha-256-state> sha2 [
        byte-array>sha2
    ] with-variable ;
