 
 M: sha-256 checksum-bytes
     drop [
-        K-256 K set
         initial-H-256 H set
         4 word-size set
         64 block-size set
         byte-array>sha2
+
     ] with-scope ;

        [ -25 bitroll-32 ] tri
    ] [ bitxor ] reduce-outputs ; inline

: slice3 ( n seq -- a b c ) [ dup 3 + ] dip <slice> first3 ; inline

: T1 ( W n -- T1 )
    [ swap nth ] keep
    K get nth +
    e vars get slice3 ch +
    e vars get nth S1-256 +
    h vars get nth w+ ;

: T2 ( -- T2 )
    a vars get nth S0-256
    a vars get slice3 maj w+ ;

: update-vars ( T1 T2 -- )
    vars get
    h g pick exchange
    g f pick exchange
    f e pick exchange

! See http://factorcode.org/license.txt for BSD license.
USING: kernel splitting grouping math sequences namespaces make
io.binary math.bitwise checksums checksums.common
sbufs strings combinators.smart math.ranges fry combinators
accessors ;
IN: checksums.sha2

<PRIVATE

SYMBOLS: H word-size block-size ;

CONSTANT: a 0
CONSTANT: b 1
