Safe Haskell | None |
---|
256 and 512 bit variants of the Threefish block cipher used as the foundation of the Skein hash function.
- data Block256
- data Threefish256
- type Key256 = Block256
- data Block512
- data Threefish512
- type Key512 = Block512
- data Tweak = Tweak !Word64 !Word64
- parseHex :: String -> Maybe ByteString
- readHex :: Serialize a => String -> Maybe a
- defaultTweak :: Tweak
- class Serialize a => Threefish a b | a -> b where
- threefishKey :: Tweak -> a -> b
- threefishEncrypt :: a -> Tweak -> a -> a
- threefishDecrypt :: a -> Tweak -> a -> a
- toBlock :: ByteString -> Maybe a
- fromBlock :: a -> ByteString
Documentation
data Threefish256 Source
256 bit Threefish block cipher.
data Threefish512 Source
512 bit Threefish block cipher.
Threefish tweak value. Please see the Skein specification for info on how to use this.
parseHex :: String -> Maybe ByteStringSource
Parses a string of hexadecimal digits into a ByteString.
Default tweak when Threefish is used in CBC, CTR, etc. modes.
class Serialize a => Threefish a b | a -> b whereSource
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.