Documentation
¶
Overview ¶
Package kdf implements the key derivation functions defined in NIST SP-800-108.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CounterModeKey ¶
CounterModeKey derives a key of the specified length using the counter mode function defined in NIST SP-800-108, using the supplied PRF, secret key and other input parameters.
func FeedbackModeKey ¶
func FeedbackModeKey(prf PRF, key, label, context, iv []byte, bitLength uint32, useCounter bool) []byte
FeebackModeKey derives a key of the specified length using the feedback mode function defined in NIST SP-800-108, using the supplied PRF, secret key and other input parameters.
The useCounter argument specifies whether the iteration counter should be used as an input to the PRF.
func PipelineModeKey ¶
PipelineModeKey derives a key of the specified length using the double-pipeline iteration mode function defined in NIST SP-800-108, using the supplied PRF, secret key and other input parameters.
The useCounter argument specifies whether the iteration counter should be used as an input to the PRF.
Types ¶
type PRF ¶
type PRF interface { // Len returns the length of this PRF. Len() uint32 // Run computes bytes for the supplied seed and input value. Run(s, x []byte) []byte }
PRF represents a pseudorandom function, required by the key derivation functions.
func NewHMACPRF ¶
NewHMACPRF creates a new HMAC based PRF using the supplied digest algorithm.