HORIZON HASKELLDocslts/ghc-9.14.xb2f3bfd2026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · b2f3bfd · 2026-10-11

Modulecrypton-2.1.7Haskell2010

Crypto.Hash.Algorithms

Definitions of known hash algorithms

  • 46 types
  • 2 classes
  • Packagecrypton-2.1.7
  • Exports48
  • LanguageHaskell2010
  • LicenceBSD-3-Clause AND MIT AND ISC
  • SourceAlgorithms.hs
classclass HashAlgorithm a where
#

Class representing hashing algorithms.

The interface presented here is update in place and lowlevel. the Hash module takes care of hidding the mutable interface properly.

Instances46HashAlgorithm, …
classclass HashAlgorithm a => HashAlgorithmPrefix a where
#

Hashing algorithms with a constant-time implementation.

Instances6HashAlgorithmPrefix

Hash algorithms

46 declarations
datadata Blake2s_160
#

Blake2s (160 bits) cryptographic hash algorithm

Instances6Data, Show, HashAlgorithm, HashBlockSize, HashDigestSize, HashInternalContextSize
datadata Blake2s_224
#

Blake2s (224 bits) cryptographic hash algorithm

Instances6Data, Show, HashAlgorithm, HashBlockSize, HashDigestSize, HashInternalContextSize
datadata Blake2s_256
#

Blake2s (256 bits) cryptographic hash algorithm

Instances6Data, Show, HashAlgorithm, HashBlockSize, HashDigestSize, HashInternalContextSize
datadata Blake2sp_224
#

Blake2sp (224 bits) cryptographic hash algorithm

Instances6Data, Show, HashAlgorithm, HashBlockSize, HashDigestSize, HashInternalContextSize
datadata Blake2sp_256
#

Blake2sp (256 bits) cryptographic hash algorithm

Instances6Data, Show, HashAlgorithm, HashBlockSize, HashDigestSize, HashInternalContextSize
datadata Blake2b_160
#

Blake2b (160 bits) cryptographic hash algorithm

Instances6Data, Show, HashAlgorithm, HashBlockSize, HashDigestSize, HashInternalContextSize
datadata Blake2b_224
#

Blake2b (224 bits) cryptographic hash algorithm

Instances6Data, Show, HashAlgorithm, HashBlockSize, HashDigestSize, HashInternalContextSize
datadata Blake2b_256
#

Blake2b (256 bits) cryptographic hash algorithm

Instances6Data, Show, HashAlgorithm, HashBlockSize, HashDigestSize, HashInternalContextSize
datadata Blake2b_384
#

Blake2b (384 bits) cryptographic hash algorithm

Instances6Data, Show, HashAlgorithm, HashBlockSize, HashDigestSize, HashInternalContextSize
datadata Blake2b_512
#

Blake2b (512 bits) cryptographic hash algorithm

Instances6Data, Show, HashAlgorithm, HashBlockSize, HashDigestSize, HashInternalContextSize
datadata Blake2bp_512
#

Blake2bp (512 bits) cryptographic hash algorithm

Instances6Data, Show, HashAlgorithm, HashBlockSize, HashDigestSize, HashInternalContextSize
datadata MD2
#

MD2 cryptographic hash algorithm

Instances7Data, Show, HashAlgorithm, HashAlgorithmASN1, HashBlockSize, HashDigestSize, …
datadata MD4
#

MD4 cryptographic hash algorithm

Instances6Data, Show, HashAlgorithm, HashBlockSize, HashDigestSize, HashInternalContextSize
datadata MD5
#

MD5 cryptographic hash algorithm

Instances8Data, Show, HashAlgorithm, HashAlgorithmPrefix, HashAlgorithmASN1, HashBlockSize, …
datadata SHA1
#

SHA1 cryptographic hash algorithm

Instances8Data, Show, HashAlgorithm, HashAlgorithmPrefix, HashAlgorithmASN1, HashBlockSize, …
datadata SHA224
#

SHA224 cryptographic hash algorithm

Instances8Data, Show, HashAlgorithm, HashAlgorithmPrefix, HashAlgorithmASN1, HashBlockSize, …
datadata SHA256
#

SHA256 cryptographic hash algorithm

Instances8Data, Show, HashAlgorithm, HashAlgorithmPrefix, HashAlgorithmASN1, HashBlockSize, …
datadata SHA384
#

SHA384 cryptographic hash algorithm

Instances8Data, Show, HashAlgorithm, HashAlgorithmPrefix, HashAlgorithmASN1, HashBlockSize, …
datadata SHA512
#

SHA512 cryptographic hash algorithm

Instances8Data, Show, HashAlgorithm, HashAlgorithmPrefix, HashAlgorithmASN1, HashBlockSize, …
datadata SHA512t_224
#

SHA512t (224 bits) cryptographic hash algorithm

Instances7Data, Show, HashAlgorithm, HashAlgorithmASN1, HashBlockSize, HashDigestSize, …
datadata SHA512t_256
#

SHA512t (256 bits) cryptographic hash algorithm

Instances7Data, Show, HashAlgorithm, HashAlgorithmASN1, HashBlockSize, HashDigestSize, …
datadata RIPEMD160
#

RIPEMD160 cryptographic hash algorithm

Instances7Data, Show, HashAlgorithm, HashAlgorithmASN1, HashBlockSize, HashDigestSize, …
datadata Tiger
#

Tiger cryptographic hash algorithm

Instances6Data, Show, HashAlgorithm, HashBlockSize, HashDigestSize, HashInternalContextSize
datadata Keccak_224
#

Keccak (224 bits) cryptographic hash algorithm

Instances6Data, Show, HashAlgorithm, HashBlockSize, HashDigestSize, HashInternalContextSize
datadata Keccak_256
#

Keccak (256 bits) cryptographic hash algorithm

Instances6Data, Show, HashAlgorithm, HashBlockSize, HashDigestSize, HashInternalContextSize
datadata Keccak_384
#

Keccak (384 bits) cryptographic hash algorithm

Instances6Data, Show, HashAlgorithm, HashBlockSize, HashDigestSize, HashInternalContextSize
datadata Keccak_512
#

Keccak (512 bits) cryptographic hash algorithm

Instances6Data, Show, HashAlgorithm, HashBlockSize, HashDigestSize, HashInternalContextSize
datadata SHA3_224
#

SHA3 (224 bits) cryptographic hash algorithm

Instances7Data, Show, HashAlgorithm, HashAlgorithmASN1, HashBlockSize, HashDigestSize, …
datadata SHA3_256
#

SHA3 (256 bits) cryptographic hash algorithm

Instances7Data, Show, HashAlgorithm, HashAlgorithmASN1, HashBlockSize, HashDigestSize, …
datadata SHA3_384
#

SHA3 (384 bits) cryptographic hash algorithm

Instances7Data, Show, HashAlgorithm, HashAlgorithmASN1, HashBlockSize, HashDigestSize, …
datadata SHA3_512
#

SHA3 (512 bits) cryptographic hash algorithm

Instances7Data, Show, HashAlgorithm, HashAlgorithmASN1, HashBlockSize, HashDigestSize, …
datadata SHAKE128 (bitlen :: Nat)
#

SHAKE128 (128 bits) extendable output function. Supports an arbitrary digest size, to be specified as a type parameter of kind Nat.

Note: outputs from SHAKE128 n and SHAKE128 m for the same input are correlated (one being a prefix of the other). Results are unrelated to SHAKE256 results.

Instances7Data, Show, HashAlgorithm, HashSHAKE, HashBlockSize, HashDigestSize, …
datadata SHAKE256 (bitlen :: Nat)
#

SHAKE256 (256 bits) extendable output function. Supports an arbitrary digest size, to be specified as a type parameter of kind Nat.

Note: outputs from SHAKE256 n and SHAKE256 m for the same input are correlated (one being a prefix of the other). Results are unrelated to SHAKE128 results.

Instances7Data, Show, HashAlgorithm, HashSHAKE, HashBlockSize, HashDigestSize, …
datadata Blake2b (bitlen :: Nat)
#

Fast cryptographic hash.

It is especially known to target 64bits architectures.

Known supported digest sizes:

  • Blake2b 160

  • Blake2b 224

  • Blake2b 256

  • Blake2b 384

  • Blake2b 512

Instances7Data, Show, HashAlgorithm, HashBlake2, HashBlockSize, HashDigestSize, …
datadata Blake2bp (bitlen :: Nat)
#
Instances7Data, Show, HashAlgorithm, HashBlake2, HashBlockSize, HashDigestSize, …
datadata Blake2s (bitlen :: Nat)
#

Fast and secure alternative to SHA1 and HMAC-SHA1

It is espacially known to target 32bits architectures.

Known supported digest sizes:

  • Blake2s 160

  • Blake2s 224

  • Blake2s 256

Instances7Data, Show, HashAlgorithm, HashBlake2, HashBlockSize, HashDigestSize, …
datadata Blake2sp (bitlen :: Nat)
#
Instances7Data, Show, HashAlgorithm, HashBlake2, HashBlockSize, HashDigestSize, …
datadata Skein256 (bitlen :: Nat)
#

Skein256 with the digest size given as a type parameter of kind Nat, in bits. Skein256 256 is Skein256_256; the sizes with a type of their own above are there for their names, and this one also takes the sizes that have none.

A size that is not a whole number of bytes is rounded up to the next one, as the implementation underneath does.

The output is produced in counter mode, a block of it per Threefish call, so one large digest is a good deal cheaper than the same number of bytes taken from repeated small ones: on an Apple M4, 512 KiB arrives at 947 MB/s in one digest against 172 MB/s as 8192 separate Skein256_256 ones.

Note the digest size goes into the configuration block, so it changes the value the message is hashed from: a longer digest is not an extension of a shorter one. That is the opposite of how SHAKE128 behaves.

Instances6Data, Show, HashAlgorithm, HashBlockSize, HashDigestSize, HashInternalContextSize
datadata Skein256_224
#

Skein256 (224 bits) cryptographic hash algorithm

Instances6Data, Show, HashAlgorithm, HashBlockSize, HashDigestSize, HashInternalContextSize
datadata Skein256_256
#

Skein256 (256 bits) cryptographic hash algorithm

Instances6Data, Show, HashAlgorithm, HashBlockSize, HashDigestSize, HashInternalContextSize
datadata Skein512 (bitlen :: Nat)
#

Skein512 with the digest size given as a type parameter of kind Nat, in bits. Skein512 512 is Skein512_512; the sizes with a type of their own above are there for their names, and this one also takes the sizes that have none.

A size that is not a whole number of bytes is rounded up to the next one, as the implementation underneath does.

The output is produced in counter mode, a block of it per Threefish call, so one large digest is a good deal cheaper than the same number of bytes taken from repeated small ones: on an Apple M4, 512 KiB arrives at 947 MB/s in one digest against 172 MB/s as 8192 separate Skein512_512 ones.

Note the digest size goes into the configuration block, so it changes the value the message is hashed from: a longer digest is not an extension of a shorter one. That is the opposite of how SHAKE128 behaves.

Instances6Data, Show, HashAlgorithm, HashBlockSize, HashDigestSize, HashInternalContextSize
datadata Skein512_224
#

Skein512 (224 bits) cryptographic hash algorithm

Instances6Data, Show, HashAlgorithm, HashBlockSize, HashDigestSize, HashInternalContextSize
datadata Skein512_256
#

Skein512 (256 bits) cryptographic hash algorithm

Instances6Data, Show, HashAlgorithm, HashBlockSize, HashDigestSize, HashInternalContextSize
datadata Skein512_384
#

Skein512 (384 bits) cryptographic hash algorithm

Instances6Data, Show, HashAlgorithm, HashBlockSize, HashDigestSize, HashInternalContextSize
datadata Skein512_512
#

Skein512 (512 bits) cryptographic hash algorithm

Instances6Data, Show, HashAlgorithm, HashBlockSize, HashDigestSize, HashInternalContextSize
datadata Whirlpool
#

Whirlpool cryptographic hash algorithm

Instances6Data, Show, HashAlgorithm, HashBlockSize, HashDigestSize, HashInternalContextSize