blake2

package
v0.3.22 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package blake2 implements the functions, types, and interfaces for the module.

Index

Constants

View Source
const (
	MinKeyLength = 16
	MaxKeyLength = 64
)

Variables

This section is empty.

Functions

func DefaultConfig

func DefaultConfig() *types.Config

func DefaultParams

func DefaultParams() interfaces.Params

func NewBlake2

func NewBlake2(algType types.Type, config *types.Config) (interfaces.Cryptographic, error)

func NewBlake2b256

func NewBlake2b256(config *types.Config) (interfaces.Cryptographic, error)

NewBlake2b256 creates a new BLAKE2b crypto instance

func NewBlake2b384

func NewBlake2b384(config *types.Config) (interfaces.Cryptographic, error)

NewBlake2b384 creates a new BLAKE2b crypto instance

func NewBlake2b512

func NewBlake2b512(config *types.Config) (interfaces.Cryptographic, error)

NewBlake2b512 creates a new BLAKE2b crypto instance

func NewBlake2s128

func NewBlake2s128(config *types.Config) (interfaces.Cryptographic, error)

NewBlake2s128 creates a new BLAKE2s crypto instance

func NewBlake2s256

func NewBlake2s256(config *types.Config) (interfaces.Cryptographic, error)

NewBlake2s256 creates a new BLAKE2s crypto instance

func ResolveType

func ResolveType(p types.Type) (types.Type, error)

Types

type Blake2

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

Blake2 implements the BLAKE2 hashing algorithm

func (*Blake2) Hash

func (c *Blake2) Hash(password string) (*types.HashParts, error)

Hash implements the hash method

func (*Blake2) HashWithSalt

func (c *Blake2) HashWithSalt(password string, salt []byte) (*types.HashParts, error)

HashWithSalt implements the hash with salt method

func (*Blake2) Type

func (c *Blake2) Type() types.Type

func (*Blake2) Verify

func (c *Blake2) Verify(parts *types.HashParts, password string) error

Verify implements the verify method

type Params

type Params struct {
	Key []byte
}

func FromMap

func FromMap(m map[string]string) (params *Params, err error)

func (*Params) FromMap

func (p *Params) FromMap(params map[string]string) error

func (*Params) String

func (p *Params) String() string

func (*Params) ToMap

func (p *Params) ToMap() map[string]string

ToMap converts Params to a map[string]string

func (*Params) Validate

func (p *Params) Validate(config *types.Config) error

Jump to

Keyboard shortcuts

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