scrypt

package
v0.3.18 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfig

func DefaultConfig() *types.Config

func NewScrypt added in v0.3.18

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

NewScrypt creates a new Scrypt crypto instance

Types

type Params

type Params struct {
	N      int
	R      int
	P      int
	KeyLen int
}

Params represents parameters for Scrypt algorithm

func DefaultParams

func DefaultParams() *Params

func FromParams added in v0.3.18

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

FromParams parses Scrypt parameters from a map[string]string.

func (*Params) FromMap added in v0.3.18

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

func (*Params) String

func (p *Params) String() string

String returns the string representation of parameters

func (*Params) ToMap added in v0.3.18

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

ToMap converts Params to a map[string]string

func (*Params) Validate added in v0.3.18

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

type Scrypt

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

Scrypt implements the Scrypt hashing algorithm

func (*Scrypt) Hash

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

Hash implements the hash method

func (*Scrypt) HashWithSalt

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

HashWithSalt implements the hash with salt method

func (*Scrypt) Type

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

func (*Scrypt) Verify

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

Verify implements the verify method

Jump to

Keyboard shortcuts

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