| Copyright | (c) Promethea Raschke 2018 Max Amanshauser 2021  | 
|---|---|
| License | MIT | 
| Maintainer | max@lambdalifting.org | 
| Stability | experimental | 
| Portability | non-portable | 
| Safe Haskell | None | 
| Language | Haskell2010 | 
Crypto.Saltine.Internal.Password
Description
Synopsis
- c_pwhash :: Ptr CChar -> CULLong -> Ptr CChar -> CULLong -> Ptr CChar -> CULLong -> CSize -> CInt -> IO CInt
 - c_pwhash_str :: Ptr CChar -> Ptr CChar -> CULLong -> CULLong -> CSize -> IO CInt
 - c_pwhash_str_verify :: Ptr CChar -> Ptr CChar -> CULLong -> IO CInt
 - c_pwhash_str_needs_rehash :: Ptr CChar -> CULLong -> CSize -> IO CInt
 - pwhash_alg_argon2i13 :: Int
 - pwhash_alg_argon2id13 :: Int
 - pwhash_alg_default :: Int
 - algorithm :: Algorithm -> CInt
 - pwhash_bytes_max :: Int
 - pwhash_bytes_min :: Int
 - pwhash_memlimit_interactive :: Int
 - pwhash_memlimit_moderate :: Int
 - pwhash_memlimit_sensitive :: Int
 - pwhash_memlimit_min :: Int
 - pwhash_memlimit_max :: Int
 - pwhash_opslimit_interactive :: Int
 - pwhash_opslimit_moderate :: Int
 - pwhash_opslimit_sensitive :: Int
 - pwhash_opslimit_min :: Int
 - pwhash_opslimit_max :: Int
 - pwhash_passwd_min :: Int
 - pwhash_passwd_max :: Int
 - pwhash_saltbytes :: Int
 - pwhash_strbytes :: Int
 - pwhash_strprefix :: Int
 - pwhash_argon2i_bytes_max :: Int
 - pwhash_argon2i_bytes_min :: Int
 - pwhash_argon2i_memlimit_interactive :: Int
 - pwhash_argon2i_memlimit_moderate :: Int
 - pwhash_argon2i_memlimit_sensitive :: Int
 - pwhash_argon2i_memlimit_min :: Int
 - pwhash_argon2i_memlimit_max :: Int
 - pwhash_argon2i_opslimit_interactive :: Int
 - pwhash_argon2i_opslimit_moderate :: Int
 - pwhash_argon2i_opslimit_sensitive :: Int
 - pwhash_argon2i_opslimit_min :: Int
 - pwhash_argon2i_opslimit_max :: Int
 - pwhash_argon2i_passwd_min :: Int
 - pwhash_argon2i_passwd_max :: Int
 - pwhash_argon2i_saltbytes :: Int
 - pwhash_argon2i_strbytes :: Int
 - pwhash_argon2i_strprefix :: Int
 - pwhash_argon2id_bytes_max :: Int
 - pwhash_argon2id_bytes_min :: Int
 - pwhash_argon2id_memlimit_interactive :: Int
 - pwhash_argon2id_memlimit_moderate :: Int
 - pwhash_argon2id_memlimit_sensitive :: Int
 - pwhash_argon2id_memlimit_min :: Int
 - pwhash_argon2id_memlimit_max :: Int
 - pwhash_argon2id_opslimit_interactive :: Int
 - pwhash_argon2id_opslimit_moderate :: Int
 - pwhash_argon2id_opslimit_sensitive :: Int
 - pwhash_argon2id_opslimit_min :: Int
 - pwhash_argon2id_opslimit_max :: Int
 - pwhash_argon2id_passwd_min :: Int
 - pwhash_argon2id_passwd_max :: Int
 - pwhash_argon2id_saltbytes :: Int
 - pwhash_argon2id_strbytes :: Int
 - pwhash_argon2id_strprefix :: Int
 - newtype Salt = Salt {
- unSalt :: ByteString
 
 - newtype PasswordHash = PasswordHash {}
 - newtype Opslimit = Opslimit {
- getOpslimit :: Int
 
 - newtype Memlimit = Memlimit {
- getMemlimit :: Int
 
 - data Policy = Policy {}
 - data Algorithm
 
Documentation
pwhash_alg_argon2i13 :: Int Source #
version 1.3 of the Argon2i algorithm
pwhash_alg_argon2id13 :: Int Source #
version 1.3 of the Argon2id algorithm
pwhash_alg_default :: Int Source #
Lets libsodium pick a hashing algorithm
pwhash_bytes_max :: Int Source #
Maximum output length for key derivation.
pwhash_bytes_min :: Int Source #
Constants for the default algorithm | Minimum output length for key derivation (16 (128 bits)).
pwhash_memlimit_interactive :: Int Source #
Constant for currently 64MB memory
pwhash_memlimit_moderate :: Int Source #
Constant for currently 256MB memory
pwhash_memlimit_sensitive :: Int Source #
Constant for currently 1024MB memory
pwhash_memlimit_min :: Int Source #
Minimum allowed memory limit for password hashing
pwhash_memlimit_max :: Int Source #
Maximum allowed memory limit for password hashing
pwhash_opslimit_interactive :: Int Source #
Constant for relatively fast hashing
pwhash_opslimit_moderate :: Int Source #
Constant for moderately fast hashing
pwhash_opslimit_sensitive :: Int Source #
Constant for relatively slow hashing
pwhash_opslimit_min :: Int Source #
Minimum allowed number of computations for password hashing
pwhash_opslimit_max :: Int Source #
Maximum allowed number of computations for password hashing
pwhash_passwd_min :: Int Source #
Minimum number of characters in password for key derivation
pwhash_passwd_max :: Int Source #
Maximum number of characters in password for key derivation
pwhash_saltbytes :: Int Source #
Size of salt
pwhash_strbytes :: Int Source #
(Maximum) size of password hashing output
pwhash_argon2i_bytes_max :: Int Source #
Maximum output length for key derivation.
pwhash_argon2i_bytes_min :: Int Source #
Constants for ARGON2I | Minimum output length for key derivation (= 16 (128 bits)).
pwhash_argon2i_memlimit_interactive :: Int Source #
Constant for currently 64MB memory
pwhash_argon2i_memlimit_moderate :: Int Source #
Constant for currently 256MB memory
pwhash_argon2i_memlimit_sensitive :: Int Source #
Constant for currently 1024MB memory
pwhash_argon2i_memlimit_min :: Int Source #
Minimum allowed memory limit for password hashing
pwhash_argon2i_memlimit_max :: Int Source #
Maximum allowed memory limit for password hashing
pwhash_argon2i_opslimit_interactive :: Int Source #
Constant for relatively fast hashing
pwhash_argon2i_opslimit_moderate :: Int Source #
Constant for moderately fast hashing
pwhash_argon2i_opslimit_sensitive :: Int Source #
Constant for relatively slow hashing
pwhash_argon2i_opslimit_min :: Int Source #
Minimum allowed number of computations for password hashing
pwhash_argon2i_opslimit_max :: Int Source #
Maximum allowed number of computations for password hashing
pwhash_argon2i_passwd_min :: Int Source #
Minimum number of characters in password for key derivation
pwhash_argon2i_passwd_max :: Int Source #
Maximum number of characters in password for key derivation
pwhash_argon2i_saltbytes :: Int Source #
Size of salt
pwhash_argon2i_strbytes :: Int Source #
(Maximum) size of password hashing output
pwhash_argon2id_bytes_max :: Int Source #
Maximum output length for key derivation.
pwhash_argon2id_bytes_min :: Int Source #
Constants for Argon2ID | Minimum output length for key derivation (= 16 (128 bits)).
pwhash_argon2id_memlimit_interactive :: Int Source #
Constant for currently 64MB memory
pwhash_argon2id_memlimit_moderate :: Int Source #
Constant for currently 256MB memory
pwhash_argon2id_memlimit_sensitive :: Int Source #
Constant for currently 1024MB memory
pwhash_argon2id_memlimit_min :: Int Source #
Minimum allowed memory limit for password hashing
pwhash_argon2id_memlimit_max :: Int Source #
Maximum allowed memory limit for password hashing
pwhash_argon2id_opslimit_interactive :: Int Source #
Constant for relatively fast hashing
pwhash_argon2id_opslimit_moderate :: Int Source #
Constant for moderately fast hashing
pwhash_argon2id_opslimit_sensitive :: Int Source #
Constant for relatively slow hashing
pwhash_argon2id_opslimit_min :: Int Source #
Minimum allowed number of computations for password hashing
pwhash_argon2id_opslimit_max :: Int Source #
Maximum allowed number of computations for password hashing
pwhash_argon2id_passwd_min :: Int Source #
Minimum number of characters in password for key derivation
pwhash_argon2id_passwd_max :: Int Source #
Maximum number of characters in password for key derivation
pwhash_argon2id_saltbytes :: Int Source #
Size of salt
pwhash_argon2id_strbytes :: Int Source #
(Maximum) size of password hashing output
Salt for deriving keys from passwords
Constructors
| Salt | |
Fields 
  | |
Instances
| Eq Salt Source # | |
| Data Salt Source # | |
Defined in Crypto.Saltine.Internal.Password Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Salt -> c Salt # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Salt # dataTypeOf :: Salt -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Salt) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Salt) # gmapT :: (forall b. Data b => b -> b) -> Salt -> Salt # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Salt -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Salt -> r # gmapQ :: (forall d. Data d => d -> u) -> Salt -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Salt -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Salt -> m Salt # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Salt -> m Salt # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Salt -> m Salt #  | |
| Ord Salt Source # | |
| Show Salt Source # | |
| Generic Salt Source # | |
| NFData Salt Source # | |
Defined in Crypto.Saltine.Internal.Password  | |
| Hashable Salt Source # | |
Defined in Crypto.Saltine.Internal.Password  | |
| IsEncoding Salt Source # | |
Defined in Crypto.Saltine.Internal.Password Methods encode :: Salt -> ByteString Source # decode :: ByteString -> Maybe Salt Source # encoded :: (Choice p, Applicative f) => p Salt (f Salt) -> p ByteString (f ByteString) Source #  | |
| type Rep Salt Source # | |
Defined in Crypto.Saltine.Internal.Password type Rep Salt = D1 ('MetaData "Salt" "Crypto.Saltine.Internal.Password" "saltine-0.2.0.1-inplace" 'True) (C1 ('MetaCons "Salt" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSalt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)))  | |
newtype PasswordHash Source #
Verification string for stored passwords This hash contains only printable characters, hence we can just derive Show.
Constructors
| PasswordHash | |
Fields  | |
Instances
Wrapper type for the operations used by password hashing
Constructors
| Opslimit | |
Fields 
  | |
Instances
| Eq Opslimit Source # | |
| Data Opslimit Source # | |
Defined in Crypto.Saltine.Internal.Password Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Opslimit -> c Opslimit # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Opslimit # toConstr :: Opslimit -> Constr # dataTypeOf :: Opslimit -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Opslimit) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Opslimit) # gmapT :: (forall b. Data b => b -> b) -> Opslimit -> Opslimit # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Opslimit -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Opslimit -> r # gmapQ :: (forall d. Data d => d -> u) -> Opslimit -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Opslimit -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Opslimit -> m Opslimit # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Opslimit -> m Opslimit # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Opslimit -> m Opslimit #  | |
| Ord Opslimit Source # | |
Defined in Crypto.Saltine.Internal.Password  | |
| Show Opslimit Source # | |
| Generic Opslimit Source # | |
| NFData Opslimit Source # | |
Defined in Crypto.Saltine.Internal.Password  | |
| Hashable Opslimit Source # | |
Defined in Crypto.Saltine.Internal.Password  | |
| type Rep Opslimit Source # | |
Defined in Crypto.Saltine.Internal.Password  | |
Wrapper type for the memory used by password hashing
Constructors
| Memlimit | |
Fields 
  | |
Instances
| Eq Memlimit Source # | |
| Data Memlimit Source # | |
Defined in Crypto.Saltine.Internal.Password Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Memlimit -> c Memlimit # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Memlimit # toConstr :: Memlimit -> Constr # dataTypeOf :: Memlimit -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Memlimit) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Memlimit) # gmapT :: (forall b. Data b => b -> b) -> Memlimit -> Memlimit # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Memlimit -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Memlimit -> r # gmapQ :: (forall d. Data d => d -> u) -> Memlimit -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Memlimit -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Memlimit -> m Memlimit # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Memlimit -> m Memlimit # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Memlimit -> m Memlimit #  | |
| Ord Memlimit Source # | |
Defined in Crypto.Saltine.Internal.Password  | |
| Show Memlimit Source # | |
| Generic Memlimit Source # | |
| NFData Memlimit Source # | |
Defined in Crypto.Saltine.Internal.Password  | |
| Hashable Memlimit Source # | |
Defined in Crypto.Saltine.Internal.Password  | |
| type Rep Memlimit Source # | |
Defined in Crypto.Saltine.Internal.Password  | |
Wrapper for opslimit, memlimit and algorithm
Instances
| Eq Policy Source # | |
| Data Policy Source # | |
Defined in Crypto.Saltine.Internal.Password Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Policy -> c Policy # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Policy # toConstr :: Policy -> Constr # dataTypeOf :: Policy -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Policy) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Policy) # gmapT :: (forall b. Data b => b -> b) -> Policy -> Policy # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Policy -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Policy -> r # gmapQ :: (forall d. Data d => d -> u) -> Policy -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Policy -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Policy -> m Policy # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Policy -> m Policy # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Policy -> m Policy #  | |
| Ord Policy Source # | |
| Show Policy Source # | |
| Generic Policy Source # | |
| Hashable Policy Source # | |
Defined in Crypto.Saltine.Internal.Password  | |
| type Rep Policy Source # | |
Defined in Crypto.Saltine.Internal.Password type Rep Policy = D1 ('MetaData "Policy" "Crypto.Saltine.Internal.Password" "saltine-0.2.0.1-inplace" 'False) (C1 ('MetaCons "Policy" 'PrefixI 'True) (S1 ('MetaSel ('Just "opsPolicy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Opslimit) :*: (S1 ('MetaSel ('Just "memPolicy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Memlimit) :*: S1 ('MetaSel ('Just "algPolicy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Algorithm))))  | |
Algorithms known to Libsodium, as an enum datatype
Constructors
| DefaultAlgorithm | |
| Argon2i13 | |
| Argon2id13 |