hkdf

package
v0.0.0-...-aa0dd62 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: BSD-3-Clause Imports: 4 Imported by: 2

Documentation

Overview

Package hkdf implements the HMAC-based Extract-and-Expand Key Derivation Function (HKDF) as defined in RFC 5869.

HKDF is a cryptographic key derivation function (KDF) with the goal of expanding limited input keying material into one or more cryptographically strong secret keys.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Expand

func Expand(hash func() hash.Hash, pseudorandomKey, info []byte) io.Reader

Expand returns a Reader, from which keys can be read, using the given pseudorandom key and optional context info, skipping the extraction step.

The pseudorandomKey should have been generated by Extract, or be a uniformly random or pseudorandom cryptographically strong key. See RFC 5869, Section 3.3. Most common scenarios will want to use New instead.

func Extract

func Extract(hash func() hash.Hash, secret, salt []byte) []byte

Extract generates a pseudorandom key for use with Expand from an input secret and an optional independent salt.

Only use this function if you need to reuse the extracted key with multiple Expand invocations and different context values. Most common scenarios, including the generation of multiple keys, should use New instead.

func New

func New(hash func() hash.Hash, secret, salt, info []byte) io.Reader

New returns a Reader, from which keys can be read, using the given hash, secret, salt and context info. Salt and info can be nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

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