argon2

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MethodArgon2i  = "argon2i"
	MethodArgon2id = "argon2id"
)

Variables

View Source
var (
	ErrUnsupportedMethod = errors.New("argon2: unsupported method")
)

Functions

func WithLength

func WithLength[T types.DataType](length uint32) key.Option[T]

func WithMemory

func WithMemory[T types.DataType](memory uint32) key.Option[T]

func WithMethod

func WithMethod[T types.DataType](method string) key.Option[T]

func WithSaltSize

func WithSaltSize[T types.DataType](size int) key.Option[T]

func WithThreads

func WithThreads[T types.DataType](threads uint8) key.Option[T]

func WithTime

func WithTime[T types.DataType](time uint32) key.Option[T]

Types

type KeyGeneratorImpl

type KeyGeneratorImpl[T types.DataType] struct{}

func (*KeyGeneratorImpl[T]) KeyGen

func (k *KeyGeneratorImpl[T]) KeyGen(alg types.Algorithm, opts ...key.Option[T]) (key.Key[T], error)

type KeyImpl

type KeyImpl[T types.DataType] struct {
	// contains filtered or unexported fields
}

func (*KeyImpl[T]) Algorithm

func (k *KeyImpl[T]) Algorithm() types.Algorithm

func (*KeyImpl[T]) Decrypt

func (k *KeyImpl[T]) Decrypt(ciphertext T) (plaintext T, err error)

func (*KeyImpl[T]) Encrypt

func (k *KeyImpl[T]) Encrypt(plaintext T) (ciphertext T, err error)

func (*KeyImpl[T]) Export

func (k *KeyImpl[T]) Export() (key T, err error)

func (*KeyImpl[T]) PublicKey

func (k *KeyImpl[T]) PublicKey() (key.Key[T], error)

func (*KeyImpl[T]) SKI

func (k *KeyImpl[T]) SKI() T

func (*KeyImpl[T]) Sign

func (k *KeyImpl[T]) Sign(msg T) (signature T, err error)

func (*KeyImpl[T]) Verify

func (k *KeyImpl[T]) Verify(msg, signature T) (bool, error)

Jump to

Keyboard shortcuts

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