Documentation
¶
Overview ¶
Package argon2 implements auth's Authenticator interface using the argon2 key derivation function.
Index ¶
Constants ¶
Variables ¶
View Source
var ( ErrInvalidHash = errors.New("hash is not a valid argon2 hash") ErrIncompatibleVersion = errors.New("hash version differs from Go library's implemented version") ErrUnknownAlgorithm = errors.New("unknown algorithm") ErrSaltLenTooSmall = errors.New("salt length is too small") ErrParallelismTooSmall = errors.New("degree of parallelism is too small") ErrKeyLenTooSmall = errors.New("key length is too small") ErrHashAndPassNotMatch = errors.New("password does not Match the Hash") )
View Source
var (
DefaultAuthenticator = &Authenticator{DefaultCtx}
)
View Source
var DefaultCtx = Context{ Argon2id, argon2.Version, DefaultMemory, DefaultIterations, uint8(runtime.NumCPU()), DefaultSaltLen, DefaultKeyLen, }
Functions ¶
Types ¶
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
func NewAuthenticator ¶
func NewAuthenticator(ctx *Context) (*Authenticator, error)
func (*Authenticator) Compare ¶
func (a *Authenticator) Compare(hash, plaintext string) error
Click to show internal directories.
Click to hide internal directories.