cryptohash-0.11.0: collection of crypto hashes, fast, pure and practical

LicenseBSD-style
MaintainerVincent Hanquez <vincent@snarc.org>
Stabilityexperimental
Portabilityunknown
Safe HaskellTrustworthy
LanguageHaskell98

Crypto.Hash.Types

Contents

Description

Crypto hash types definitions

Synopsis

Documentation

class HashAlgorithm a where #

Class representing hashing algorithms.

The hash algorithm is built over 3 primitives:

init : create a new context updates : update the context with some strict bytestrings finalize : finalize the context into a digest

Methods

hashBlockSize :: Context a -> Int #

Block size in bytes the hash algorithm operates on

hashInit :: Context a #

Initialize a new context for this hash algorithm

hashUpdates :: Context a -> [ByteString] -> Context a #

Update the context with a list of strict bytestring, and return a new context with the updates.

hashFinalize :: Context a -> Digest a #

Finalize a context and return a digest.

digestFromByteString :: ByteString -> Maybe (Digest a) #

Try to convert a binary digest bytestring to a digest.

Instances
HashAlgorithm Skein512_512 # 
Instance details

Defined in Crypto.Hash

HashAlgorithm Skein512_384 # 
Instance details

Defined in Crypto.Hash

HashAlgorithm Skein512_256 # 
Instance details

Defined in Crypto.Hash

HashAlgorithm Skein512_224 # 
Instance details

Defined in Crypto.Hash

HashAlgorithm Skein256_256 # 
Instance details

Defined in Crypto.Hash

HashAlgorithm Skein256_224 # 
Instance details

Defined in Crypto.Hash

HashAlgorithm SHA3_512 # 
Instance details

Defined in Crypto.Hash

HashAlgorithm SHA3_384 # 
Instance details

Defined in Crypto.Hash

HashAlgorithm SHA3_256 # 
Instance details

Defined in Crypto.Hash

HashAlgorithm SHA3_224 # 
Instance details

Defined in Crypto.Hash

HashAlgorithm Tiger # 
Instance details

Defined in Crypto.Hash

HashAlgorithm Whirlpool # 
Instance details

Defined in Crypto.Hash

HashAlgorithm RIPEMD160 # 
Instance details

Defined in Crypto.Hash

HashAlgorithm SHA512 # 
Instance details

Defined in Crypto.Hash

HashAlgorithm SHA384 # 
Instance details

Defined in Crypto.Hash

HashAlgorithm SHA256 # 
Instance details

Defined in Crypto.Hash

HashAlgorithm SHA224 # 
Instance details

Defined in Crypto.Hash

HashAlgorithm SHA1 # 
Instance details

Defined in Crypto.Hash

HashAlgorithm MD5 # 
Instance details

Defined in Crypto.Hash

HashAlgorithm MD4 # 
Instance details

Defined in Crypto.Hash

HashAlgorithm MD2 # 
Instance details

Defined in Crypto.Hash

newtype Context a #

Represent a context for a given hash algorithm.

Constructors

Context ByteString 
Instances
Byteable (Context a) # 
Instance details

Defined in Crypto.Hash.Types

Methods

toBytes :: Context a -> ByteString #

byteableLength :: Context a -> Int #

withBytePtr :: Context a -> (Ptr Word8 -> IO b) -> IO b #

newtype Digest a #

Represent a digest for a given hash algorithm.

Constructors

Digest ByteString 
Instances
Eq (Digest a) # 
Instance details

Defined in Crypto.Hash.Types

Methods

(==) :: Digest a -> Digest a -> Bool #

(/=) :: Digest a -> Digest a -> Bool #

Ord (Digest a) # 
Instance details

Defined in Crypto.Hash.Types

Methods

compare :: Digest a -> Digest a -> Ordering #

(<) :: Digest a -> Digest a -> Bool #

(<=) :: Digest a -> Digest a -> Bool #

(>) :: Digest a -> Digest a -> Bool #

(>=) :: Digest a -> Digest a -> Bool #

max :: Digest a -> Digest a -> Digest a #

min :: Digest a -> Digest a -> Digest a #

Show (Digest a) # 
Instance details

Defined in Crypto.Hash.Types

Methods

showsPrec :: Int -> Digest a -> ShowS #

show :: Digest a -> String #

showList :: [Digest a] -> ShowS #

Byteable (Digest a) # 
Instance details

Defined in Crypto.Hash.Types

Methods

toBytes :: Digest a -> ByteString #

byteableLength :: Digest a -> Int #

withBytePtr :: Digest a -> (Ptr Word8 -> IO b) -> IO b #

deprecated

contextToByteString :: Context a -> ByteString #

return the binary bytestring. deprecated use toBytes.

digestToByteString :: Digest a -> ByteString #

Deprecated: use toBytes from byteable:Data.Byteable

return the binary bytestring. deprecated use toBytes.