age-0.0.1.0: Actually Good Encryption
Safe HaskellNone
LanguageHaskell2010

Crypto.Age.Scrypt

Description

scrypt-related types and utilities.

Synopsis

Passphrase

newtype Passphrase Source #

scrypt passphrase.

Note that this type's Eq instance performs a constant-time equality check.

Constructors

Passphrase 

Instances

Instances details
Show Passphrase Source # 
Instance details

Defined in Crypto.Age.Scrypt

Eq Passphrase Source # 
Instance details

Defined in Crypto.Age.Scrypt

Salt

data Salt where Source #

scrypt salt.

Bundled Patterns

pattern Salt :: ByteString -> Salt 

Instances

Instances details
Show Salt Source # 
Instance details

Defined in Crypto.Age.Scrypt

Methods

showsPrec :: Int -> Salt -> ShowS #

show :: Salt -> String #

showList :: [Salt] -> ShowS #

Eq Salt Source # 
Instance details

Defined in Crypto.Age.Scrypt

Methods

(==) :: Salt -> Salt -> Bool #

(/=) :: Salt -> Salt -> Bool #

bytesToSalt :: ByteString -> Maybe Salt Source #

Construct a Salt from bytes.

If the provided byte string does not have a length of 16 (128 bits), Nothing is returned.

saltToBytes :: Salt -> ByteString Source #

Get the raw bytes associated with a Salt.

Work factor

data WorkFactor where Source #

scrypt "work factor" (as it is referred to in the age specification).

This value is used in calculating the scrypt cost parameter (also referred to as N):

N = 2 ^ work_factor

Bundled Patterns

pattern WorkFactor :: Word8 -> WorkFactor 

Instances

Instances details
Bounded WorkFactor Source # 
Instance details

Defined in Crypto.Age.Scrypt

Show WorkFactor Source # 
Instance details

Defined in Crypto.Age.Scrypt

Eq WorkFactor Source # 
Instance details

Defined in Crypto.Age.Scrypt

mkWorkFactor :: Word8 -> Maybe WorkFactor Source #

Construct a WorkFactor value.

If the provided value is 0 or greater than 64, this function will return Nothing.