kdf

package
v0.0.0-...-a03f3f8 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.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 KDF

type KDF uint16

KDF describes iana-registered key derivation function. https://www.iana.org/assignments/hpke/hpke.xhtml

const (
	// HKDF_SHA256 is a KDF using HKDF with SHA-256.
	HKDF_SHA256 KDF = 0x01
	// HKDF_SHA384 is a KDF using HKDF with SHA-384.
	HKDF_SHA384 KDF = 0x02
	// HKDF_SHA512 is a KDF using HKDF with SHA-512.
	HKDF_SHA512 KDF = 0x03
)

func (KDF) Expand

func (k KDF) Expand(prk, labeledInfo []byte, outputLen uint16) ([]byte, error)

Expand a pseudo random content to the expected length.

func (KDF) Extract

func (k KDF) Extract(secret, salt []byte) []byte

Extract a secret from given parameters.

func (KDF) ExtractSize

func (k KDF) ExtractSize() uint16

ExtractSize returns the extracted buffer size.

func (KDF) IsValid

func (k KDF) IsValid() bool

IsValid checks if the given KDF is supported.

Jump to

Keyboard shortcuts

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