kdf

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2016 License: MPL-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

This package is used to implement Key Derivation Functions (KDF) based on the recommendations of NIST SP 800-108. These are useful for generating unique-per-transaction keys, or situations in which a key hierarchy may be useful.

Index

Constants

View Source
const (
	// HMACSHA256PRFLen is the length of output from HMACSHA256PRF
	HMACSHA256PRFLen uint32 = 256
)

Variables

This section is empty.

Functions

func CounterMode

func CounterMode(prf PRF, prfLen uint32, key []byte, context []byte, bits uint32) ([]byte, error)

CounterMode implements the counter mode KDF that uses a psuedo-random-function (PRF) along with a counter to generate derived keys. The KDF takes a base key a derivation context, and the required number of output bits.

func HMACSHA256PRF

func HMACSHA256PRF(key []byte, data []byte) ([]byte, error)

HMACSHA256PRF is a pseudo-random-function (PRF) that uses an HMAC-SHA256

Types

type PRF

type PRF func([]byte, []byte) ([]byte, error)

PRF is a pseudo-random function that takes a key or seed, as well as additional binary data and generates output that is indistinguishable from random. Examples are cryptographic hash functions or block ciphers.

Jump to

Keyboard shortcuts

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