Documentation ¶
Overview ¶
Package sp800108 implements the NIST Special Publication 800-108
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CounterKBKDF ¶
type CounterKBKDF struct{}
CounterKBKDF is the NIST Key Based Key Derivation Function in counter mode
func (*CounterKBKDF) Derive ¶
func (c *CounterKBKDF) Derive(prf PRF, counterLengthR Counter, inputKey, label, context, outputSizeBits []byte, inputOrder []InputStringOrdering) ([]byte, error)
Derive uses the key and keying material to generate a derived key(set) of the desired size
type InputStringOrdering ¶
type InputStringOrdering uint
InputStringOrdering defines an element in the KDF Input String
const ( // InputOrderLabel is the label InputOrderLabel InputStringOrdering = iota // InputOrderContext is the context InputOrderContext // InputOrderL is the output data length as big-endian binary integer L InputOrderL // InputOrderEmptySeparator is 0x00 InputOrderEmptySeparator // InputOrderCounter is the counter variable InputOrderCounter )
type KDF ¶
type KDF interface { // Derive uses the key and keying material to generate a derived key(set) of the desired size. Output size is big-endian Derive(prf PRF, counterLengthR Counter, inputKey, label, context, outputSizeBits []byte, inputOrder []InputStringOrdering) ([]byte, error) }
KDF is a Key Derivation Function
type PRF ¶
type PRF interface { // Compute generates new data from a key and keying material data. Compute(key, data []byte) ([]byte, error) // OutputSizeBytes indicates the output size of the PRF in bytes, non-byte multiples of output length are not supported OutputSizeBytes() uint // contains filtered or unexported methods }
PRF is a Pseudorandom Function acceptable to the NIST KBKDF
type PRFCMAC ¶
type PRFCMAC struct{}
PRFCMAC is the CMAC implementation of PRF
func (*PRFCMAC) OutputSizeBytes ¶
OutputSizeBytes indicates the output size of the PRF in bytes, non-byte multiples of output length are not supported
type PRFHMAC ¶
type PRFHMAC struct {
// contains filtered or unexported fields
}
PRFHMAC is the HMAC implementation of PRF
func NewPRFHMAC ¶
NewPRFHMAC creates a new HMAC PRF
func (*PRFHMAC) OutputSizeBytes ¶
OutputSizeBytes indicates the output size of the PRF in bytes, non-byte multiples of output length are not supported