infra

package
v0.0.0-...-245198b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2020 License: LGPL-2.1 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidHash         = errors.New("The format of the encoded hash is invalid")
	ErrIncompatibleVersion = errors.New("Incompatible version of argon2")
)

Based on recommendations for backend authentication from the Argon2 draft RFC revision 12

Functions

func GenRandomBytes

func GenRandomBytes(n uint32) ([]byte, error)

Generate n crypto-safe random bytes

func HashMsgCompare

func HashMsgCompare(msg string, encHash string) (match bool, err error)

checks if a given message matches the hash. Comparison is done in constant time to avoid timing attacks

func HashPassword

func HashPassword(msg string) (encodedHash string, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL