Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Cryptography.Twistree
Synopsis
- data Twistree
- type SBox = Vector Word8
- sboxes :: ByteString -> SBox
- sameBitcount :: SBox -> [Word8]
- compress :: Vector Word8 -> Vector Word8 -> Int -> Vector Word8
- linearSbox :: SBox
- linearTwistree :: Twistree
- parListDeal :: Int -> Strategy a -> Strategy [a]
- keyedTwistree :: ByteString -> Twistree
- hash :: Twistree -> ByteString -> Vector Word8
Documentation
sboxes :: ByteString -> SBox Source #
Computes S-boxes from a key. Exported for cryptanalysis.
sameBitcount :: SBox -> [Word8] Source #
Returns a list of the bytes which, when looked up in the S-boxes, give three bytes (which may be the same) with the same bitcount. For cryptanalysis of the hash function.
compress :: Vector Word8 -> Vector Word8 -> Int -> Vector Word8 Source #
Compresses two or three 32-byte blocks into one. Exported for cryptanalysis.
linearSbox :: SBox Source #
A linear SBox
used for cryptanalysis
Deals a list among threads; each thread evaluates the items of its part of the list in sequence, and all the threads run in parallel. If n is 12, the 0th, 12th, 24th, ... items are evaluated by one thread, the 1st, 13rd, 25th, ... items are evaluated by another thread, and so on.
keyedTwistree :: ByteString -> Twistree Source #