 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays checksums checksums.common combinators
-combinators.smart fry grouping io.binary kernel kernel.private
-literals locals math math.bitwise math.ranges sequences
-sequences.generalizations sequences.private ;
+USING: accessors alien.c-types arrays checksums checksums.common
+combinators combinators.smart fry grouping io.binary kernel
+kernel.private literals locals math math.bitwise math.ranges
+sequences sequences.generalizations sequences.private
+specialized-arrays ;
+SPECIALIZED-ARRAY: uint
+SPECIALIZED-ARRAY: ulong
 IN: checksums.sha
 
 MIXIN: sha

        20 0x6ed9eba1 <repetition>
        20 0x8f1bbcdc <repetition>
        20 0xca62c1d6 <repetition>
        4 { } nappend-as
    ]

TUPLE: sha2-state < checksum-state
{ K array }
{ H array }
{ word-size fixnum } ;

TUPLE: sha2-short < sha2-state ;

    [ pad-last-short-block ] [ sha-256>checksum ] bi ;

: sha1-W ( t seq -- )
    { uint-array } declare
    {
        [ [ 3 - ] dip nth-unsafe ]
        [ [ 8 - ] dip nth-unsafe bitxor ]
