crypto

package
v0.0.0-...-5b0754e Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Argon2idConfig

type Argon2idConfig struct {
	Iterations  uint32
	MemoryInKb  uint32
	Parallelism uint8
	KeySize     uint32
	SaltSize    uint32
}

type Argon2idHash

type Argon2idHash struct {
	// contains filtered or unexported fields
}

func (*Argon2idHash) Decode

func (a2 *Argon2idHash) Decode(encodedHash string) ([]byte, []byte)

func (*Argon2idHash) Encode

func (a2 *Argon2idHash) Encode(salt []byte, hash []byte) string

func (*Argon2idHash) EncodedHash

func (a2 *Argon2idHash) EncodedHash(secret string) (string, error)

func (*Argon2idHash) Hash

func (a2 *Argon2idHash) Hash(secret string) ([]byte, []byte, error)

func (*Argon2idHash) Match

func (a2 *Argon2idHash) Match(secret string, encodedHash string) bool

type Hash

type Hash interface {
	EncodedHash(secret string) (string, error)
	Hash(secret string) ([]byte, []byte, error)
	Encode(salt []byte, hash []byte) string
	Decode(encodedHash string) ([]byte, []byte)
	Match(secret string, encodedHash string) bool
}

func DefaultArgon2idHash

func DefaultArgon2idHash(saltF Salt) Hash

func NewArgon2idHash

func NewArgon2idHash(config Argon2idConfig, saltF Salt) Hash

type RandSalt

type RandSalt struct{}

func (RandSalt) GetSalt

func (g RandSalt) GetSalt(size uint32) ([]byte, error)

type Salt

type Salt interface {
	GetSalt(size uint32) ([]byte, error)
}

Jump to

Keyboard shortcuts

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