Documentation ¶
Index ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Argon2idKeyDerivator ¶
type Argon2idKeyDerivator struct { Params *Argon2idParams // contains filtered or unexported fields }
func NewArgon2idKeyDerivator ¶
func NewArgon2idKeyDerivator(maxTotalMemMiB uint32, params *Argon2idParams, updateParams bool) *Argon2idKeyDerivator
func (*Argon2idKeyDerivator) CheckPassword ¶
func (*Argon2idKeyDerivator) GeneratePasswordHash ¶
func (kd *Argon2idKeyDerivator) GeneratePasswordHash(ctx context.Context, pw string) (string, error)
GeneratePasswordHash derives a key from the password, salt, and cost parameters using Argon2id returning the standard encoded representation of the hashed password https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-argon2-03
type Argon2idParams ¶
type Argon2idParams struct { Memory uint32 // the memory parameter specifies the size of the memory in KiB Time uint32 // the time parameter specifies the number of passes over the memory Threads uint8 // the threads parameter specifies the number of threads and can be adjusted to the numbers of available CPUs KeyLen uint32 // the length of the resulting derived key in byte SaltLen uint32 // the length of the random salt in byte }
func GetArgon2idParams ¶
func GetArgon2idParams(memMiB, time uint32, threads uint8, keyLen, saltLen uint32) *Argon2idParams
func GetDefaultArgon2idParams ¶
func GetDefaultArgon2idParams() *Argon2idParams
Click to show internal directories.
Click to hide internal directories.