Crypto.Scrypt
Description
Scrypt is a sequential memory-hard key derivation function. This module provides bindings to a fast C implementation of scrypt, written by Colin Percival. For more information see http://www.tarsnap.com/scrypt.html.
- data ScryptParams
- params :: Integer -> Integer -> Integer -> Maybe ScryptParams
- defaultParams :: ScryptParams
- scrypt :: ScryptParams -> Salt -> Pass -> PassHash
- getSalt :: IO Salt
- newtype Pass = Pass ByteString
- newtype Salt = Salt ByteString
- newtype PassHash = PassHash ByteString
Parameters to the scrypt function
data ScryptParams Source
Encapsulates the three tuning parameters to the scrypt function: N,
r and p. The parameters affect running time and memory usage:
Memory usage is approximately 128*r*N bytes. Note that the
params function takes log_2(N) as a parameter. As an example, the
defaultParams
log_2(N) = 14, r = 8 and p = 1
lead to scrypt using 128 * 8 * 2^14 = 16M bytes of memory.
Running time is proportional to all of N, r and p. However
p only as an insignificant influence on memory usage an can thus be
used to tune the running time of scrypt.
Arguments
| :: Integer |
|
| -> Integer | The parameter |
| -> Integer | The parameter |
| -> Maybe ScryptParams | Returns |
Constructor function for the ScryptParams data type