Documentation ¶
Overview ¶
Package argon2 reexports golang.org/x/crypto/argon2 with their bcrypt API. The default parameters follow best practice.
Index ¶
Constants ¶
const ( Iterations uint8 = 10 // See https://eprint.iacr.org/2016/759.pdf TimeCost uint32 = 3 MemoryCost uint32 = 32 * 1024 Threads uint8 = 2 MaxTagLen uint32 = 32 MaxSaltSize uint32 = 16 )
Default parameters for all functions
Variables ¶
var ErrHashTooShort = errors.New("mu-io/go-argon2: hashedSecret too short to be a argon2ed password")
ErrHashTooShort - The error returned from CompareHashAndPassword when a hash is too short to be a argon2 hash.
var ErrMismatchedHashAndPassword = errors.New("mu-io/go-argon2: hashedPassword is not the hash of the given password")
ErrMismatchedHashAndPassword - The error returned from CompareHashAndPassword when a password and hash do not match.
Functions ¶
func CompareHashAndPassword ¶
CompareHashAndPassword compares a argon2 hashed password with its possible plaintext equivalent. Returns nil on success, or an error on failure.
Types ¶
type HashVariantNotSupportedError ¶
type HashVariantNotSupportedError []byte
HashVariantNotSupportedError - The error returned from CompareHashAndPassword when a hash was created with a argon2 variant not supported.
func (HashVariantNotSupportedError) Error ¶
func (hv HashVariantNotSupportedError) Error() string
type HashVersionNotSupportedError ¶
type HashVersionNotSupportedError uint8
HashVersionNotSupportedError - The error returned from CompareHashAndPassword when a hash was created with a argon2 version newer than this implementation.
func (HashVersionNotSupportedError) Error ¶
func (hv HashVersionNotSupportedError) Error() string
type InvalidHashPrefixError ¶
type InvalidHashPrefixError byte
InvalidHashPrefixError - The error returned from CompareHashAndPassword when a hash starts with something other than '$'
func (InvalidHashPrefixError) Error ¶
func (ih InvalidHashPrefixError) Error() string