core

package
v1.5.12 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlgHmac

type AlgHmac hash.Hash
var (
	SHA256 AlgHmac = hash.Hash(sha256.New())

	SHA384 AlgHmac = hash.Hash(sha512.New384())

	SHA512 AlgHmac = hash.Hash(sha512.New())
)

type KeySet

type KeySet[T Primitive] struct {
	// contains filtered or unexported fields
}

func NewInsecureKeyset

func NewInsecureKeyset[T Primitive](key []byte, constructor NewPrimitive[T]) KeySet[T]

func NewKeySet

func NewKeySet[T Primitive](key []byte, constructor NewPrimitive[T]) KeySet[T]

func (*KeySet[T]) GetPrimitive

func (k *KeySet[T]) GetPrimitive() (T, error)

func (*KeySet[T]) GetPrimitiveFunc

func (k *KeySet[T]) GetPrimitiveFunc() func() (T, error)

func (*KeySet[T]) GetPrimitiveWithKey added in v1.5.9

func (k *KeySet[T]) GetPrimitiveWithKey(key []byte) (T, error)

func (*KeySet[T]) GetPrimitiveWithKeyFunc added in v1.5.9

func (k *KeySet[T]) GetPrimitiveWithKeyFunc(key []byte) func() (T, error)

type NewPrimitive

type NewPrimitive[T Primitive] func([]byte) (T, error)

type Primitive

type Primitive interface {
	PrimitiveAES | PrimitiveHMAC
}

type PrimitiveAES

type PrimitiveAES struct{ cipher.Block }

func NewAEAS

func NewAEAS(key []byte) (p PrimitiveAES, err error)

type PrimitiveHMAC

type PrimitiveHMAC struct{ hash.Hash }

func NewHMAC

func NewHMAC(key []byte) (p PrimitiveHMAC, err error)

Jump to

Keyboard shortcuts

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