HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulecryptonite-0.30Haskell2010

Crypto.KDF.Argon2

Argon2 hashing function (P-H-C winner)

Recommended to use this module qualified

File started from Argon2.hs, from Oliver Charles at https://github.com/ocharles/argon2

  • 6 types
  • 2 values
  • Packagecryptonite-0.30
  • Exports8
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceArgon2.hs
datadata Options
#

Parameters that can be adjusted to change the runtime performance of the hashing.

Constructors

Instances4Eq, Ord, Read, Show
  • Eq OptionsDefined in cryptonite-0.30 · Crypto.KDF.Argon2
  • Ord OptionsDefined in cryptonite-0.30 · Crypto.KDF.Argon2
  • Read OptionsDefined in cryptonite-0.30 · Crypto.KDF.Argon2
  • Show OptionsDefined in cryptonite-0.30 · Crypto.KDF.Argon2
typetype TimeCost = Word32
#

The time cost, which defines the amount of computation realized and therefore the execution time, given in number of iterations.

FFI.ARGON2_MIN_TIME <= hashIterations <= FFI.ARGON2_MAX_TIME

typetype MemoryCost = Word32
#

The memory cost, which defines the memory usage, given in kibibytes.

max FFI.ARGON2_MIN_MEMORY (8 * hashParallelism) <= hashMemory <= FFI.ARGON2_MAX_MEMORY

typetype Parallelism = Word32
#

A parallelism degree, which defines the number of parallel threads.

FFI.ARGON2_MIN_LANES <= hashParallelism <= FFI.ARGON2_MAX_LANES && FFI.ARGON_MIN_THREADS <= hashParallelism <= FFI.ARGON2_MAX_THREADS

datadata Variant
#

Which variant of Argon2 to use. You should choose the variant that is most applicable to your intention to hash inputs.

Constructors

  • Argon2d

    Argon2d is faster than Argon2i and uses data-depending memory access, which makes it suitable for cryptocurrencies and applications with no threats from side-channel timing attacks.

  • Argon2i

    Argon2i uses data-independent memory access, which is preferred for password hashing and password-based key derivation. Argon2i is slower as it makes more passes over the memory to protect from tradeoff attacks.

  • Argon2id

    Argon2id is a hybrid of Argon2i and Argon2d, using a combination of data-depending and data-independent memory accesses, which gives some of Argon2i's resistance to side-channel cache timing attacks and much of Argon2d's resistance to GPU cracking attacks

Instances6Bounded, Enum, Eq, Ord, Read, Show
  • Bounded VariantDefined in cryptonite-0.30 · Crypto.KDF.Argon2
  • Enum VariantDefined in cryptonite-0.30 · Crypto.KDF.Argon2
  • Eq VariantDefined in cryptonite-0.30 · Crypto.KDF.Argon2
  • Ord VariantDefined in cryptonite-0.30 · Crypto.KDF.Argon2
  • Read VariantDefined in cryptonite-0.30 · Crypto.KDF.Argon2
  • Show VariantDefined in cryptonite-0.30 · Crypto.KDF.Argon2
datadata Version
#

Which version of Argon2 to use

Instances6Bounded, Enum, Eq, Ord, Read, Show
  • Bounded VersionDefined in cryptonite-0.30 · Crypto.KDF.Argon2
  • Enum VersionDefined in cryptonite-0.30 · Crypto.KDF.Argon2
  • Eq VersionDefined in cryptonite-0.30 · Crypto.KDF.Argon2
  • Ord VersionDefined in cryptonite-0.30 · Crypto.KDF.Argon2
  • Read VersionDefined in cryptonite-0.30 · Crypto.KDF.Argon2
  • Show VersionDefined in cryptonite-0.30 · Crypto.KDF.Argon2

Hashing function

1 declaration