License | BSD-style |
---|---|
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Stability | experimental |
Portability | unknown |
Safe Haskell | Trustworthy |
Language | Haskell98 |
Crypto.Hash
Description
Generalized cryptographic hash interface, that you can use with cryptographic hash algorithm that belong to the HashAlgorithm type class.
import Crypto.Hash sha1 :: ByteString -> Digest SHA1 sha1 = hash hexSha3_512 :: ByteString -> String hexSha3_512 bs = show (hash bs :: Digest SHA3_512)
Synopsis
- class HashAlgorithm a where
- hashBlockSize :: Context a -> Int
- hashInit :: Context a
- hashUpdates :: Context a -> [ByteString] -> Context a
- hashFinalize :: Context a -> Digest a
- digestFromByteString :: ByteString -> Maybe (Digest a)
- type HashFunctionBS a = ByteString -> Digest a
- type HashFunctionLBS a = ByteString -> Digest a
- data Context a
- data Digest a
- digestToByteString :: Digest a -> ByteString
- digestToHexByteString :: Digest a -> ByteString
- hash :: HashAlgorithm a => ByteString -> Digest a
- hashlazy :: HashAlgorithm a => ByteString -> Digest a
- hashUpdate :: HashAlgorithm a => Context a -> ByteString -> Context a
- hashInitAlg :: HashAlgorithm alg => alg -> Context alg
- data MD2 = MD2
- data MD4 = MD4
- data MD5 = MD5
- data SHA1 = SHA1
- data SHA224 = SHA224
- data SHA256 = SHA256
- data SHA384 = SHA384
- data SHA512 = SHA512
- data RIPEMD160 = RIPEMD160
- data Tiger = Tiger
- data SHA3_224 = SHA3_224
- data SHA3_256 = SHA3_256
- data SHA3_384 = SHA3_384
- data SHA3_512 = SHA3_512
- data Skein256_224 = Skein256_224
- data Skein256_256 = Skein256_256
- data Skein512_224 = Skein512_224
- data Skein512_256 = Skein512_256
- data Skein512_384 = Skein512_384
- data Skein512_512 = Skein512_512
- data Whirlpool = Whirlpool
- newtype HMAC a = HMAC {
- hmacGetDigest :: Digest a
- hmac :: HashAlgorithm a => ByteString -> ByteString -> HMAC a
- hmacAlg :: HashAlgorithm a => a -> ByteString -> ByteString -> HMAC a
Types
class HashAlgorithm a where Source #
Class representing hashing algorithms.
The hash algorithm is built over 3 primitives:
- init : create a new hashing context
- updates : update the hashing context with some strict bytestrings and return the new context
- finalize : finalize the context into a digest
Methods
hashBlockSize :: Context a -> Int Source #
Block size in bytes the hash algorithm operates on
hashInit :: Context a Source #
Initialize a new context for this hash algorithm
hashUpdates :: Context a -> [ByteString] -> Context a Source #
Update the context with a list of strict bytestring, and return a new context with the updates.
hashFinalize :: Context a -> Digest a Source #
Finalize a context and return a digest.
digestFromByteString :: ByteString -> Maybe (Digest a) Source #
Try to convert a binary digest bytestring to a digest.
Instances
type HashFunctionBS a = ByteString -> Digest a Source #
Alias to a single pass hash function that operate on a strict bytestring
type HashFunctionLBS a = ByteString -> Digest a Source #
Alias to a single pass hash function that operate on a lazy bytestring
Represent a context for a given hash algorithm.
Instances
Byteable (Context a) Source # | |
Defined in Crypto.Hash.Types |
Represent a digest for a given hash algorithm.
Instances
Show (Digest a) Source # | |
Byteable (Digest a) Source # | |
Defined in Crypto.Hash.Types | |
Eq (Digest a) Source # | |
Ord (Digest a) Source # | |
Defined in Crypto.Hash.Types |
Functions
digestToByteString :: Digest a -> ByteString Source #
Deprecated: use toBytes from byteable:Data.Byteable
return the binary bytestring. deprecated use toBytes.
digestToHexByteString :: Digest a -> ByteString Source #
Return the hexadecimal (base16) bytestring of the digest
hash :: HashAlgorithm a => ByteString -> Digest a Source #
Hash a strict bytestring into a digest.
hashlazy :: HashAlgorithm a => ByteString -> Digest a Source #
Hash a lazy bytestring into a digest.
hashUpdate :: HashAlgorithm a => Context a -> ByteString -> Context a Source #
run hashUpdates on one single bytestring and return the updated context.
hashInitAlg :: HashAlgorithm alg => alg -> Context alg Source #
Initialize a new context for a specified hash algorithm
hash algorithms
Constructors
MD2 |
Instances
Data MD2 | |
Defined in Crypto.Hash.MD2 Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MD2 -> c MD2 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c MD2 Source # toConstr :: MD2 -> Constr Source # dataTypeOf :: MD2 -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c MD2) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MD2) Source # gmapT :: (forall b. Data b => b -> b) -> MD2 -> MD2 Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MD2 -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MD2 -> r Source # gmapQ :: (forall d. Data d => d -> u) -> MD2 -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> MD2 -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> MD2 -> m MD2 Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MD2 -> m MD2 Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MD2 -> m MD2 Source # | |
Show MD2 | |
HashAlgorithm MD2 Source # | MD2 cryptographic hash |
Defined in Crypto.Hash | |
HashAlgorithm MD2 | |
Defined in Crypto.Hash.MD2 Methods hashBlockSize :: MD2 -> Int hashDigestSize :: MD2 -> Int hashInternalContextSize :: MD2 -> Int hashInternalInit :: Ptr (Context MD2) -> IO () hashInternalUpdate :: Ptr (Context MD2) -> Ptr Word8 -> Word32 -> IO () hashInternalFinalize :: Ptr (Context MD2) -> Ptr (Digest MD2) -> IO () | |
type HashBlockSize MD2 | |
Defined in Crypto.Hash.MD2 type HashBlockSize MD2 = 16 | |
type HashDigestSize MD2 | |
Defined in Crypto.Hash.MD2 type HashDigestSize MD2 = 16 | |
type HashInternalContextSize MD2 | |
Defined in Crypto.Hash.MD2 type HashInternalContextSize MD2 = 96 |
Constructors
MD4 |
Instances
Data MD4 | |
Defined in Crypto.Hash.MD4 Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MD4 -> c MD4 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c MD4 Source # toConstr :: MD4 -> Constr Source # dataTypeOf :: MD4 -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c MD4) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MD4) Source # gmapT :: (forall b. Data b => b -> b) -> MD4 -> MD4 Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MD4 -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MD4 -> r Source # gmapQ :: (forall d. Data d => d -> u) -> MD4 -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> MD4 -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> MD4 -> m MD4 Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MD4 -> m MD4 Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MD4 -> m MD4 Source # | |
Show MD4 | |
HashAlgorithm MD4 Source # | MD4 cryptographic hash |
Defined in Crypto.Hash | |
HashAlgorithm MD4 | |
Defined in Crypto.Hash.MD4 Methods hashBlockSize :: MD4 -> Int hashDigestSize :: MD4 -> Int hashInternalContextSize :: MD4 -> Int hashInternalInit :: Ptr (Context MD4) -> IO () hashInternalUpdate :: Ptr (Context MD4) -> Ptr Word8 -> Word32 -> IO () hashInternalFinalize :: Ptr (Context MD4) -> Ptr (Digest MD4) -> IO () | |
type HashBlockSize MD4 | |
Defined in Crypto.Hash.MD4 type HashBlockSize MD4 = 64 | |
type HashDigestSize MD4 | |
Defined in Crypto.Hash.MD4 type HashDigestSize MD4 = 16 | |
type HashInternalContextSize MD4 | |
Defined in Crypto.Hash.MD4 type HashInternalContextSize MD4 = 96 |
Constructors
MD5 |
Instances
Data MD5 | |
Defined in Crypto.Hash.MD5 Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MD5 -> c MD5 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c MD5 Source # toConstr :: MD5 -> Constr Source # dataTypeOf :: MD5 -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c MD5) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MD5) Source # gmapT :: (forall b. Data b => b -> b) -> MD5 -> MD5 Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MD5 -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MD5 -> r Source # gmapQ :: (forall d. Data d => d -> u) -> MD5 -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> MD5 -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> MD5 -> m MD5 Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MD5 -> m MD5 Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MD5 -> m MD5 Source # | |
Show MD5 | |
HashAlgorithm MD5 Source # | MD5 cryptographic hash |
Defined in Crypto.Hash | |
HashAlgorithm MD5 | |
Defined in Crypto.Hash.MD5 Methods hashBlockSize :: MD5 -> Int hashDigestSize :: MD5 -> Int hashInternalContextSize :: MD5 -> Int hashInternalInit :: Ptr (Context MD5) -> IO () hashInternalUpdate :: Ptr (Context MD5) -> Ptr Word8 -> Word32 -> IO () hashInternalFinalize :: Ptr (Context MD5) -> Ptr (Digest MD5) -> IO () | |
HashAlgorithmPrefix MD5 | |
type HashBlockSize MD5 | |
Defined in Crypto.Hash.MD5 type HashBlockSize MD5 = 64 | |
type HashDigestSize MD5 | |
Defined in Crypto.Hash.MD5 type HashDigestSize MD5 = 16 | |
type HashInternalContextSize MD5 | |
Defined in Crypto.Hash.MD5 type HashInternalContextSize MD5 = 96 |
Constructors
SHA1 |
Instances
Data SHA1 | |
Defined in Crypto.Hash.SHA1 Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SHA1 -> c SHA1 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SHA1 Source # toConstr :: SHA1 -> Constr Source # dataTypeOf :: SHA1 -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SHA1) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SHA1) Source # gmapT :: (forall b. Data b => b -> b) -> SHA1 -> SHA1 Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SHA1 -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SHA1 -> r Source # gmapQ :: (forall d. Data d => d -> u) -> SHA1 -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> SHA1 -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SHA1 -> m SHA1 Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SHA1 -> m SHA1 Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SHA1 -> m SHA1 Source # | |
Show SHA1 | |
HashAlgorithm SHA1 Source # | SHA1 cryptographic hash |
Defined in Crypto.Hash | |
HashAlgorithm SHA1 | |
Defined in Crypto.Hash.SHA1 Methods hashBlockSize :: SHA1 -> Int hashDigestSize :: SHA1 -> Int hashInternalContextSize :: SHA1 -> Int hashInternalInit :: Ptr (Context SHA1) -> IO () hashInternalUpdate :: Ptr (Context SHA1) -> Ptr Word8 -> Word32 -> IO () hashInternalFinalize :: Ptr (Context SHA1) -> Ptr (Digest SHA1) -> IO () | |
HashAlgorithmPrefix SHA1 | |
type HashBlockSize SHA1 | |
Defined in Crypto.Hash.SHA1 type HashBlockSize SHA1 = 64 | |
type HashDigestSize SHA1 | |
Defined in Crypto.Hash.SHA1 type HashDigestSize SHA1 = 20 | |
type HashInternalContextSize SHA1 | |
Defined in Crypto.Hash.SHA1 type HashInternalContextSize SHA1 = 96 |
Constructors
SHA224 |
Instances
Data SHA224 | |
Defined in Crypto.Hash.SHA224 Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SHA224 -> c SHA224 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SHA224 Source # toConstr :: SHA224 -> Constr Source # dataTypeOf :: SHA224 -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SHA224) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SHA224) Source # gmapT :: (forall b. Data b => b -> b) -> SHA224 -> SHA224 Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SHA224 -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SHA224 -> r Source # gmapQ :: (forall d. Data d => d -> u) -> SHA224 -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> SHA224 -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SHA224 -> m SHA224 Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SHA224 -> m SHA224 Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SHA224 -> m SHA224 Source # | |
Show SHA224 | |
HashAlgorithm SHA224 Source # | SHA224 cryptographic hash |
Defined in Crypto.Hash | |
HashAlgorithm SHA224 | |
Defined in Crypto.Hash.SHA224 Methods hashBlockSize :: SHA224 -> Int hashDigestSize :: SHA224 -> Int hashInternalContextSize :: SHA224 -> Int hashInternalInit :: Ptr (Context SHA224) -> IO () hashInternalUpdate :: Ptr (Context SHA224) -> Ptr Word8 -> Word32 -> IO () hashInternalFinalize :: Ptr (Context SHA224) -> Ptr (Digest SHA224) -> IO () | |
HashAlgorithmPrefix SHA224 | |
type HashBlockSize SHA224 | |
Defined in Crypto.Hash.SHA224 type HashBlockSize SHA224 = 64 | |
type HashDigestSize SHA224 | |
Defined in Crypto.Hash.SHA224 type HashDigestSize SHA224 = 28 | |
type HashInternalContextSize SHA224 | |
Defined in Crypto.Hash.SHA224 type HashInternalContextSize SHA224 = 192 |
Constructors
SHA256 |
Instances
Data SHA256 | |
Defined in Crypto.Hash.SHA256 Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SHA256 -> c SHA256 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SHA256 Source # toConstr :: SHA256 -> Constr Source # dataTypeOf :: SHA256 -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SHA256) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SHA256) Source # gmapT :: (forall b. Data b => b -> b) -> SHA256 -> SHA256 Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SHA256 -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SHA256 -> r Source # gmapQ :: (forall d. Data d => d -> u) -> SHA256 -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> SHA256 -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SHA256 -> m SHA256 Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SHA256 -> m SHA256 Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SHA256 -> m SHA256 Source # | |
Show SHA256 | |
HashAlgorithm SHA256 Source # | SHA256 cryptographic hash |
Defined in Crypto.Hash | |
HashAlgorithm SHA256 | |
Defined in Crypto.Hash.SHA256 Methods hashBlockSize :: SHA256 -> Int hashDigestSize :: SHA256 -> Int hashInternalContextSize :: SHA256 -> Int hashInternalInit :: Ptr (Context SHA256) -> IO () hashInternalUpdate :: Ptr (Context SHA256) -> Ptr Word8 -> Word32 -> IO () hashInternalFinalize :: Ptr (Context SHA256) -> Ptr (Digest SHA256) -> IO () | |
HashAlgorithmPrefix SHA256 | |
type HashBlockSize SHA256 | |
Defined in Crypto.Hash.SHA256 type HashBlockSize SHA256 = 64 | |
type HashDigestSize SHA256 | |
Defined in Crypto.Hash.SHA256 type HashDigestSize SHA256 = 32 | |
type HashInternalContextSize SHA256 | |
Defined in Crypto.Hash.SHA256 type HashInternalContextSize SHA256 = 192 |
Constructors
SHA384 |
Instances
Data SHA384 | |
Defined in Crypto.Hash.SHA384 Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SHA384 -> c SHA384 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SHA384 Source # toConstr :: SHA384 -> Constr Source # dataTypeOf :: SHA384 -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SHA384) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SHA384) Source # gmapT :: (forall b. Data b => b -> b) -> SHA384 -> SHA384 Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SHA384 -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SHA384 -> r Source # gmapQ :: (forall d. Data d => d -> u) -> SHA384 -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> SHA384 -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SHA384 -> m SHA384 Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SHA384 -> m SHA384 Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SHA384 -> m SHA384 Source # | |
Show SHA384 | |
HashAlgorithm SHA384 Source # | SHA384 cryptographic hash |
Defined in Crypto.Hash | |
HashAlgorithm SHA384 | |
Defined in Crypto.Hash.SHA384 Methods hashBlockSize :: SHA384 -> Int hashDigestSize :: SHA384 -> Int hashInternalContextSize :: SHA384 -> Int hashInternalInit :: Ptr (Context SHA384) -> IO () hashInternalUpdate :: Ptr (Context SHA384) -> Ptr Word8 -> Word32 -> IO () hashInternalFinalize :: Ptr (Context SHA384) -> Ptr (Digest SHA384) -> IO () | |
HashAlgorithmPrefix SHA384 | |
type HashBlockSize SHA384 | |
Defined in Crypto.Hash.SHA384 type HashBlockSize SHA384 = 128 | |
type HashDigestSize SHA384 | |
Defined in Crypto.Hash.SHA384 type HashDigestSize SHA384 = 48 | |
type HashInternalContextSize SHA384 | |
Defined in Crypto.Hash.SHA384 type HashInternalContextSize SHA384 = 256 |
Constructors
SHA512 |
Instances
Data SHA512 | |
Defined in Crypto.Hash.SHA512 Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SHA512 -> c SHA512 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SHA512 Source # toConstr :: SHA512 -> Constr Source # dataTypeOf :: SHA512 -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SHA512) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SHA512) Source # gmapT :: (forall b. Data b => b -> b) -> SHA512 -> SHA512 Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SHA512 -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SHA512 -> r Source # gmapQ :: (forall d. Data d => d -> u) -> SHA512 -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> SHA512 -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SHA512 -> m SHA512 Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SHA512 -> m SHA512 Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SHA512 -> m SHA512 Source # | |
Show SHA512 | |
HashAlgorithm SHA512 Source # | SHA512 cryptographic hash |
Defined in Crypto.Hash | |
HashAlgorithm SHA512 | |
Defined in Crypto.Hash.SHA512 Methods hashBlockSize :: SHA512 -> Int hashDigestSize :: SHA512 -> Int hashInternalContextSize :: SHA512 -> Int hashInternalInit :: Ptr (Context SHA512) -> IO () hashInternalUpdate :: Ptr (Context SHA512) -> Ptr Word8 -> Word32 -> IO () hashInternalFinalize :: Ptr (Context SHA512) -> Ptr (Digest SHA512) -> IO () | |
HashAlgorithmPrefix SHA512 | |
type HashBlockSize SHA512 | |
Defined in Crypto.Hash.SHA512 type HashBlockSize SHA512 = 128 | |
type HashDigestSize SHA512 | |
Defined in Crypto.Hash.SHA512 type HashDigestSize SHA512 = 64 | |
type HashInternalContextSize SHA512 | |
Defined in Crypto.Hash.SHA512 type HashInternalContextSize SHA512 = 256 |
Constructors
RIPEMD160 |
Instances
Constructors
Tiger |
Instances
Data Tiger | |
Defined in Crypto.Hash.Tiger Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Tiger -> c Tiger Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Tiger Source # toConstr :: Tiger -> Constr Source # dataTypeOf :: Tiger -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Tiger) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Tiger) Source # gmapT :: (forall b. Data b => b -> b) -> Tiger -> Tiger Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Tiger -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Tiger -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Tiger -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Tiger -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Tiger -> m Tiger Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Tiger -> m Tiger Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Tiger -> m Tiger Source # | |
Show Tiger | |
HashAlgorithm Tiger Source # | Tiger cryptographic hash |
Defined in Crypto.Hash | |
HashAlgorithm Tiger | |
Defined in Crypto.Hash.Tiger Methods hashBlockSize :: Tiger -> Int hashDigestSize :: Tiger -> Int hashInternalContextSize :: Tiger -> Int hashInternalInit :: Ptr (Context Tiger) -> IO () hashInternalUpdate :: Ptr (Context Tiger) -> Ptr Word8 -> Word32 -> IO () hashInternalFinalize :: Ptr (Context Tiger) -> Ptr (Digest Tiger) -> IO () | |
type HashBlockSize Tiger | |
Defined in Crypto.Hash.Tiger type HashBlockSize Tiger = 64 | |
type HashDigestSize Tiger | |
Defined in Crypto.Hash.Tiger type HashDigestSize Tiger = 24 | |
type HashInternalContextSize Tiger | |
Defined in Crypto.Hash.Tiger type HashInternalContextSize Tiger = 96 |
Constructors
SHA3_224 |
Instances
Data SHA3_224 | |
Defined in Crypto.Hash.SHA3 Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SHA3_224 -> c SHA3_224 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SHA3_224 Source # toConstr :: SHA3_224 -> Constr Source # dataTypeOf :: SHA3_224 -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SHA3_224) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SHA3_224) Source # gmapT :: (forall b. Data b => b -> b) -> SHA3_224 -> SHA3_224 Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SHA3_224 -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SHA3_224 -> r Source # gmapQ :: (forall d. Data d => d -> u) -> SHA3_224 -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> SHA3_224 -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SHA3_224 -> m SHA3_224 Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SHA3_224 -> m SHA3_224 Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SHA3_224 -> m SHA3_224 Source # | |
Show SHA3_224 | |
HashAlgorithm SHA3_224 Source # | SHA3 (224 bits version) cryptographic hash |
Defined in Crypto.Hash | |
HashAlgorithm SHA3_224 | |
Defined in Crypto.Hash.SHA3 Methods hashBlockSize :: SHA3_224 -> Int hashDigestSize :: SHA3_224 -> Int hashInternalContextSize :: SHA3_224 -> Int hashInternalInit :: Ptr (Context SHA3_224) -> IO () hashInternalUpdate :: Ptr (Context SHA3_224) -> Ptr Word8 -> Word32 -> IO () hashInternalFinalize :: Ptr (Context SHA3_224) -> Ptr (Digest SHA3_224) -> IO () | |
type HashBlockSize SHA3_224 | |
Defined in Crypto.Hash.SHA3 type HashBlockSize SHA3_224 = 144 | |
type HashDigestSize SHA3_224 | |
Defined in Crypto.Hash.SHA3 type HashDigestSize SHA3_224 = 28 | |
type HashInternalContextSize SHA3_224 | |
Defined in Crypto.Hash.SHA3 type HashInternalContextSize SHA3_224 = 352 |
Constructors
SHA3_256 |
Instances
Data SHA3_256 | |
Defined in Crypto.Hash.SHA3 Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SHA3_256 -> c SHA3_256 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SHA3_256 Source # toConstr :: SHA3_256 -> Constr Source # dataTypeOf :: SHA3_256 -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SHA3_256) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SHA3_256) Source # gmapT :: (forall b. Data b => b -> b) -> SHA3_256 -> SHA3_256 Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SHA3_256 -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SHA3_256 -> r Source # gmapQ :: (forall d. Data d => d -> u) -> SHA3_256 -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> SHA3_256 -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SHA3_256 -> m SHA3_256 Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SHA3_256 -> m SHA3_256 Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SHA3_256 -> m SHA3_256 Source # | |
Show SHA3_256 | |
HashAlgorithm SHA3_256 Source # | SHA3 (256 bits version) cryptographic hash |
Defined in Crypto.Hash | |
HashAlgorithm SHA3_256 | |
Defined in Crypto.Hash.SHA3 Methods hashBlockSize :: SHA3_256 -> Int hashDigestSize :: SHA3_256 -> Int hashInternalContextSize :: SHA3_256 -> Int hashInternalInit :: Ptr (Context SHA3_256) -> IO () hashInternalUpdate :: Ptr (Context SHA3_256) -> Ptr Word8 -> Word32 -> IO () hashInternalFinalize :: Ptr (Context SHA3_256) -> Ptr (Digest SHA3_256) -> IO () | |
type HashBlockSize SHA3_256 | |
Defined in Crypto.Hash.SHA3 type HashBlockSize SHA3_256 = 136 | |
type HashDigestSize SHA3_256 | |
Defined in Crypto.Hash.SHA3 type HashDigestSize SHA3_256 = 32 | |
type HashInternalContextSize SHA3_256 | |
Defined in Crypto.Hash.SHA3 type HashInternalContextSize SHA3_256 = 344 |
Constructors
SHA3_384 |
Instances
Data SHA3_384 | |
Defined in Crypto.Hash.SHA3 Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SHA3_384 -> c SHA3_384 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SHA3_384 Source # toConstr :: SHA3_384 -> Constr Source # dataTypeOf :: SHA3_384 -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SHA3_384) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SHA3_384) Source # gmapT :: (forall b. Data b => b -> b) -> SHA3_384 -> SHA3_384 Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SHA3_384 -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SHA3_384 -> r Source # gmapQ :: (forall d. Data d => d -> u) -> SHA3_384 -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> SHA3_384 -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SHA3_384 -> m SHA3_384 Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SHA3_384 -> m SHA3_384 Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SHA3_384 -> m SHA3_384 Source # | |
Show SHA3_384 | |
HashAlgorithm SHA3_384 Source # | SHA3 (384 bits version) cryptographic hash |
Defined in Crypto.Hash | |
HashAlgorithm SHA3_384 | |
Defined in Crypto.Hash.SHA3 Methods hashBlockSize :: SHA3_384 -> Int hashDigestSize :: SHA3_384 -> Int hashInternalContextSize :: SHA3_384 -> Int hashInternalInit :: Ptr (Context SHA3_384) -> IO () hashInternalUpdate :: Ptr (Context SHA3_384) -> Ptr Word8 -> Word32 -> IO () hashInternalFinalize :: Ptr (Context SHA3_384) -> Ptr (Digest SHA3_384) -> IO () | |
type HashBlockSize SHA3_384 | |
Defined in Crypto.Hash.SHA3 type HashBlockSize SHA3_384 = 104 | |
type HashDigestSize SHA3_384 | |
Defined in Crypto.Hash.SHA3 type HashDigestSize SHA3_384 = 48 | |
type HashInternalContextSize SHA3_384 | |
Defined in Crypto.Hash.SHA3 type HashInternalContextSize SHA3_384 = 312 |
Constructors
SHA3_512 |
Instances
Data SHA3_512 | |
Defined in Crypto.Hash.SHA3 Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SHA3_512 -> c SHA3_512 Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SHA3_512 Source # toConstr :: SHA3_512 -> Constr Source # dataTypeOf :: SHA3_512 -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SHA3_512) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SHA3_512) Source # gmapT :: (forall b. Data b => b -> b) -> SHA3_512 -> SHA3_512 Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SHA3_512 -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SHA3_512 -> r Source # gmapQ :: (forall d. Data d => d -> u) -> SHA3_512 -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> SHA3_512 -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SHA3_512 -> m SHA3_512 Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SHA3_512 -> m SHA3_512 Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SHA3_512 -> m SHA3_512 Source # | |
Show SHA3_512 | |
HashAlgorithm SHA3_512 Source # | SHA3 (512 bits version) cryptographic hash |
Defined in Crypto.Hash | |
HashAlgorithm SHA3_512 | |
Defined in Crypto.Hash.SHA3 Methods hashBlockSize :: SHA3_512 -> Int hashDigestSize :: SHA3_512 -> Int hashInternalContextSize :: SHA3_512 -> Int hashInternalInit :: Ptr (Context SHA3_512) -> IO () hashInternalUpdate :: Ptr (Context SHA3_512) -> Ptr Word8 -> Word32 -> IO () hashInternalFinalize :: Ptr (Context SHA3_512) -> Ptr (Digest SHA3_512) -> IO () | |
type HashBlockSize SHA3_512 | |
Defined in Crypto.Hash.SHA3 type HashBlockSize SHA3_512 = 72 | |
type HashDigestSize SHA3_512 | |
Defined in Crypto.Hash.SHA3 type HashDigestSize SHA3_512 = 64 | |
type HashInternalContextSize SHA3_512 | |
Defined in Crypto.Hash.SHA3 type HashInternalContextSize SHA3_512 = 280 |
data Skein256_224 #
Constructors
Skein256_224 |
Instances
data Skein256_256 #
Constructors
Skein256_256 |
Instances
data Skein512_224 #
Constructors
Skein512_224 |
Instances
data Skein512_256 #
Constructors
Skein512_256 |
Instances
data Skein512_384 #
Constructors
Skein512_384 |
Instances
data Skein512_512 #
Constructors
Skein512_512 |
Instances
Constructors
Whirlpool |
Instances
MAC algorithms
Represent an HMAC that is a phantom type with the hash used to produce the mac.
The Eq instance is constant time.
Constructors
HMAC | |
Fields
|
Instances
Byteable (HMAC a) Source # | |
Defined in Crypto.Hash | |
Eq (HMAC a) Source # | |
Arguments
:: HashAlgorithm a | |
=> ByteString | Secret key |
-> ByteString | Message to MAC |
-> HMAC a |
compute a MAC using the supplied hashing function
Arguments
:: HashAlgorithm a | |
=> a | the hash algorithm the actual value is unused. |
-> ByteString | Secret key |
-> ByteString | Message to MAC |
-> HMAC a |
compute a HMAC using a specified algorithm