| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Crypto.Threefish
Description
256 and 512 bit variants of the Threefish block cipher used as the foundation of the Skein hash function.
Synopsis
- 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.
Instances
data Threefish512 Source #
512 bit Threefish block cipher.
Instances
Threefish tweak value. Please see the Skein specification for info on how to use this.
parseHex :: String -> Maybe ByteString Source #
Parses a string of hexadecimal digits into a ByteString.
defaultTweak :: Tweak Source #
Default tweak when Threefish is used in CBC, CTR, etc. modes.
class Serialize a => Threefish a b | a -> b where Source #
Methods
threefishKey :: Tweak -> a -> b Source #
Create a Threefish key using a custom tweak value.
threefishEncrypt :: a -> Tweak -> a -> a Source #
Encrypt a block using the given key and tweak value.
threefishDecrypt :: a -> Tweak -> a -> a Source #
Decrypt a block using the given key and tweak value.
toBlock :: ByteString -> Maybe a Source #
Create an appropriately sized block.
fromBlock :: a -> ByteString Source #
Extract the contents of a block.
Instances
| Threefish Block256 Threefish256 Source # | |
Defined in Crypto.Threefish | |
| Threefish Block512 Threefish512 Source # | |
Defined in Crypto.Threefish | |