threefish-0.2.6: The Threefish block cipher and the Skein hash function for Haskell.

Safe HaskellNone

Crypto.Threefish

Description

256 and 512 bit variants of the Threefish block cipher used as the foundation of the Skein hash function.

Synopsis

Documentation

data Tweak Source

Threefish tweak value. Please see the Skein specification for info on how to use this.

Constructors

Tweak !Word64 !Word64 

parseHex :: String -> Maybe ByteStringSource

Parses a string of hexadecimal digits into a ByteString.

readHex :: Serialize a => String -> Maybe aSource

Read any deserializable type from a hex string.

defaultTweak :: TweakSource

Default tweak when Threefish is used in CBC, CTR, etc. modes.

class Serialize a => Threefish a b | a -> b whereSource

Methods

threefishKey :: Tweak -> a -> bSource

Create a Threefish key using a custom tweak value.

threefishEncrypt :: a -> Tweak -> a -> aSource

Encrypt a block using the given key and tweak value.

threefishDecrypt :: a -> Tweak -> a -> aSource

Decrypt a block using the given key and tweak value.

toBlock :: ByteString -> Maybe aSource

Create an appropriately sized block.

fromBlock :: a -> ByteStringSource

Extract the contents of a block.