Internet-Draft | ACVP KDFs | November 2024 |
Celi | Expires 5 May 2025 | [Page] |
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 5 May 2025.¶
Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document.¶
There are no acknowledgements.¶
This document defines the JSON schema for testing SP 800-108 KDF implementations with the ACVP specification.¶
The Automated Crypto Validation Protocol (ACVP) defines a mechanism to automatically verify the cryptographic implementation of a software or hardware crypto module. The ACVP specification defines how a crypto module communicates with an ACVP server, including crypto capabilities negotiation, session management, authentication, vector processing and more. The ACVP specification does not define algorithm specific JSON constructs for performing the crypto validation. A series of ACVP sub-specifications define the constructs for testing individual crypto algorithms. Each sub-specification addresses a specific class of crypto algorithms. This sub-specification defines the JSON constructs for testing SP 800-108 KDF implementations using ACVP.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 of [RFC2119] and [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
The initial request from the client to the server describing the capabilities of one or several algorithm, mode and revision combinations¶
A collection of test cases that share similar properties within a prompt or response¶
A collection of test groups under a specific algorithm, mode, and revision¶
JSON sent from the server to the client that specifies the correctness of the response¶
The following key derivation functions MAY be advertised by the ACVP compliant cryptographic module:¶
This section describes the design of the tests used to validate SP 800-108 KDF implementations.¶
There is only one test type: functional tests. Each has a specific value to be used in the testType field. The testType field definition is:¶
The tests described in this document have the intention of ensuring an implementation is conformant to [SP800-108r1].¶
ACVP requires crypto modules to register their capabilities. This allows the crypto module to advertise support for specific algorithms, notifying the ACVP server which algorithms need test vectors generated for the validation process. This section describes the constructs for advertising support of SP 800-108 KDF algorithms to the ACVP server.¶
The algorithm capabilities MUST be advertised as JSON objects within the 'algorithms' value of the ACVP registration message. The 'algorithms' value is an array, where each array element is an individual JSON object defined in this section. The 'algorithms' value is part of the 'capability_exchange' element of the ACVP JSON registration message. See the ACVP specification [ACVP] for more details on the registration message.¶
Each algorithm implementation MAY rely on other cryptographic primitives. For example, RSA Signature algorithms depend on an underlying hash function. Each of these underlying algorithm primitives must be validated, either separately or as part of the same submission. ACVP provides a mechanism for specifying the required prerequisites:¶
Prerequisites, if applicable, MUST be submitted in the registration as the prereqVals
JSON property array inside each element of the algorithms
array. Each element in the prereqVals
array MUST contain the following properties¶
JSON Property | Description | JSON Type |
---|---|---|
algorithm | a prerequisite algorithm | string |
valValue | algorithm validation number | string |
A "valValue" of "same" SHALL be used to indicate that the prerequisite is being met by a different algorithm in the capability exchange in the same registration.¶
An example description of prerequisites within a single algorithm capability exchange looks like this¶
"prereqVals": [ { "algorithm": "Alg1", "valValue": "Val-1234" }, { "algorithm": "Alg2", "valValue": "same" } ]¶
Each SP800-108r1 KDF implementation relies on other cryptographic primitives. For example, the KDF must utilize an underlying MAC algorithm. Each of these underlying algorithm primitives must be validated, either separately or as part of the same submission. ACVP provides a mechanism for specifying the required prerequisites:¶
JSON Value | Description | JSON Type | Valid Values |
---|---|---|---|
algorithm | A prerequisite algorithm | string | AES, DRBG, CMAC, HMAC |
valValue | Algorithm validation number | string | Actual number or "same" |
prereqAlgVal | Prerequisite algorithm validation | object with algorithm and valValue properties | See above |
prereqVals | Prerequisite algorithm validations | array of prereqAlgVal objects | See above |
Each algorithm capability advertised is a self-contained JSON object using the following values.¶
Two algorithm registrations are possible to test SP 800-108r1 KDFs. The first is for the "KDF" / "1.0" which covers the counter, feedback, and double pipeline iteration key derivation functions. The second is for "KDF" / "KMAC" / "Sp800-108r1" which covers the KMAC function when used as a key derivation function, introduced in the new revision, SP 800-108r1. A registration SHALL use these properties:¶
JSON Property | Description | JSON Type | Valid Values |
---|---|---|---|
algorithm | The KDF to be validated. | string | "KDF" |
mode | The KDF mode to be validated. | string | "KMAC" or "" |
revision | The algorithm testing revision to use. | string | "1.0" when "mode" is not included, or "Sp800-108r1" when "mode" is set to "KMAC" |
prereqVals | Prerequisite algorithm validations | array of prereqAlgVal objects | See Section 7.2 |
capabilities | Array of JSON objects, each with fields pertaining to the KDF mode identified uniquely by the combination of the "kdfMode" and indicated properties | array of JSON objects | See Section 7.3.2 |
The following SP800-108 KDF modes or "modes of iteration" may be advertised by the ACVP compliant crypto module as the "kdfMode" property:¶
The KDF mode capabilities are advertised as JSON objects within the 'capabilities' value of the ACVP registration message - see Table 2. The 'capabilities' value is an array, where each array element is a JSON object corresponding to a particular KDF mode defined in this section. The 'capabilities' value is part of the 'capability_exchange' element of the ACVP JSON registration message. See the ACVP specification [ACVP] for details on the registration message.¶
Each KDF mode's capabilities are advertised as JSON objects.¶
The following table describes the capabilities that may be advertised by the ACVP compliant crypto module for "KDF" / / "1.0":¶
JSON Value | Description | JSON Type | Valid Values |
---|---|---|---|
kdfMode | The type of SP800-108r1 KDF or "mode of iteration" | string | See Section 7.3.1 |
macMode | The MAC or PRF algorithm used | array of string | See Section 7.3.3 |
supportedLengths | The supported derived keying material lengths in bits | domain | Min: 1, Max: 4096 |
fixedDataOrder | Describes where the counter appears in the fixed data | array | Any non-empty subset of {"none", "after fixed data", "before fixed data", "middle fixed data", "before iterator"} |
counterLength | The length of the counter in bits | array | Any non-empty subset of {0, 8, 16, 24, 32} |
supportsEmptyIv | Whether or not the IUT supports an empty IV | boolean | true/false |
requiresEmptyIv | Whether or not the IUT requires an empty IV | boolean | true/false |
customKeyInLength | Optional value used to control the length of the keyIn produced by the ACVP server for the capability. This field cannot be used to alter the keyIn length for AES/TDES based macModes, as the keyIns expected by those algorithms is fixed. | integer | 112-4096 |
The following table describes the capabilities that may be advertisd by the ACVP compliant crypto module for "KDF" / "KMAC" / "Sp800-108r1":¶
JSON Value | Description | JSON Type | Valid Values |
---|---|---|---|
macMode | The MAC or PRF algorithm used | array of string | See Section 7.3.3 |
keyDerivationKeyLength | The lengths of the key derivation key in bits | domain | Min: 112, Max: 4096, Inc: 8 |
contextLength | The lengths of the context field in bits | domain | Min: 8, Max: 4096, Inc: 8 |
labelLength | The lengths of the label field in bits. This field can be excluded if no label is used. | domain | Min: 8, Max: 4096, Inc: 8 |
derivedKeyLength | The lengths of the derived keys in bits | domain | Min: 112, Max: 4096, Inc: 8 |
The following MAC or PRF functions MAY be advertised by an ACVP compliant client¶
The following is a example JSON object advertising support for "KDF" / / "1.0".¶
The following is a example JSON object advertising support for a "KDF" / "KMAC" / "Sp800-108r1".¶
The ACVP server provides test vectors to the ACVP client, which are then processed and returned to the ACVP server for validation. A typical ACVP validation test session would require multiple test vector sets to be downloaded and processed by the ACVP client. Each test vector set represents an individual cryptographic algorithm defined during the capability exchange. This section describes the JSON schema for a test vector set used with SP 800-108 KDF algorithms.¶
The test vector set JSON schema is a multi-level hierarchy that contains meta data for the entire vector set as well as individual test vectors to be processed by the ACVP client. The following table describes the JSON elements at the top level of the hierarchy.¶
JSON Values | Description | JSON Type |
---|---|---|
acvVersion | Protocol version identifier | string |
vsId | Unique numeric vector set identifier | integer |
algorithm | Algorithm defined in the capability exchange | string |
mode | Mode defined in the capability exchange | string |
revision | Protocol test revision selected | string |
testGroups | Array of test group JSON objects, which are defined in Section 8.1 | array |
An example of this would look like this¶
[ { "acvVersion": <version> }, { "vsId": 1, "algorithm": "Alg1", "mode": "Mode1", "revision": "Revision1.0", "testGroups": [ ... ] } ]¶
The testGroups element at the top level in the test vector JSON object is an array of test groups. Test vectors are grouped into similar test cases to reduce the amount of data transmitted in the vector set. For instance, all test vectors that use the same key size would be grouped together. The Test Group JSON object contains meta data that applies to all test vectors within the group. The following table describes the SP 800-108 KDF JSON elements of the Test Group JSON object for "KDF" / / "1.0".¶
JSON Values | Description | JSON Type |
---|---|---|
tgId | Test group identifier | integer |
kdfMode | The kdfMode used for the test group | string |
macMode | Psuedorandom function (PRF) HMAC, CMAC, or KMAC used | string |
counterLocation | "none", "after fixed data", "before fixed data", "middle fixed data", or "before iterator" | string |
keyOutLength | Expected length of the derived keying material or key in bits | integer |
counterLength | Expected length of the counter in bits | integer |
zeroLengthIv | Whether or not the group utilizes a null IV | boolean |
testType | Describes the operation being performed | string |
tests | Array of individual test cases | array |
For "KDF" / "KMAC" / "Sp800-108r1" the following table describes the JSON elements of the Test Group JSON object.¶
JSON Values | Description | JSON Type |
---|---|---|
tgId | Test group identifier | integer |
macMode | Psuedorandom function (PRF) KMAC used | string |
testType | Describes the operation being performed | string |
tests | Array of individual test cases | array |
The 'tgId', 'testType' and 'tests' objects MUST appear in every test group element communicated from the server to the client as a part of a prompt. Other properties are dependent on which 'testType' the group is addressing.¶
Each test group contains an array of one or more test cases. Each test case is a JSON object that represents a single test vector to be processed by the ACVP client. The following table describes the JSON elements for each SP 800-108 KDF "KDF" / / "1.0" test vector.¶
JSON Values | Description | JSON Type |
---|---|---|
tcId | Test case idenfitier | integer |
keyIn | Input key | hex |
iv | The initialization vector used only for feedback KDFs | hex |
The following table describes the JSON elements for each "KDF" / "KMAC" / "Sp800-108r1" test vector.¶
JSON Values | Description | JSON Type |
---|---|---|
tcId | Test case idenfitier | integer |
keyDerivationKey | Input key | hex |
context | The context value used | hex |
label | The label value used | hex |
derivedKeyLength | The expected length of the derived key | integer |
The following is a example JSON object for SP 800-108r1 KDF "KDF" / / "1.0" test vectors sent from the ACVP server to the crypto module.¶
The following is a example JSON object for "KDF" / "KMAC" / "Sp800-108r1" test vectors sent from the ACVP server to the crypto module.¶
After the ACVP client downloads and processes a vector set, it must send the response vectors back to the ACVP server. The following table describes the JSON object that represents a vector set response.¶
JSON Property | Description | JSON Type |
---|---|---|
acvVersion | The version of the protocol | string |
vsId | The vector set identifier | integer |
testGroups | The test group data | array |
An example of this is the following¶
{ "acvVersion": "version", "vsId": 1, "testGroups": [ ... ] }¶
The testGroups section is used to organize the ACVP client response in a similar manner to how it receives vectors. Several algorithms SHALL require the client to send back group level properties in their response. This structure helps accommodate that.¶
JSON Property | Description | JSON Type |
---|---|---|
tgId | The test group identifier | integer |
tests | The test case data | array |
An example of this is the following¶
{ "tgId": 1, "tests": [ ... ] }¶
The testCase section is used to organize the ACVP client response in a similar manner to how it receives vectors. Several algorithms SHALL require the client to send back group level properties in their response. This structure helps accommodate that.¶
The following table describes the JSON properties that represent a test case response for "KDF" / / "1.0".¶
JSON Property | Description | JSON Type |
---|---|---|
tcId | The test case identifier | integer |
breakLocation | The bit location in the fixed data where the counter is placed. breakLocation is only applicable and SHALL be included for test cases where counterLocation is "middle fixed data". | integer |
fixedData | The fixed input data used by the IUT | hex |
keyOut | The outputted keying material or key | hex |
The following table describes the JSON properties that represent a test case response for "KDF" / "KMAC" / "Sp800-108r1".¶
JSON Property | Description | JSON Type |
---|---|---|
tcId | The test case identifier | integer |
derivedKey | The outputted keying material or key | hex |
The following is an abbreviated example of a JSON object for "KDF" / / "1.0" test results sent from the crypto module to the ACVP server.¶
The following is an example of a JSON object for "KDF" / "KMAC" / "Sp800-108r1" test results sent from the crypto module to the ACVP server.¶
There are no additional security considerations outside of those outlined in the ACVP document.¶
This document does not require any action by IANA.¶