cryptonite-0.22: Cryptography Primitives sink

LicenseBSD-style
MaintainerVincent Hanquez <vincent@snarc.org>
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Crypto.KDF.Argon2

Contents

Description

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

Synopsis

Documentation

data Options Source #

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

Constructors

Options 

Fields

type TimeCost = Word32 Source #

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

ARGON2_MIN_TIME <= hashIterations <= ARGON2_MAX_TIME

type MemoryCost = Word32 Source #

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

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

data Variant Source #

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

Constructors

Argon2d

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.

Argon2i

Argon2d is faster and uses data-depending memory access, which makes it suitable for cryptocurrencies and applications with no threats from side-channel timing 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

Hashing function

hash :: (ByteArrayAccess password, ByteArrayAccess salt, ByteArray out) => Options -> password -> salt -> Int -> CryptoFailable out Source #