Documentation
¶
Overview ¶
Package argon2 implements the functions, types, and interfaces for the module.
Index ¶
- Constants
- func DefaultConfig() *types.Config
- func NewArgon2(algSpec types.Spec, config *types.Config) (scheme.Scheme, error)
- func NewArgon2i(cfg *types.Config) (scheme.Scheme, error)
- func NewArgon2id(cfg *types.Config) (scheme.Scheme, error)
- func NewDefaultArgon2(config *types.Config) (scheme.Scheme, error)
- func ResolveSpec(p types.Spec) (types.Spec, error)
- func WithKeyLength(keyLength uint32) func(*types.Config)
- func WithMemoryCost(memoryCost uint32) func(*types.Config)
- func WithParams(params *Params) func(*types.Config)
- func WithThreads(threads uint8) func(*types.Config)
- func WithTimeCost(timeCost uint32) func(*types.Config)
- type Argon2
- type KeyFunc
- type Params
Constants ¶
View Source
const ( // DefaultTimeCost is the default time cost for Argon2. DefaultTimeCost = 3 // DefaultMemoryCost is the default memory cost for Argon2. DefaultMemoryCost = 64 * 1024 // 64MB // DefaultThreads is the default number of threads for Argon2. DefaultThreads = 4 // DefaultKeyLength is the default key length for Argon2. DefaultKeyLength = 32 )
Variables ¶
This section is empty.
Functions ¶
func DefaultConfig ¶
DefaultConfig returns the default configuration for Argon2
func NewDefaultArgon2 ¶ added in v0.3.18
func WithKeyLength ¶ added in v1.2.0
func WithMemoryCost ¶ added in v1.2.0
func WithParams ¶ added in v1.2.0
func WithThreads ¶ added in v1.2.0
func WithTimeCost ¶ added in v1.2.0
Types ¶
type Argon2 ¶
type Argon2 struct {
// contains filtered or unexported fields
}
Argon2 implements the Argon2 hashing algorithm
func (*Argon2) HashWithSalt ¶
HashWithSalt implements the hash with salt method
type KeyFunc ¶ added in v0.3.18
type KeyFunc func(password []byte, salt []byte, time uint32, memory uint32, threads uint8, keyLen uint32) []byte
func ParseKeyFunc ¶ added in v0.3.18
type Params ¶
Params represents parameters for Argon2 algorithm
func DefaultParams ¶
func DefaultParams() *Params
Click to show internal directories.
Click to hide internal directories.