{-# LANGUAGE BangPatterns, CPP, FlexibleInstances #-}
-- |Pure implementations of the SHA suite of hash functions. The implementation
-- is basically an unoptimized translation of FIPS 180-2 into Haskell. If you're
-- looking for performance, you probably won't find it here.
module Cryptol.SHA
       ( SHA256State(..), SHA512State(..)
       , SHA256Block(..), SHA512Block(..)

         -- * Raw SHA block functions
       , processSHA512Block
       , processSHA256Block

       , initialSHA224State
       , initialSHA256State
       , initialSHA384State
       , initialSHA512State

         -- * Internal routines included for testing
       , toBigEndianSBS, fromBigEndianSBS
       , calc_k
       , padSHA1, padSHA512
       , padSHA1Chunks, padSHA512Chunks
       )
 where
 
import Data.Bits
import Data.ByteString.Lazy(ByteString)
import Data.Word (Word32, Word64)
import qualified Data.ByteString.Lazy as BS
import qualified Data.ByteString as SBS

-- --------------------------------------------------------------------------
--
-- State Definitions and Initial States
--
-- --------------------------------------------------------------------------

data SHA256State = SHA256S !Word32 !Word32 !Word32 !Word32
                           !Word32 !Word32 !Word32 !Word32

initialSHA224State :: SHA256State
initialSHA224State :: SHA256State
initialSHA224State = Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> SHA256State
SHA256S Word32
0xc1059ed8 Word32
0x367cd507 Word32
0x3070dd17 Word32
0xf70e5939
                             Word32
0xffc00b31 Word32
0x68581511 Word32
0x64f98fa7 Word32
0xbefa4fa4

initialSHA256State :: SHA256State
initialSHA256State :: SHA256State
initialSHA256State = Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> SHA256State
SHA256S Word32
0x6a09e667 Word32
0xbb67ae85 Word32
0x3c6ef372 Word32
0xa54ff53a
                             Word32
0x510e527f Word32
0x9b05688c Word32
0x1f83d9ab Word32
0x5be0cd19

data SHA512State = SHA512S !Word64 !Word64 !Word64 !Word64
                           !Word64 !Word64 !Word64 !Word64

initialSHA384State :: SHA512State
initialSHA384State :: SHA512State
initialSHA384State = Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> SHA512State
SHA512S Word64
0xcbbb9d5dc1059ed8 Word64
0x629a292a367cd507
                             Word64
0x9159015a3070dd17 Word64
0x152fecd8f70e5939
                             Word64
0x67332667ffc00b31 Word64
0x8eb44a8768581511
                             Word64
0xdb0c2e0d64f98fa7 Word64
0x47b5481dbefa4fa4

initialSHA512State :: SHA512State
initialSHA512State :: SHA512State
initialSHA512State = Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> SHA512State
SHA512S Word64
0x6a09e667f3bcc908 Word64
0xbb67ae8584caa73b
                             Word64
0x3c6ef372fe94f82b Word64
0xa54ff53a5f1d36f1
                             Word64
0x510e527fade682d1 Word64
0x9b05688c2b3e6c1f
                             Word64
0x1f83d9abfb41bd6b Word64
0x5be0cd19137e2179


-- --------------------------------------------------------------------------
--
-- Padding
--
-- --------------------------------------------------------------------------

padSHA1 :: ByteString -> ByteString
padSHA1 :: ByteString -> ByteString
padSHA1 = Word64 -> Word64 -> Int -> ByteString -> ByteString
generic_pad Word64
448 Word64
512 Int
64

padSHA1Chunks :: Int -> [SBS.ByteString]
padSHA1Chunks :: Int -> [ByteString]
padSHA1Chunks = Word64 -> Word64 -> Int -> Int -> [ByteString]
generic_pad_chunks Word64
448 Word64
512 Int
64

padSHA512 :: ByteString -> ByteString
padSHA512 :: ByteString -> ByteString
padSHA512 = Word64 -> Word64 -> Int -> ByteString -> ByteString
generic_pad Word64
896 Word64
1024 Int
128

padSHA512Chunks :: Int -> [SBS.ByteString]
padSHA512Chunks :: Int -> [ByteString]
padSHA512Chunks = Word64 -> Word64 -> Int -> Int -> [ByteString]
generic_pad_chunks Word64
896 Word64
1024 Int
128

generic_pad :: Word64 -> Word64 -> Int -> ByteString -> ByteString
generic_pad :: Word64 -> Word64 -> Int -> ByteString -> ByteString
generic_pad Word64
a Word64
b Int
lSize ByteString
bs =
  [ByteString] -> ByteString
BS.fromChunks ([ByteString] -> ByteString) -> [ByteString] -> ByteString
forall a b. (a -> b) -> a -> b
$! Int -> [ByteString] -> [ByteString]
go Int
0 [ByteString]
chunks
 where
  chunks :: [ByteString]
chunks = ByteString -> [ByteString]
BS.toChunks ByteString
bs

  -- Generates the padded ByteString at the same time it computes the length
  -- of input. If the length is computed before the computation of the hash, it
  -- will break the lazy evaluation of the input and no longer run in constant
  -- memory space.
  go :: Int -> [ByteString] -> [ByteString]
go !Int
len [] = Word64 -> Word64 -> Int -> Int -> [ByteString]
generic_pad_chunks Word64
a Word64
b Int
lSize Int
len
  go !Int
len (ByteString
c:[ByteString]
cs) = ByteString
c ByteString -> [ByteString] -> [ByteString]
forall a. a -> [a] -> [a]
: Int -> [ByteString] -> [ByteString]
go (Int
len Int -> Int -> Int
forall a. Num a => a -> a -> a
+ ByteString -> Int
SBS.length ByteString
c) [ByteString]
cs

generic_pad_chunks :: Word64 -> Word64 -> Int -> Int -> [SBS.ByteString]
generic_pad_chunks :: Word64 -> Word64 -> Int -> Int -> [ByteString]
generic_pad_chunks Word64
a Word64
b Int
lSize Int
len =
  let lenBits :: Word64
lenBits = Int -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word64) -> Int -> Word64
forall a b. (a -> b) -> a -> b
$ Int
len Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
8
      k :: Word64
k = Word64 -> Word64 -> Word64 -> Word64
calc_k Word64
a Word64
b Word64
lenBits
      -- INVARIANT: k is necessarily > 0, and (k + 1) is a multiple of 8.
      kBytes :: Word64
kBytes = (Word64
k Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
1) Word64 -> Word64 -> Word64
forall a. Integral a => a -> a -> a
`div` Word64
8
      nZeroBytes :: Int
nZeroBytes = Word64 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word64 -> Int) -> Word64 -> Int
forall a b. (a -> b) -> a -> b
$! Word64
kBytes Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
- Word64
1
      padLength :: ByteString
padLength = Int -> Word64 -> ByteString
forall a. (Integral a, Bits a) => Int -> a -> ByteString
toBigEndianSBS Int
lSize Word64
lenBits
  in [Word8 -> ByteString
SBS.singleton Word8
0x80, Int -> Word8 -> ByteString
SBS.replicate Int
nZeroBytes Word8
0, ByteString
padLength]

-- Given a, b, and l, calculate the smallest k such that (l + 1 + k) mod b = a.
calc_k :: Word64 -> Word64 -> Word64 -> Word64
calc_k :: Word64 -> Word64 -> Word64 -> Word64
calc_k Word64
a Word64
b Word64
l =
  if Integer
r Integer -> Integer -> Bool
forall a. Ord a => a -> a -> Bool
<= -Integer
1
    then Integer -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral Integer
r Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
b
    else Integer -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral Integer
r
 where
  r :: Integer
r = Word64 -> Integer
forall a. Integral a => a -> Integer
toInteger Word64
a Integer -> Integer -> Integer
forall a. Num a => a -> a -> a
- Word64 -> Integer
forall a. Integral a => a -> Integer
toInteger Word64
l Integer -> Integer -> Integer
forall a. Integral a => a -> a -> a
`mod` Word64 -> Integer
forall a. Integral a => a -> Integer
toInteger Word64
b Integer -> Integer -> Integer
forall a. Num a => a -> a -> a
- Integer
1

toBigEndianSBS :: (Integral a, Bits a) => Int -> a -> SBS.ByteString
toBigEndianSBS :: Int -> a -> ByteString
toBigEndianSBS Int
s a
val = [Word8] -> ByteString
SBS.pack ([Word8] -> ByteString) -> [Word8] -> ByteString
forall a b. (a -> b) -> a -> b
$ (Int -> Word8) -> [Int] -> [Word8]
forall a b. (a -> b) -> [a] -> [b]
map Int -> Word8
forall b. Num b => Int -> b
getBits [Int
s Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
8, Int
s Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
16 .. Int
0]
 where
   getBits :: Int -> b
getBits Int
x = a -> b
forall a b. (Integral a, Num b) => a -> b
fromIntegral (a -> b) -> a -> b
forall a b. (a -> b) -> a -> b
$ (a
val a -> Int -> a
forall a. Bits a => a -> Int -> a
`shiftR` Int
x) a -> a -> a
forall a. Bits a => a -> a -> a
.&. a
0xFF

fromBigEndianSBS :: (Integral a, Bits a) => SBS.ByteString -> a
fromBigEndianSBS :: ByteString -> a
fromBigEndianSBS =
  (a -> Word8 -> a) -> a -> ByteString -> a
forall a. (a -> Word8 -> a) -> a -> ByteString -> a
SBS.foldl (\ a
acc Word8
x -> (a
acc a -> Int -> a
forall a. Bits a => a -> Int -> a
`shiftL` Int
8) a -> a -> a
forall a. Num a => a -> a -> a
+ Word8 -> a
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word8
x) a
0

-- --------------------------------------------------------------------------
--
-- SHA Functions
--
-- --------------------------------------------------------------------------

{-# SPECIALIZE ch :: Word32 -> Word32 -> Word32 -> Word32 #-}
{-# SPECIALIZE ch :: Word64 -> Word64 -> Word64 -> Word64 #-}
ch :: Bits a => a -> a -> a -> a
ch :: a -> a -> a -> a
ch a
x a
y a
z = (a
x a -> a -> a
forall a. Bits a => a -> a -> a
.&. a
y) a -> a -> a
forall a. Bits a => a -> a -> a
`xor` (a -> a
forall a. Bits a => a -> a
complement a
x a -> a -> a
forall a. Bits a => a -> a -> a
.&. a
z)

{-# SPECIALIZE maj :: Word32 -> Word32 -> Word32 -> Word32 #-}
{-# SPECIALIZE maj :: Word64 -> Word64 -> Word64 -> Word64 #-}
maj :: Bits a => a -> a -> a -> a
maj :: a -> a -> a -> a
maj a
x a
y a
z = (a
x a -> a -> a
forall a. Bits a => a -> a -> a
.&. (a
y a -> a -> a
forall a. Bits a => a -> a -> a
.|. a
z)) a -> a -> a
forall a. Bits a => a -> a -> a
.|. (a
y a -> a -> a
forall a. Bits a => a -> a -> a
.&. a
z)
-- note:
--   the original functions is (x & y) ^ (x & z) ^ (y & z)
--   if you fire off truth tables, this is equivalent to 
--     (x & y) | (x & z) | (y & z)
--   which you can the use distribution on:
--     (x & (y | z)) | (y & z)
--   which saves us one operation.

bsig256_0 :: Word32 -> Word32
bsig256_0 :: Word32 -> Word32
bsig256_0 Word32
x = Word32 -> Int -> Word32
forall a. Bits a => a -> Int -> a
rotateR Word32
x Int
2 Word32 -> Word32 -> Word32
forall a. Bits a => a -> a -> a
`xor` Word32 -> Int -> Word32
forall a. Bits a => a -> Int -> a
rotateR Word32
x Int
13 Word32 -> Word32 -> Word32
forall a. Bits a => a -> a -> a
`xor` Word32 -> Int -> Word32
forall a. Bits a => a -> Int -> a
rotateR Word32
x Int
22

bsig256_1 :: Word32 -> Word32
bsig256_1 :: Word32 -> Word32
bsig256_1 Word32
x = Word32 -> Int -> Word32
forall a. Bits a => a -> Int -> a
rotateR Word32
x Int
6 Word32 -> Word32 -> Word32
forall a. Bits a => a -> a -> a
`xor` Word32 -> Int -> Word32
forall a. Bits a => a -> Int -> a
rotateR Word32
x Int
11 Word32 -> Word32 -> Word32
forall a. Bits a => a -> a -> a
`xor` Word32 -> Int -> Word32
forall a. Bits a => a -> Int -> a
rotateR Word32
x Int
25

lsig256_0 :: Word32 -> Word32
lsig256_0 :: Word32 -> Word32
lsig256_0 Word32
x = Word32 -> Int -> Word32
forall a. Bits a => a -> Int -> a
rotateR Word32
x Int
7 Word32 -> Word32 -> Word32
forall a. Bits a => a -> a -> a
`xor` Word32 -> Int -> Word32
forall a. Bits a => a -> Int -> a
rotateR Word32
x Int
18 Word32 -> Word32 -> Word32
forall a. Bits a => a -> a -> a
`xor` Word32 -> Int -> Word32
forall a. Bits a => a -> Int -> a
shiftR Word32
x Int
3

lsig256_1 :: Word32 -> Word32
lsig256_1 :: Word32 -> Word32
lsig256_1 Word32
x = Word32 -> Int -> Word32
forall a. Bits a => a -> Int -> a
rotateR Word32
x Int
17 Word32 -> Word32 -> Word32
forall a. Bits a => a -> a -> a
`xor` Word32 -> Int -> Word32
forall a. Bits a => a -> Int -> a
rotateR Word32
x Int
19 Word32 -> Word32 -> Word32
forall a. Bits a => a -> a -> a
`xor` Word32 -> Int -> Word32
forall a. Bits a => a -> Int -> a
shiftR Word32
x Int
10

bsig512_0 :: Word64 -> Word64
bsig512_0 :: Word64 -> Word64
bsig512_0 Word64
x = Word64 -> Int -> Word64
forall a. Bits a => a -> Int -> a
rotateR Word64
x Int
28 Word64 -> Word64 -> Word64
forall a. Bits a => a -> a -> a
`xor` Word64 -> Int -> Word64
forall a. Bits a => a -> Int -> a
rotateR Word64
x Int
34 Word64 -> Word64 -> Word64
forall a. Bits a => a -> a -> a
`xor` Word64 -> Int -> Word64
forall a. Bits a => a -> Int -> a
rotateR Word64
x Int
39

bsig512_1 :: Word64 -> Word64
bsig512_1 :: Word64 -> Word64
bsig512_1 Word64
x = Word64 -> Int -> Word64
forall a. Bits a => a -> Int -> a
rotateR Word64
x Int
14 Word64 -> Word64 -> Word64
forall a. Bits a => a -> a -> a
`xor` Word64 -> Int -> Word64
forall a. Bits a => a -> Int -> a
rotateR Word64
x Int
18 Word64 -> Word64 -> Word64
forall a. Bits a => a -> a -> a
`xor` Word64 -> Int -> Word64
forall a. Bits a => a -> Int -> a
rotateR Word64
x Int
41

lsig512_0 :: Word64 -> Word64
lsig512_0 :: Word64 -> Word64
lsig512_0 Word64
x = Word64 -> Int -> Word64
forall a. Bits a => a -> Int -> a
rotateR Word64
x Int
1 Word64 -> Word64 -> Word64
forall a. Bits a => a -> a -> a
`xor` Word64 -> Int -> Word64
forall a. Bits a => a -> Int -> a
rotateR Word64
x Int
8 Word64 -> Word64 -> Word64
forall a. Bits a => a -> a -> a
`xor` Word64 -> Int -> Word64
forall a. Bits a => a -> Int -> a
shiftR Word64
x Int
7

lsig512_1 :: Word64 -> Word64
lsig512_1 :: Word64 -> Word64
lsig512_1 Word64
x = Word64 -> Int -> Word64
forall a. Bits a => a -> Int -> a
rotateR Word64
x Int
19 Word64 -> Word64 -> Word64
forall a. Bits a => a -> a -> a
`xor` Word64 -> Int -> Word64
forall a. Bits a => a -> Int -> a
rotateR Word64
x Int
61 Word64 -> Word64 -> Word64
forall a. Bits a => a -> a -> a
`xor` Word64 -> Int -> Word64
forall a. Bits a => a -> Int -> a
shiftR Word64
x Int
6

-- --------------------------------------------------------------------------
--
-- Message Schedules
--
-- --------------------------------------------------------------------------


data SHA256Block = SHA256Block !Word32 !Word32 !Word32 !Word32 !Word32 -- 00-04
                               !Word32 !Word32 !Word32 !Word32 !Word32 -- 05-09
                               !Word32 !Word32 !Word32 !Word32 !Word32 -- 10-14
                               !Word32

data SHA256Sched = SHA256Sched !Word32 !Word32 !Word32 !Word32 !Word32 -- 00-04
                               !Word32 !Word32 !Word32 !Word32 !Word32 -- 05-09
                               !Word32 !Word32 !Word32 !Word32 !Word32 -- 10-14
                               !Word32 !Word32 !Word32 !Word32 !Word32 -- 15-19
                               !Word32 !Word32 !Word32 !Word32 !Word32 -- 20-24
                               !Word32 !Word32 !Word32 !Word32 !Word32 -- 25-29
                               !Word32 !Word32 !Word32 !Word32 !Word32 -- 30-34
                               !Word32 !Word32 !Word32 !Word32 !Word32 -- 35-39
                               !Word32 !Word32 !Word32 !Word32 !Word32 -- 40-44
                               !Word32 !Word32 !Word32 !Word32 !Word32 -- 45-49
                               !Word32 !Word32 !Word32 !Word32 !Word32 -- 50-54
                               !Word32 !Word32 !Word32 !Word32 !Word32 -- 55-59
                               !Word32 !Word32 !Word32 !Word32         -- 60-63

getSHA256Sched :: SHA256Block -> SHA256Sched
getSHA256Sched :: SHA256Block -> SHA256Sched
getSHA256Sched (SHA256Block Word32
w00 Word32
w01 Word32
w02 Word32
w03
                            Word32
w04 Word32
w05 Word32
w06 Word32
w07
                            Word32
w08 Word32
w09 Word32
w10 Word32
w11
                            Word32
w12 Word32
w13 Word32
w14 Word32
w15) =
  let w16 :: Word32
w16 = Word32 -> Word32
lsig256_1 Word32
w14 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w09 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w01 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w00
      w17 :: Word32
w17 = Word32 -> Word32
lsig256_1 Word32
w15 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w10 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w02 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w01
      w18 :: Word32
w18 = Word32 -> Word32
lsig256_1 Word32
w16 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w11 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w03 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w02
      w19 :: Word32
w19 = Word32 -> Word32
lsig256_1 Word32
w17 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w12 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w04 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w03
      w20 :: Word32
w20 = Word32 -> Word32
lsig256_1 Word32
w18 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w13 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w05 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w04
      w21 :: Word32
w21 = Word32 -> Word32
lsig256_1 Word32
w19 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w14 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w06 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w05
      w22 :: Word32
w22 = Word32 -> Word32
lsig256_1 Word32
w20 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w15 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w07 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w06
      w23 :: Word32
w23 = Word32 -> Word32
lsig256_1 Word32
w21 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w16 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w08 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w07
      w24 :: Word32
w24 = Word32 -> Word32
lsig256_1 Word32
w22 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w17 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w09 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w08
      w25 :: Word32
w25 = Word32 -> Word32
lsig256_1 Word32
w23 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w18 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w10 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w09
      w26 :: Word32
w26 = Word32 -> Word32
lsig256_1 Word32
w24 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w19 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w11 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w10
      w27 :: Word32
w27 = Word32 -> Word32
lsig256_1 Word32
w25 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w20 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w12 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w11
      w28 :: Word32
w28 = Word32 -> Word32
lsig256_1 Word32
w26 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w21 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w13 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w12
      w29 :: Word32
w29 = Word32 -> Word32
lsig256_1 Word32
w27 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w22 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w14 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w13
      w30 :: Word32
w30 = Word32 -> Word32
lsig256_1 Word32
w28 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w23 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w15 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w14
      w31 :: Word32
w31 = Word32 -> Word32
lsig256_1 Word32
w29 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w24 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w16 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w15
      w32 :: Word32
w32 = Word32 -> Word32
lsig256_1 Word32
w30 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w25 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w17 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w16
      w33 :: Word32
w33 = Word32 -> Word32
lsig256_1 Word32
w31 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w26 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w18 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w17
      w34 :: Word32
w34 = Word32 -> Word32
lsig256_1 Word32
w32 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w27 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w19 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w18
      w35 :: Word32
w35 = Word32 -> Word32
lsig256_1 Word32
w33 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w28 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w20 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w19
      w36 :: Word32
w36 = Word32 -> Word32
lsig256_1 Word32
w34 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w29 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w21 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w20
      w37 :: Word32
w37 = Word32 -> Word32
lsig256_1 Word32
w35 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w30 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w22 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w21
      w38 :: Word32
w38 = Word32 -> Word32
lsig256_1 Word32
w36 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w31 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w23 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w22
      w39 :: Word32
w39 = Word32 -> Word32
lsig256_1 Word32
w37 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w32 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w24 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w23
      w40 :: Word32
w40 = Word32 -> Word32
lsig256_1 Word32
w38 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w33 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w25 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w24
      w41 :: Word32
w41 = Word32 -> Word32
lsig256_1 Word32
w39 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w34 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w26 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w25
      w42 :: Word32
w42 = Word32 -> Word32
lsig256_1 Word32
w40 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w35 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w27 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w26
      w43 :: Word32
w43 = Word32 -> Word32
lsig256_1 Word32
w41 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w36 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w28 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w27
      w44 :: Word32
w44 = Word32 -> Word32
lsig256_1 Word32
w42 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w37 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w29 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w28
      w45 :: Word32
w45 = Word32 -> Word32
lsig256_1 Word32
w43 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w38 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w30 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w29
      w46 :: Word32
w46 = Word32 -> Word32
lsig256_1 Word32
w44 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w39 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w31 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w30
      w47 :: Word32
w47 = Word32 -> Word32
lsig256_1 Word32
w45 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w40 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w32 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w31
      w48 :: Word32
w48 = Word32 -> Word32
lsig256_1 Word32
w46 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w41 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w33 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w32
      w49 :: Word32
w49 = Word32 -> Word32
lsig256_1 Word32
w47 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w42 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w34 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w33
      w50 :: Word32
w50 = Word32 -> Word32
lsig256_1 Word32
w48 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w43 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w35 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w34
      w51 :: Word32
w51 = Word32 -> Word32
lsig256_1 Word32
w49 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w44 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w36 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w35
      w52 :: Word32
w52 = Word32 -> Word32
lsig256_1 Word32
w50 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w45 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w37 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w36
      w53 :: Word32
w53 = Word32 -> Word32
lsig256_1 Word32
w51 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w46 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w38 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w37
      w54 :: Word32
w54 = Word32 -> Word32
lsig256_1 Word32
w52 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w47 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w39 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w38
      w55 :: Word32
w55 = Word32 -> Word32
lsig256_1 Word32
w53 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w48 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w40 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w39
      w56 :: Word32
w56 = Word32 -> Word32
lsig256_1 Word32
w54 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w49 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w41 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w40
      w57 :: Word32
w57 = Word32 -> Word32
lsig256_1 Word32
w55 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w50 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w42 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w41
      w58 :: Word32
w58 = Word32 -> Word32
lsig256_1 Word32
w56 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w51 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w43 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w42
      w59 :: Word32
w59 = Word32 -> Word32
lsig256_1 Word32
w57 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w52 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w44 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w43
      w60 :: Word32
w60 = Word32 -> Word32
lsig256_1 Word32
w58 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w53 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w45 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w44
      w61 :: Word32
w61 = Word32 -> Word32
lsig256_1 Word32
w59 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w54 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w46 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w45
      w62 :: Word32
w62 = Word32 -> Word32
lsig256_1 Word32
w60 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w55 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w47 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w46
      w63 :: Word32
w63 = Word32 -> Word32
lsig256_1 Word32
w61 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w56 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
lsig256_0 Word32
w48 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w47
    in Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> SHA256Sched
SHA256Sched Word32
w00 Word32
w01 Word32
w02 Word32
w03 Word32
w04 Word32
w05 Word32
w06 Word32
w07 Word32
w08 Word32
w09
                        Word32
w10 Word32
w11 Word32
w12 Word32
w13 Word32
w14 Word32
w15 Word32
w16 Word32
w17 Word32
w18 Word32
w19
                        Word32
w20 Word32
w21 Word32
w22 Word32
w23 Word32
w24 Word32
w25 Word32
w26 Word32
w27 Word32
w28 Word32
w29
                        Word32
w30 Word32
w31 Word32
w32 Word32
w33 Word32
w34 Word32
w35 Word32
w36 Word32
w37 Word32
w38 Word32
w39
                        Word32
w40 Word32
w41 Word32
w42 Word32
w43 Word32
w44 Word32
w45 Word32
w46 Word32
w47 Word32
w48 Word32
w49
                        Word32
w50 Word32
w51 Word32
w52 Word32
w53 Word32
w54 Word32
w55 Word32
w56 Word32
w57 Word32
w58 Word32
w59
                        Word32
w60 Word32
w61 Word32
w62 Word32
w63

data SHA512Block = SHA512Block !Word64 !Word64 !Word64 !Word64 !Word64 --  0- 4
                               !Word64 !Word64 !Word64 !Word64 !Word64 --  5- 9
                               !Word64 !Word64 !Word64 !Word64 !Word64 -- 10-14
                               !Word64 -- 15

data SHA512Sched = SHA512Sched !Word64 !Word64 !Word64 !Word64 !Word64 --  0- 4
                               !Word64 !Word64 !Word64 !Word64 !Word64 --  5- 9
                               !Word64 !Word64 !Word64 !Word64 !Word64 -- 10-14
                               !Word64 !Word64 !Word64 !Word64 !Word64 -- 15-19
                               !Word64 !Word64 !Word64 !Word64 !Word64 -- 20-24
                               !Word64 !Word64 !Word64 !Word64 !Word64 -- 25-29
                               !Word64 !Word64 !Word64 !Word64 !Word64 -- 30-34
                               !Word64 !Word64 !Word64 !Word64 !Word64 -- 35-39
                               !Word64 !Word64 !Word64 !Word64 !Word64 -- 40-44
                               !Word64 !Word64 !Word64 !Word64 !Word64 -- 45-49
                               !Word64 !Word64 !Word64 !Word64 !Word64 -- 50-54
                               !Word64 !Word64 !Word64 !Word64 !Word64 -- 55-59
                               !Word64 !Word64 !Word64 !Word64 !Word64 -- 60-64
                               !Word64 !Word64 !Word64 !Word64 !Word64 -- 65-69
                               !Word64 !Word64 !Word64 !Word64 !Word64 -- 70-74
                               !Word64 !Word64 !Word64 !Word64 !Word64 -- 75-79

getSHA512Sched :: SHA512Block -> SHA512Sched
getSHA512Sched :: SHA512Block -> SHA512Sched
getSHA512Sched (SHA512Block Word64
w00 Word64
w01 Word64
w02 Word64
w03
                            Word64
w04 Word64
w05 Word64
w06 Word64
w07
                            Word64
w08 Word64
w09 Word64
w10 Word64
w11
                            Word64
w12 Word64
w13 Word64
w14 Word64
w15) =
  let w16 :: Word64
w16 = Word64 -> Word64
lsig512_1 Word64
w14 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w09 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w01 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w00
      w17 :: Word64
w17 = Word64 -> Word64
lsig512_1 Word64
w15 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w10 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w02 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w01
      w18 :: Word64
w18 = Word64 -> Word64
lsig512_1 Word64
w16 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w11 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w03 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w02
      w19 :: Word64
w19 = Word64 -> Word64
lsig512_1 Word64
w17 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w12 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w04 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w03
      w20 :: Word64
w20 = Word64 -> Word64
lsig512_1 Word64
w18 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w13 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w05 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w04
      w21 :: Word64
w21 = Word64 -> Word64
lsig512_1 Word64
w19 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w14 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w06 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w05
      w22 :: Word64
w22 = Word64 -> Word64
lsig512_1 Word64
w20 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w15 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w07 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w06
      w23 :: Word64
w23 = Word64 -> Word64
lsig512_1 Word64
w21 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w16 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w08 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w07
      w24 :: Word64
w24 = Word64 -> Word64
lsig512_1 Word64
w22 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w17 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w09 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w08
      w25 :: Word64
w25 = Word64 -> Word64
lsig512_1 Word64
w23 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w18 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w10 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w09
      w26 :: Word64
w26 = Word64 -> Word64
lsig512_1 Word64
w24 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w19 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w11 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w10
      w27 :: Word64
w27 = Word64 -> Word64
lsig512_1 Word64
w25 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w20 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w12 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w11
      w28 :: Word64
w28 = Word64 -> Word64
lsig512_1 Word64
w26 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w21 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w13 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w12
      w29 :: Word64
w29 = Word64 -> Word64
lsig512_1 Word64
w27 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w22 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w14 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w13
      w30 :: Word64
w30 = Word64 -> Word64
lsig512_1 Word64
w28 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w23 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w15 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w14
      w31 :: Word64
w31 = Word64 -> Word64
lsig512_1 Word64
w29 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w24 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w16 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w15
      w32 :: Word64
w32 = Word64 -> Word64
lsig512_1 Word64
w30 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w25 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w17 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w16
      w33 :: Word64
w33 = Word64 -> Word64
lsig512_1 Word64
w31 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w26 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w18 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w17
      w34 :: Word64
w34 = Word64 -> Word64
lsig512_1 Word64
w32 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w27 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w19 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w18
      w35 :: Word64
w35 = Word64 -> Word64
lsig512_1 Word64
w33 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w28 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w20 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w19
      w36 :: Word64
w36 = Word64 -> Word64
lsig512_1 Word64
w34 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w29 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w21 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w20
      w37 :: Word64
w37 = Word64 -> Word64
lsig512_1 Word64
w35 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w30 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w22 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w21
      w38 :: Word64
w38 = Word64 -> Word64
lsig512_1 Word64
w36 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w31 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w23 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w22
      w39 :: Word64
w39 = Word64 -> Word64
lsig512_1 Word64
w37 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w32 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w24 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w23
      w40 :: Word64
w40 = Word64 -> Word64
lsig512_1 Word64
w38 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w33 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w25 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w24
      w41 :: Word64
w41 = Word64 -> Word64
lsig512_1 Word64
w39 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w34 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w26 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w25
      w42 :: Word64
w42 = Word64 -> Word64
lsig512_1 Word64
w40 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w35 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w27 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w26
      w43 :: Word64
w43 = Word64 -> Word64
lsig512_1 Word64
w41 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w36 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w28 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w27
      w44 :: Word64
w44 = Word64 -> Word64
lsig512_1 Word64
w42 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w37 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w29 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w28
      w45 :: Word64
w45 = Word64 -> Word64
lsig512_1 Word64
w43 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w38 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w30 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w29
      w46 :: Word64
w46 = Word64 -> Word64
lsig512_1 Word64
w44 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w39 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w31 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w30
      w47 :: Word64
w47 = Word64 -> Word64
lsig512_1 Word64
w45 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w40 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w32 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w31
      w48 :: Word64
w48 = Word64 -> Word64
lsig512_1 Word64
w46 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w41 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w33 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w32
      w49 :: Word64
w49 = Word64 -> Word64
lsig512_1 Word64
w47 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w42 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w34 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w33
      w50 :: Word64
w50 = Word64 -> Word64
lsig512_1 Word64
w48 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w43 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w35 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w34
      w51 :: Word64
w51 = Word64 -> Word64
lsig512_1 Word64
w49 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w44 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w36 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w35
      w52 :: Word64
w52 = Word64 -> Word64
lsig512_1 Word64
w50 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w45 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w37 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w36
      w53 :: Word64
w53 = Word64 -> Word64
lsig512_1 Word64
w51 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w46 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w38 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w37
      w54 :: Word64
w54 = Word64 -> Word64
lsig512_1 Word64
w52 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w47 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w39 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w38
      w55 :: Word64
w55 = Word64 -> Word64
lsig512_1 Word64
w53 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w48 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w40 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w39
      w56 :: Word64
w56 = Word64 -> Word64
lsig512_1 Word64
w54 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w49 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w41 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w40
      w57 :: Word64
w57 = Word64 -> Word64
lsig512_1 Word64
w55 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w50 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w42 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w41
      w58 :: Word64
w58 = Word64 -> Word64
lsig512_1 Word64
w56 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w51 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w43 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w42
      w59 :: Word64
w59 = Word64 -> Word64
lsig512_1 Word64
w57 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w52 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w44 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w43
      w60 :: Word64
w60 = Word64 -> Word64
lsig512_1 Word64
w58 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w53 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w45 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w44
      w61 :: Word64
w61 = Word64 -> Word64
lsig512_1 Word64
w59 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w54 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w46 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w45
      w62 :: Word64
w62 = Word64 -> Word64
lsig512_1 Word64
w60 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w55 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w47 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w46
      w63 :: Word64
w63 = Word64 -> Word64
lsig512_1 Word64
w61 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w56 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w48 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w47
      w64 :: Word64
w64 = Word64 -> Word64
lsig512_1 Word64
w62 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w57 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w49 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w48
      w65 :: Word64
w65 = Word64 -> Word64
lsig512_1 Word64
w63 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w58 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w50 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w49
      w66 :: Word64
w66 = Word64 -> Word64
lsig512_1 Word64
w64 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w59 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w51 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w50
      w67 :: Word64
w67 = Word64 -> Word64
lsig512_1 Word64
w65 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w60 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w52 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w51
      w68 :: Word64
w68 = Word64 -> Word64
lsig512_1 Word64
w66 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w61 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w53 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w52
      w69 :: Word64
w69 = Word64 -> Word64
lsig512_1 Word64
w67 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w62 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w54 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w53
      w70 :: Word64
w70 = Word64 -> Word64
lsig512_1 Word64
w68 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w63 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w55 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w54
      w71 :: Word64
w71 = Word64 -> Word64
lsig512_1 Word64
w69 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w64 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w56 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w55
      w72 :: Word64
w72 = Word64 -> Word64
lsig512_1 Word64
w70 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w65 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w57 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w56
      w73 :: Word64
w73 = Word64 -> Word64
lsig512_1 Word64
w71 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w66 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w58 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w57
      w74 :: Word64
w74 = Word64 -> Word64
lsig512_1 Word64
w72 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w67 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w59 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w58
      w75 :: Word64
w75 = Word64 -> Word64
lsig512_1 Word64
w73 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w68 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w60 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w59
      w76 :: Word64
w76 = Word64 -> Word64
lsig512_1 Word64
w74 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w69 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w61 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w60
      w77 :: Word64
w77 = Word64 -> Word64
lsig512_1 Word64
w75 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w70 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w62 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w61
      w78 :: Word64
w78 = Word64 -> Word64
lsig512_1 Word64
w76 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w71 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w63 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w62
      w79 :: Word64
w79 = Word64 -> Word64
lsig512_1 Word64
w77 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w72 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
lsig512_0 Word64
w64 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w63
    in Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> SHA512Sched
SHA512Sched Word64
w00 Word64
w01 Word64
w02 Word64
w03 Word64
w04 Word64
w05 Word64
w06 Word64
w07 Word64
w08 Word64
w09
                        Word64
w10 Word64
w11 Word64
w12 Word64
w13 Word64
w14 Word64
w15 Word64
w16 Word64
w17 Word64
w18 Word64
w19
                        Word64
w20 Word64
w21 Word64
w22 Word64
w23 Word64
w24 Word64
w25 Word64
w26 Word64
w27 Word64
w28 Word64
w29
                        Word64
w30 Word64
w31 Word64
w32 Word64
w33 Word64
w34 Word64
w35 Word64
w36 Word64
w37 Word64
w38 Word64
w39
                        Word64
w40 Word64
w41 Word64
w42 Word64
w43 Word64
w44 Word64
w45 Word64
w46 Word64
w47 Word64
w48 Word64
w49
                        Word64
w50 Word64
w51 Word64
w52 Word64
w53 Word64
w54 Word64
w55 Word64
w56 Word64
w57 Word64
w58 Word64
w59
                        Word64
w60 Word64
w61 Word64
w62 Word64
w63 Word64
w64 Word64
w65 Word64
w66 Word64
w67 Word64
w68 Word64
w69
                        Word64
w70 Word64
w71 Word64
w72 Word64
w73 Word64
w74 Word64
w75 Word64
w76 Word64
w77 Word64
w78 Word64
w79

-- --------------------------------------------------------------------------
--
-- SHA Block Processors
--
-- --------------------------------------------------------------------------


processSHA256Block :: SHA256State -> SHA256Block -> SHA256State
processSHA256Block :: SHA256State -> SHA256Block -> SHA256State
processSHA256Block !s00 :: SHA256State
s00@(SHA256S Word32
a00 Word32
b00 Word32
c00 Word32
d00 Word32
e00 Word32
f00 Word32
g00 Word32
h00) !SHA256Block
blk = do
  let (SHA256Sched Word32
w00 Word32
w01 Word32
w02 Word32
w03 Word32
w04 Word32
w05 Word32
w06 Word32
w07 Word32
w08 Word32
w09
               Word32
w10 Word32
w11 Word32
w12 Word32
w13 Word32
w14 Word32
w15 Word32
w16 Word32
w17 Word32
w18 Word32
w19
               Word32
w20 Word32
w21 Word32
w22 Word32
w23 Word32
w24 Word32
w25 Word32
w26 Word32
w27 Word32
w28 Word32
w29
               Word32
w30 Word32
w31 Word32
w32 Word32
w33 Word32
w34 Word32
w35 Word32
w36 Word32
w37 Word32
w38 Word32
w39
               Word32
w40 Word32
w41 Word32
w42 Word32
w43 Word32
w44 Word32
w45 Word32
w46 Word32
w47 Word32
w48 Word32
w49
               Word32
w50 Word32
w51 Word32
w52 Word32
w53 Word32
w54 Word32
w55 Word32
w56 Word32
w57 Word32
w58 Word32
w59
               Word32
w60 Word32
w61 Word32
w62 Word32
w63) = SHA256Block -> SHA256Sched
getSHA256Sched SHA256Block
blk
      s01 :: SHA256State
s01 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s00 Word32
0x428a2f98 Word32
w00
      s02 :: SHA256State
s02 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s01 Word32
0x71374491 Word32
w01
      s03 :: SHA256State
s03 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s02 Word32
0xb5c0fbcf Word32
w02
      s04 :: SHA256State
s04 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s03 Word32
0xe9b5dba5 Word32
w03
      s05 :: SHA256State
s05 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s04 Word32
0x3956c25b Word32
w04
      s06 :: SHA256State
s06 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s05 Word32
0x59f111f1 Word32
w05
      s07 :: SHA256State
s07 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s06 Word32
0x923f82a4 Word32
w06
      s08 :: SHA256State
s08 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s07 Word32
0xab1c5ed5 Word32
w07
      s09 :: SHA256State
s09 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s08 Word32
0xd807aa98 Word32
w08
      s10 :: SHA256State
s10 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s09 Word32
0x12835b01 Word32
w09
      s11 :: SHA256State
s11 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s10 Word32
0x243185be Word32
w10
      s12 :: SHA256State
s12 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s11 Word32
0x550c7dc3 Word32
w11
      s13 :: SHA256State
s13 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s12 Word32
0x72be5d74 Word32
w12
      s14 :: SHA256State
s14 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s13 Word32
0x80deb1fe Word32
w13
      s15 :: SHA256State
s15 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s14 Word32
0x9bdc06a7 Word32
w14
      s16 :: SHA256State
s16 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s15 Word32
0xc19bf174 Word32
w15
      s17 :: SHA256State
s17 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s16 Word32
0xe49b69c1 Word32
w16
      s18 :: SHA256State
s18 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s17 Word32
0xefbe4786 Word32
w17
      s19 :: SHA256State
s19 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s18 Word32
0x0fc19dc6 Word32
w18
      s20 :: SHA256State
s20 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s19 Word32
0x240ca1cc Word32
w19
      s21 :: SHA256State
s21 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s20 Word32
0x2de92c6f Word32
w20
      s22 :: SHA256State
s22 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s21 Word32
0x4a7484aa Word32
w21
      s23 :: SHA256State
s23 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s22 Word32
0x5cb0a9dc Word32
w22
      s24 :: SHA256State
s24 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s23 Word32
0x76f988da Word32
w23
      s25 :: SHA256State
s25 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s24 Word32
0x983e5152 Word32
w24
      s26 :: SHA256State
s26 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s25 Word32
0xa831c66d Word32
w25
      s27 :: SHA256State
s27 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s26 Word32
0xb00327c8 Word32
w26
      s28 :: SHA256State
s28 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s27 Word32
0xbf597fc7 Word32
w27
      s29 :: SHA256State
s29 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s28 Word32
0xc6e00bf3 Word32
w28
      s30 :: SHA256State
s30 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s29 Word32
0xd5a79147 Word32
w29
      s31 :: SHA256State
s31 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s30 Word32
0x06ca6351 Word32
w30
      s32 :: SHA256State
s32 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s31 Word32
0x14292967 Word32
w31
      s33 :: SHA256State
s33 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s32 Word32
0x27b70a85 Word32
w32
      s34 :: SHA256State
s34 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s33 Word32
0x2e1b2138 Word32
w33
      s35 :: SHA256State
s35 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s34 Word32
0x4d2c6dfc Word32
w34
      s36 :: SHA256State
s36 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s35 Word32
0x53380d13 Word32
w35
      s37 :: SHA256State
s37 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s36 Word32
0x650a7354 Word32
w36
      s38 :: SHA256State
s38 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s37 Word32
0x766a0abb Word32
w37
      s39 :: SHA256State
s39 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s38 Word32
0x81c2c92e Word32
w38
      s40 :: SHA256State
s40 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s39 Word32
0x92722c85 Word32
w39
      s41 :: SHA256State
s41 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s40 Word32
0xa2bfe8a1 Word32
w40
      s42 :: SHA256State
s42 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s41 Word32
0xa81a664b Word32
w41
      s43 :: SHA256State
s43 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s42 Word32
0xc24b8b70 Word32
w42
      s44 :: SHA256State
s44 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s43 Word32
0xc76c51a3 Word32
w43
      s45 :: SHA256State
s45 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s44 Word32
0xd192e819 Word32
w44
      s46 :: SHA256State
s46 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s45 Word32
0xd6990624 Word32
w45
      s47 :: SHA256State
s47 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s46 Word32
0xf40e3585 Word32
w46
      s48 :: SHA256State
s48 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s47 Word32
0x106aa070 Word32
w47
      s49 :: SHA256State
s49 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s48 Word32
0x19a4c116 Word32
w48
      s50 :: SHA256State
s50 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s49 Word32
0x1e376c08 Word32
w49
      s51 :: SHA256State
s51 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s50 Word32
0x2748774c Word32
w50
      s52 :: SHA256State
s52 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s51 Word32
0x34b0bcb5 Word32
w51
      s53 :: SHA256State
s53 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s52 Word32
0x391c0cb3 Word32
w52
      s54 :: SHA256State
s54 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s53 Word32
0x4ed8aa4a Word32
w53
      s55 :: SHA256State
s55 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s54 Word32
0x5b9cca4f Word32
w54
      s56 :: SHA256State
s56 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s55 Word32
0x682e6ff3 Word32
w55
      s57 :: SHA256State
s57 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s56 Word32
0x748f82ee Word32
w56
      s58 :: SHA256State
s58 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s57 Word32
0x78a5636f Word32
w57
      s59 :: SHA256State
s59 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s58 Word32
0x84c87814 Word32
w58
      s60 :: SHA256State
s60 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s59 Word32
0x8cc70208 Word32
w59
      s61 :: SHA256State
s61 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s60 Word32
0x90befffa Word32
w60
      s62 :: SHA256State
s62 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s61 Word32
0xa4506ceb Word32
w61
      s63 :: SHA256State
s63 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s62 Word32
0xbef9a3f7 Word32
w62
      s64 :: SHA256State
s64 = SHA256State -> Word32 -> Word32 -> SHA256State
step256 SHA256State
s63 Word32
0xc67178f2 Word32
w63
      SHA256S Word32
a64 Word32
b64 Word32
c64 Word32
d64 Word32
e64 Word32
f64 Word32
g64 Word32
h64 = SHA256State
s64
    in Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> SHA256State
SHA256S (Word32
a00 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
a64) (Word32
b00 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
b64) (Word32
c00 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
c64) (Word32
d00 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
d64)
               (Word32
e00 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
e64) (Word32
f00 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
f64) (Word32
g00 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
g64) (Word32
h00 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
h64)

{-# INLINE step256 #-}
step256 :: SHA256State -> Word32 -> Word32 -> SHA256State
step256 :: SHA256State -> Word32 -> Word32 -> SHA256State
step256 !(SHA256S Word32
a Word32
b Word32
c Word32
d Word32
e Word32
f Word32
g Word32
h) Word32
k Word32
w = Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> SHA256State
SHA256S Word32
a' Word32
b' Word32
c' Word32
d' Word32
e' Word32
f' Word32
g' Word32
h'
 where
  t1 :: Word32
t1 = Word32
h Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32
bsig256_1 Word32
e Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32 -> Word32 -> Word32
forall a. Bits a => a -> a -> a -> a
ch Word32
e Word32
f Word32
g Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
k Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
w
  t2 :: Word32
t2 = Word32 -> Word32
bsig256_0 Word32
a Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32 -> Word32 -> Word32 -> Word32
forall a. Bits a => a -> a -> a -> a
maj Word32
a Word32
b Word32
c
  h' :: Word32
h' = Word32
g
  g' :: Word32
g' = Word32
f
  f' :: Word32
f' = Word32
e
  e' :: Word32
e' = Word32
d Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
t1
  d' :: Word32
d' = Word32
c
  c' :: Word32
c' = Word32
b
  b' :: Word32
b' = Word32
a
  a' :: Word32
a' = Word32
t1 Word32 -> Word32 -> Word32
forall a. Num a => a -> a -> a
+ Word32
t2

processSHA512Block :: SHA512State -> SHA512Block -> SHA512State
processSHA512Block :: SHA512State -> SHA512Block -> SHA512State
processSHA512Block !s00 :: SHA512State
s00@(SHA512S Word64
a00 Word64
b00 Word64
c00 Word64
d00 Word64
e00 Word64
f00 Word64
g00 Word64
h00) !SHA512Block
blk =
  let (SHA512Sched Word64
w00 Word64
w01 Word64
w02 Word64
w03 Word64
w04 Word64
w05 Word64
w06 Word64
w07 Word64
w08 Word64
w09
               Word64
w10 Word64
w11 Word64
w12 Word64
w13 Word64
w14 Word64
w15 Word64
w16 Word64
w17 Word64
w18 Word64
w19
               Word64
w20 Word64
w21 Word64
w22 Word64
w23 Word64
w24 Word64
w25 Word64
w26 Word64
w27 Word64
w28 Word64
w29
               Word64
w30 Word64
w31 Word64
w32 Word64
w33 Word64
w34 Word64
w35 Word64
w36 Word64
w37 Word64
w38 Word64
w39
               Word64
w40 Word64
w41 Word64
w42 Word64
w43 Word64
w44 Word64
w45 Word64
w46 Word64
w47 Word64
w48 Word64
w49
               Word64
w50 Word64
w51 Word64
w52 Word64
w53 Word64
w54 Word64
w55 Word64
w56 Word64
w57 Word64
w58 Word64
w59
               Word64
w60 Word64
w61 Word64
w62 Word64
w63 Word64
w64 Word64
w65 Word64
w66 Word64
w67 Word64
w68 Word64
w69
               Word64
w70 Word64
w71 Word64
w72 Word64
w73 Word64
w74 Word64
w75 Word64
w76 Word64
w77 Word64
w78 Word64
w79) = SHA512Block -> SHA512Sched
getSHA512Sched SHA512Block
blk
      s01 :: SHA512State
s01 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s00 Word64
0x428a2f98d728ae22 Word64
w00
      s02 :: SHA512State
s02 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s01 Word64
0x7137449123ef65cd Word64
w01
      s03 :: SHA512State
s03 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s02 Word64
0xb5c0fbcfec4d3b2f Word64
w02
      s04 :: SHA512State
s04 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s03 Word64
0xe9b5dba58189dbbc Word64
w03
      s05 :: SHA512State
s05 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s04 Word64
0x3956c25bf348b538 Word64
w04
      s06 :: SHA512State
s06 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s05 Word64
0x59f111f1b605d019 Word64
w05
      s07 :: SHA512State
s07 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s06 Word64
0x923f82a4af194f9b Word64
w06
      s08 :: SHA512State
s08 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s07 Word64
0xab1c5ed5da6d8118 Word64
w07
      s09 :: SHA512State
s09 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s08 Word64
0xd807aa98a3030242 Word64
w08
      s10 :: SHA512State
s10 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s09 Word64
0x12835b0145706fbe Word64
w09
      s11 :: SHA512State
s11 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s10 Word64
0x243185be4ee4b28c Word64
w10
      s12 :: SHA512State
s12 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s11 Word64
0x550c7dc3d5ffb4e2 Word64
w11
      s13 :: SHA512State
s13 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s12 Word64
0x72be5d74f27b896f Word64
w12
      s14 :: SHA512State
s14 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s13 Word64
0x80deb1fe3b1696b1 Word64
w13
      s15 :: SHA512State
s15 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s14 Word64
0x9bdc06a725c71235 Word64
w14
      s16 :: SHA512State
s16 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s15 Word64
0xc19bf174cf692694 Word64
w15
      s17 :: SHA512State
s17 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s16 Word64
0xe49b69c19ef14ad2 Word64
w16
      s18 :: SHA512State
s18 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s17 Word64
0xefbe4786384f25e3 Word64
w17
      s19 :: SHA512State
s19 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s18 Word64
0x0fc19dc68b8cd5b5 Word64
w18
      s20 :: SHA512State
s20 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s19 Word64
0x240ca1cc77ac9c65 Word64
w19
      s21 :: SHA512State
s21 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s20 Word64
0x2de92c6f592b0275 Word64
w20
      s22 :: SHA512State
s22 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s21 Word64
0x4a7484aa6ea6e483 Word64
w21
      s23 :: SHA512State
s23 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s22 Word64
0x5cb0a9dcbd41fbd4 Word64
w22
      s24 :: SHA512State
s24 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s23 Word64
0x76f988da831153b5 Word64
w23
      s25 :: SHA512State
s25 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s24 Word64
0x983e5152ee66dfab Word64
w24
      s26 :: SHA512State
s26 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s25 Word64
0xa831c66d2db43210 Word64
w25
      s27 :: SHA512State
s27 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s26 Word64
0xb00327c898fb213f Word64
w26
      s28 :: SHA512State
s28 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s27 Word64
0xbf597fc7beef0ee4 Word64
w27
      s29 :: SHA512State
s29 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s28 Word64
0xc6e00bf33da88fc2 Word64
w28
      s30 :: SHA512State
s30 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s29 Word64
0xd5a79147930aa725 Word64
w29
      s31 :: SHA512State
s31 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s30 Word64
0x06ca6351e003826f Word64
w30
      s32 :: SHA512State
s32 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s31 Word64
0x142929670a0e6e70 Word64
w31
      s33 :: SHA512State
s33 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s32 Word64
0x27b70a8546d22ffc Word64
w32
      s34 :: SHA512State
s34 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s33 Word64
0x2e1b21385c26c926 Word64
w33
      s35 :: SHA512State
s35 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s34 Word64
0x4d2c6dfc5ac42aed Word64
w34
      s36 :: SHA512State
s36 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s35 Word64
0x53380d139d95b3df Word64
w35
      s37 :: SHA512State
s37 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s36 Word64
0x650a73548baf63de Word64
w36
      s38 :: SHA512State
s38 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s37 Word64
0x766a0abb3c77b2a8 Word64
w37
      s39 :: SHA512State
s39 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s38 Word64
0x81c2c92e47edaee6 Word64
w38
      s40 :: SHA512State
s40 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s39 Word64
0x92722c851482353b Word64
w39
      s41 :: SHA512State
s41 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s40 Word64
0xa2bfe8a14cf10364 Word64
w40
      s42 :: SHA512State
s42 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s41 Word64
0xa81a664bbc423001 Word64
w41
      s43 :: SHA512State
s43 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s42 Word64
0xc24b8b70d0f89791 Word64
w42
      s44 :: SHA512State
s44 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s43 Word64
0xc76c51a30654be30 Word64
w43
      s45 :: SHA512State
s45 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s44 Word64
0xd192e819d6ef5218 Word64
w44
      s46 :: SHA512State
s46 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s45 Word64
0xd69906245565a910 Word64
w45
      s47 :: SHA512State
s47 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s46 Word64
0xf40e35855771202a Word64
w46
      s48 :: SHA512State
s48 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s47 Word64
0x106aa07032bbd1b8 Word64
w47
      s49 :: SHA512State
s49 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s48 Word64
0x19a4c116b8d2d0c8 Word64
w48
      s50 :: SHA512State
s50 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s49 Word64
0x1e376c085141ab53 Word64
w49
      s51 :: SHA512State
s51 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s50 Word64
0x2748774cdf8eeb99 Word64
w50
      s52 :: SHA512State
s52 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s51 Word64
0x34b0bcb5e19b48a8 Word64
w51
      s53 :: SHA512State
s53 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s52 Word64
0x391c0cb3c5c95a63 Word64
w52
      s54 :: SHA512State
s54 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s53 Word64
0x4ed8aa4ae3418acb Word64
w53
      s55 :: SHA512State
s55 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s54 Word64
0x5b9cca4f7763e373 Word64
w54
      s56 :: SHA512State
s56 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s55 Word64
0x682e6ff3d6b2b8a3 Word64
w55
      s57 :: SHA512State
s57 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s56 Word64
0x748f82ee5defb2fc Word64
w56
      s58 :: SHA512State
s58 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s57 Word64
0x78a5636f43172f60 Word64
w57
      s59 :: SHA512State
s59 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s58 Word64
0x84c87814a1f0ab72 Word64
w58
      s60 :: SHA512State
s60 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s59 Word64
0x8cc702081a6439ec Word64
w59
      s61 :: SHA512State
s61 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s60 Word64
0x90befffa23631e28 Word64
w60
      s62 :: SHA512State
s62 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s61 Word64
0xa4506cebde82bde9 Word64
w61
      s63 :: SHA512State
s63 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s62 Word64
0xbef9a3f7b2c67915 Word64
w62
      s64 :: SHA512State
s64 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s63 Word64
0xc67178f2e372532b Word64
w63
      s65 :: SHA512State
s65 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s64 Word64
0xca273eceea26619c Word64
w64
      s66 :: SHA512State
s66 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s65 Word64
0xd186b8c721c0c207 Word64
w65
      s67 :: SHA512State
s67 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s66 Word64
0xeada7dd6cde0eb1e Word64
w66
      s68 :: SHA512State
s68 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s67 Word64
0xf57d4f7fee6ed178 Word64
w67
      s69 :: SHA512State
s69 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s68 Word64
0x06f067aa72176fba Word64
w68
      s70 :: SHA512State
s70 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s69 Word64
0x0a637dc5a2c898a6 Word64
w69
      s71 :: SHA512State
s71 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s70 Word64
0x113f9804bef90dae Word64
w70
      s72 :: SHA512State
s72 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s71 Word64
0x1b710b35131c471b Word64
w71
      s73 :: SHA512State
s73 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s72 Word64
0x28db77f523047d84 Word64
w72
      s74 :: SHA512State
s74 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s73 Word64
0x32caab7b40c72493 Word64
w73
      s75 :: SHA512State
s75 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s74 Word64
0x3c9ebe0a15c9bebc Word64
w74
      s76 :: SHA512State
s76 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s75 Word64
0x431d67c49c100d4c Word64
w75
      s77 :: SHA512State
s77 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s76 Word64
0x4cc5d4becb3e42b6 Word64
w76
      s78 :: SHA512State
s78 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s77 Word64
0x597f299cfc657e2a Word64
w77
      s79 :: SHA512State
s79 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s78 Word64
0x5fcb6fab3ad6faec Word64
w78
      s80 :: SHA512State
s80 = SHA512State -> Word64 -> Word64 -> SHA512State
step512 SHA512State
s79 Word64
0x6c44198c4a475817 Word64
w79
      SHA512S Word64
a80 Word64
b80 Word64
c80 Word64
d80 Word64
e80 Word64
f80 Word64
g80 Word64
h80 = SHA512State
s80
    in Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> SHA512State
SHA512S (Word64
a00 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
a80) (Word64
b00 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
b80) (Word64
c00 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
c80) (Word64
d00 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
d80)
               (Word64
e00 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
e80) (Word64
f00 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
f80) (Word64
g00 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
g80) (Word64
h00 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
h80)

{-# INLINE step512 #-}
step512 :: SHA512State -> Word64 -> Word64 -> SHA512State
step512 :: SHA512State -> Word64 -> Word64 -> SHA512State
step512 !(SHA512S Word64
a Word64
b Word64
c Word64
d Word64
e Word64
f Word64
g Word64
h) Word64
k Word64
w = Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> Word64
-> SHA512State
SHA512S Word64
a' Word64
b' Word64
c' Word64
d' Word64
e' Word64
f' Word64
g' Word64
h'
 where
  t1 :: Word64
t1 = Word64
h Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64
bsig512_1 Word64
e Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64 -> Word64 -> Word64
forall a. Bits a => a -> a -> a -> a
ch Word64
e Word64
f Word64
g Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
k Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
w
  t2 :: Word64
t2 = Word64 -> Word64
bsig512_0 Word64
a Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64 -> Word64 -> Word64 -> Word64
forall a. Bits a => a -> a -> a -> a
maj Word64
a Word64
b Word64
c
  h' :: Word64
h' = Word64
g
  g' :: Word64
g' = Word64
f
  f' :: Word64
f' = Word64
e
  e' :: Word64
e' = Word64
d Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
t1
  d' :: Word64
d' = Word64
c
  c' :: Word64
c' = Word64
b
  b' :: Word64
b' = Word64
a
  a' :: Word64
a' = Word64
t1 Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ Word64
t2