Documentation ¶
Overview ¶
Package mhf provides an interface to memory hard functions, a.k.a password key derivation functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Identifier ¶
type Identifier byte
Identifier is used to specify the memory hard function to be used.
const ( // Argon2id password kdf function. Argon2id Identifier = 1 + iota // Scrypt password kdf function. Scrypt // PBKDF2Sha512 PBKDF2 password kdf function using SHA-512. PBKDF2Sha512 // Bcrypt password kdf function. Bcrypt )
func (Identifier) Available ¶
func (i Identifier) Available() bool
Available reports whether the given kdf function is linked into the binary.
func (Identifier) Harden ¶
func (i Identifier) Harden(password, salt []byte, length int) []byte
Harden uses default parameters for the key derivation function over the input password and salt.
func (Identifier) String ¶
func (i Identifier) String() string
String returns the string name of the hashing function.
type MHF ¶
type MHF struct {
// contains filtered or unexported fields
}
MHF allows customisation of the underlying memory-hard function.
func (*MHF) Set ¶
func (m *MHF) Set(i Identifier) *MHF
Set sets m's memory-hard function to the specified one and returns m. Returns nil if the identifier is invalid.
Click to show internal directories.
Click to hide internal directories.