WringTwistree-0.0.1.1: Whole-message cipher and tree hash
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cryptography.Twistree

Synopsis

Documentation

data Twistree Source #

Instances

Instances details
Show Twistree Source # 
Instance details

Defined in Cryptography.Twistree

type SBox = Vector Word8 Source #

Three 8×8 S-boxes used alternatively to substitute bytes

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

linearTwistree :: Twistree Source #

A Twistree with linear SBox. Used only for testing and cryptanalysis.

keyedTwistree :: ByteString -> Twistree Source #

Creates a Twistree with the given key. To convert a String to a ByteString, put - utf8-string in your package.yaml dependencies, import Data.ByteString.UTF8, and use fromString.

hash Source #

Arguments

:: Twistree

The Twistree made with the key to hash with

-> ByteString

The text to be hashed. It's a lazy ByteString, so you can hash a file bigger than RAM.

-> Vector Word8

The returned hash, 32 bytes.