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
NFData Salt Source # | |||||
Defined in Crypto.Saltine.Internal.Password | |||||
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 # | |||||
Generic Salt Source # | |||||
Defined in Crypto.Saltine.Internal.Password Associated Types
| |||||
Show Salt Source # | |||||
Eq Salt Source # | |||||
Ord Salt Source # | |||||
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.2.0-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
NFData Opslimit Source # | |||||
Defined in Crypto.Saltine.Internal.Password | |||||
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 # | |||||
Generic Opslimit Source # | |||||
Defined in Crypto.Saltine.Internal.Password Associated Types
| |||||
Show Opslimit Source # | |||||
Eq Opslimit Source # | |||||
Ord 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
NFData Memlimit Source # | |||||
Defined in Crypto.Saltine.Internal.Password | |||||
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 # | |||||
Generic Memlimit Source # | |||||
Defined in Crypto.Saltine.Internal.Password Associated Types
| |||||
Show Memlimit Source # | |||||
Eq Memlimit Source # | |||||
Ord 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
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 # | |||||
Generic Policy Source # | |||||
Defined in Crypto.Saltine.Internal.Password Associated Types
| |||||
Show Policy Source # | |||||
Eq Policy Source # | |||||
Ord 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.2.0-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 |
Instances
Data Algorithm 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) -> Algorithm -> c Algorithm # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Algorithm # toConstr :: Algorithm -> Constr # dataTypeOf :: Algorithm -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Algorithm) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Algorithm) # gmapT :: (forall b. Data b => b -> b) -> Algorithm -> Algorithm # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Algorithm -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Algorithm -> r # gmapQ :: (forall d. Data d => d -> u) -> Algorithm -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Algorithm -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Algorithm -> m Algorithm # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Algorithm -> m Algorithm # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Algorithm -> m Algorithm # | |||||
Bounded Algorithm Source # | |||||
Enum Algorithm Source # | |||||
Defined in Crypto.Saltine.Internal.Password Methods succ :: Algorithm -> Algorithm # pred :: Algorithm -> Algorithm # fromEnum :: Algorithm -> Int # enumFrom :: Algorithm -> [Algorithm] # enumFromThen :: Algorithm -> Algorithm -> [Algorithm] # enumFromTo :: Algorithm -> Algorithm -> [Algorithm] # enumFromThenTo :: Algorithm -> Algorithm -> Algorithm -> [Algorithm] # | |||||
Generic Algorithm Source # | |||||
Defined in Crypto.Saltine.Internal.Password Associated Types
| |||||
Show Algorithm Source # | |||||
Eq Algorithm Source # | |||||
Ord Algorithm Source # | |||||
Defined in Crypto.Saltine.Internal.Password | |||||
Hashable Algorithm Source # | |||||
Defined in Crypto.Saltine.Internal.Password | |||||
type Rep Algorithm Source # | |||||
Defined in Crypto.Saltine.Internal.Password type Rep Algorithm = D1 ('MetaData "Algorithm" "Crypto.Saltine.Internal.Password" "saltine-0.2.2.0-inplace" 'False) (C1 ('MetaCons "DefaultAlgorithm" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Argon2i13" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Argon2id13" 'PrefixI 'False) (U1 :: Type -> Type))) |