argon2

package
v0.1.59999 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidKeyLength   error = fmt.Errorf("invalid key length")
	ErrInvalidTimeCost    error = fmt.Errorf("invalid time cost")
	ErrInvalidSalt        error = fmt.Errorf("invalid salt")
	ErrInsufficientMemory error = fmt.Errorf("insufficient memory cost")
	ErrInvalidParallelism error = fmt.Errorf("invalid parallelism")
)
View Source
var Argon2idKDF = NewArgon2id(defaultTimeCost, defaultMemoryCost, defaultParallelism)

Argon2idKDF is a convenient instance of the Argon2id key derivation function that can be used directly.

Functions

This section is empty.

Types

type Argon2id

type Argon2id struct {
	TimeCost    uint32
	MemoryCost  uint32
	Parallelism uint8
}

func NewArgon2id

func NewArgon2id(timeCost, memoryCost uint32, parallelism uint8) *Argon2id

func (*Argon2id) Derive

func (a *Argon2id) Derive(ikm, salt, info []byte, keyLen int) ([]byte, error)

Derive derives a key of the specified length from the input key material (IKM) using Argon2id.

func (*Argon2id) DeriveDefault

func (a *Argon2id) DeriveDefault(ikm []byte) ([]byte, error)

DeriveDefault derives a key using default parameters for common use cases.

Jump to

Keyboard shortcuts

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