Documentation
¶
Overview ¶
Package kbkdf implements the key derivation functions described in NIST SP-800-108.
All 3 modes are implemented - counter, feedback and pipeline.
The counter mode is used extensively in the reference TPM implementation.
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 described 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, iterationCounterMode IterationCounterMode) []byte
FeebackModeKey derives a key of the specified length using the feedback mode function described in NIST SP-800-108, using the supplied PRF, secret key and other input parameters.
The iterationCounterMode argument specifies whether the iteration counter should be included as an input to the PRF.
func PipelineModeKey ¶
func PipelineModeKey(prf PRF, key, label, context []byte, bitLength uint32, iterationCounterMode IterationCounterMode) []byte
PipelineModeKey derives a key of the specified length using the double-pipeline iteration mode function described in NIST SP-800-108, using the supplied PRF, secret key and other input parameters.
The iterationCounterMode argument specifies whether the iteration counter should be included as an input to the PRF.
Types ¶
type IterationCounterMode ¶
type IterationCounterMode bool
IterationCounterMode defines whether the iteration counter is included in the feedback and double-pipeline KDFs
const ( OmitIterationCounter IterationCounterMode = false IncludeIterationCounter IterationCounterMode = true )