botan-0.0.1.0: High-level Botan bindings
Copyright(c) Leo D 2023
LicenseBSD-3-Clause
Maintainerleo@apotheca.io
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Botan.Hash

Description

Hash functions are one-way functions, which map data of arbitrary size to a fixed output length. Most of the hash functions in Botan are designed to be cryptographically secure, which means that it is computationally infeasible to create a collision (finding two inputs with the same hash) or preimages (given a hash output, generating an arbitrary input with the same hash). But note that not all such hash functions meet their goals, in particular MD4 and MD5 are trivially broken. However they are still included due to their wide adoption in various protocols.

Using a hash function is typically split into three stages: initialization, update, and finalization (often referred to as a IUF interface). The initialization stage is implicit: after creating a hash function object, it is ready to process data. Then update is called one or more times. Calling update several times is equivalent to calling it once with all of the arguments concatenated. After completing a hash computation (eg using hashFinal), the internal state is reset to begin hashing a new message.

Synopsis

Hashes

 

Usage

 

Idiomatic interface

Data type

newtype CryptoHash Source #

Constructors

MkCryptoHash 

Fields

Instances

Instances details
Show CryptoHash Source # 
Instance details

Defined in Botan.Hash

Eq CryptoHash Source # 
Instance details

Defined in Botan.Hash

Ord CryptoHash Source # 
Instance details

Defined in Botan.Hash

newtype Checksum Source #

Constructors

MkChecksum 

Fields

Instances

Instances details
Show Checksum Source # 
Instance details

Defined in Botan.Hash

Eq Checksum Source # 
Instance details

Defined in Botan.Hash

Ord Checksum Source # 
Instance details

Defined in Botan.Hash

Enumerations

Associated types

Accessors

hashName :: Hash -> HashName Source #

hashBlockSize :: Hash -> Int Source #

Warning: Unimplemented for: Adler32, CRC24, CRC32

Idiomatic algorithm

Mutable interface

Tagged mutable context

data MutableHash Source #

Constructors

MkMutableHash 

Fields

Destructor

Initializers

Accessors

getHashName :: MonadIO m => MutableHash -> m HashName Source #

Accessory functions

Mutable algorithm