DeriveMech_NISTKDFmGeneric API
The new mechanism is DeriveMech_NISTKDFmGeneric
.
Parameters
The parameter structure is as follows:
struct M_DeriveMech_NISTKDFmGeneric_DKParams {
M_DeriveMech_NISTKDFmGeneric_DKParams_flags flags;
M_Word keylen;
M_KeyType keytype;
M_Mech prf;
M_ByteBlock salt;
M_ByteBlock context;
M_ByteBlock iv;
M_ByteBlock label;
int n_fields;
M_KDFField *fields;
M_CipherText *kx;
};
|
Flags word. See below. |
|
Length of derived key in bits, e.g. 256 |
|
Type of derived key, e.g. |
|
PRF for randomness extraction and/or expansion, e.g. |
|
Salt parameter for randomness extraction |
|
Context parameter for expansion KDF |
|
Initial value parameter for KDF in feedback mode |
|
Label parameter for expansion KDF |
|
Number of elements in |
|
List of fields for expansion KDF (see below) |
|
Ciphertext for full key agreement |
flags
field
Possible flag bits are:
|
The |
|
Enable the extraction phase.
If the |
fields
field
This gives the list of values to concatenate to form the input to the PRF, in SP800-108r1 s4.1 step 4(a) or s5.1 step 4(a). The following fields are supported:
|
The counter value, starting from 1, in a single byte |
|
The counter value, starting from 1, in 2 bytes, in big-endian format |
|
The counter value, starting from 1, in 4 bytes, in big-endian format |
|
The counter value, starting from 1, in 2 bytes, in little-endian format |
|
The counter value, starting from 1, in 4 bytes, in little-endian format |
|
The length field, in a single byte |
|
The length field, in 2 bytes, in big-endian format |
|
The length field, in 4 bytes, in big-endian format |
|
The length field, in 2 bytes, in little-endian format |
|
The length field, in 4 bytes, in little-endian format |
|
The |
|
The |
|
A constant single-byte field with value 0 |
|
Feedback from the previous iteration, or the IV |
There are some constraints which must be followed:
-
No field may appear more than once.
-
There can only be, at most, one counter field.
-
There can only be, at most, one length field.
-
There must be either a counter field or the feedback field (or both).