Internet-Draft | ACVP DRBG | November 2024 |
Vassilev | 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 SP800-90A DRBG 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 SP800-90A DRBG 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 deterministic random bit generator algorithms MAY be advertised by the ACVP compliant cryptographic module:¶
The "ctrDRBG-TDES" mode shall only be used with the three-key option of the Triple-DES algorithm.¶
The ACVP server performs a set of tests on the IUT's DRBG in order to assess the correctness and robustness of the implementation. A typical ACVP validation session would require multiple tests to be performed for every supported permutation of DRBG capabilities. This section describes the design of the tests used to validate implementations of the DRBG algorithms. There is a single test type for DRBG testing:¶
The tests described in this document have the intention of ensuring an implementation is conformant to [SP800-90A].¶
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 DRBG 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-90A DRBG algorithm capability advertised is a self-contained JSON object using the following values.¶
JSON Value | Description | JSON type | Valid Values |
---|---|---|---|
algorithm | The DRBG algorithm to be validated | string | See Section 5 |
revision | ACVP Test version | string | "1.0" |
prereqVals | Prerequisite algorithm validations | object with algorithm and valValue properties | See above |
predResistanceEnabled | An implementation that can be used with prediction resistance. See the notes in Section 7.3 | array of boolean containing one or two distinct values | [true], [true, false], or [false] |
reseedImplemented | Reseeding of the DRBG shall be performed in accordance with the specification for the given DRBG mechanism. See the notes in Section 7.3 | boolean | true or false |
capabilities | The individual DRBG capabilities | array of capability objects | See Table 3 |
ACVP has default values for many of the input parameters for testing the DRBG algorithms. For example, the Entropy Input, Nonce, Personalization String, and Addtional Input parameters have default values. The specific details and restrictions on each of these input lengths is specified in this section and in Section 7.4. To indicate a preference for using a default value for any of these parameters, the value zero (0) should be set. If the implementation does not support one of these defaults, the corresponding supported bit length values shall be set explicitly.¶
Each DRBG algorithm capability advertised is a self-contained JSON object. A registration SHALL use these properties within each object within the 'capabilities' property.¶
JSON Value | Description | JSON type | Valid Values |
---|---|---|---|
mode | The algorithm mode to be validated | string | See the mode column of Table 4 |
derFuncEnabled | Derivation function option. See the notes below. | boolean | true/false |
entropyInputLen | See the notes below. | domain | Min: maximum security strength (see Table 4), Max: See Table 4 |
nonceLen | See the notes below. | domain | Min: half the maximum security strength (see Table 4), Max: See Table 4. Set to 0 if not supported. |
persoStringLen | Personalization string length. See the notes below. | domain | Min: maximum security strength (see Table 4), Max: See Table 4. Set to 0 if not supported |
additionalInputLen | See the notes below. | domain | Min: maximum security strength (see Table 4), Max: See Table 4. Set to 0 if not supported |
returnedBitsLen | Returned bits length | integer | Min: See Table 4, Max: 4096. |
DRBG minimum/maximum values for the properties listed in Table 3 vary depending on the DRBG capabilities registered. The following table lists those values.¶
DRBG Algorithm | Mode | Derivation Function | Max Security Strength | Min Entropy Len | Max Entropy Len | Max PersoString | Max Addl String | Min Nonce Len (please see the note following this table) | Max Nonce Len | Min returnedBits Len |
---|---|---|---|---|---|---|---|---|---|---|
ctrDRBG | "AES-128" | TRUE | 128 | 128 | 65536 | 65536 | 65536 | 64 | 65536 | 128 |
ctrDRBG | "AES-192" | TRUE | 192 | 192 | 65536 | 65536 | 65536 | 96 | 65536 | 128 |
ctrDRBG | "AES-256" | TRUE | 256 | 256 | 65536 | 65536 | 65536 | 128 | 65536 | 128 |
ctrDRBG | "TDES" | TRUE | 112 | 112 | 65536 | 65536 | 65536 | 56 | 65536 | 64 |
ctrDRBG | "AES-128" | FALSE | 128 | 256 | 256 | 256 | 256 | 0 | 0 | 128 |
ctrDRBG | "AES-192" | FALSE | 192 | 320 | 320 | 320 | 320 | 0 | 0 | 128 |
ctrDRBG | "AES-256" | FALSE | 256 | 384 | 384 | 384 | 384 | 0 | 0 | 128 |
ctrDRBG | "TDES" | FALSE | 112 | 232 | 232 | 232 | 232 | 0 | 0 | 64 |
hashDRBG | "SHA-1" | N/A | 128 | 128 | 65536 | 65536 | 65536 | 64 | 65536 | 160 |
hashDRBG | "SHA2-224" | N/A | 192 | 192 | 65536 | 65536 | 65536 | 96 | 65536 | 224 |
hashDRBG | "SHA2-256" | N/A | 256 | 256 | 65536 | 65536 | 65536 | 128 | 65536 | 256 |
hashDRBG | "SHA2-384" | N/A | 256 | 256 | 65536 | 65536 | 65536 | 128 | 65536 | 384 |
hashDRBG | "SHA2-512" | N/A | 256 | 256 | 65536 | 65536 | 65536 | 128 | 65536 | 512 |
hashDRBG | "SHA2-512/224" | N/A | 192 | 192 | 65536 | 65536 | 65536 | 96 | 65536 | 224 |
hashDRBG | "SHA2-512/256" | N/A | 256 | 256 | 65536 | 65536 | 65536 | 128 | 65536 | 256 |
hashDRBG | "SHA3-224" | N/A | 192 | 192 | 65536 | 65536 | 65536 | 96 | 65536 | 224 |
hashDRBG | "SHA3-256" | N/A | 256 | 256 | 65536 | 65536 | 65536 | 128 | 65536 | 256 |
hashDRBG | "SHA3-384" | N/A | 256 | 256 | 65536 | 65536 | 65536 | 128 | 65536 | 384 |
hashDRBG | "SHA3-512" | N/A | 256 | 256 | 65536 | 65536 | 65536 | 128 | 65536 | 512 |
hmacDRBG | "SHA-1" | N/A | 128 | 128 | 65536 | 65536 | 65536 | 64 | 65536 | 160 |
hmacDRBG | "SHA2-224" | N/A | 192 | 192 | 65536 | 65536 | 65536 | 96 | 65536 | 224 |
hmacDRBG | "SHA2-256" | N/A | 256 | 256 | 65536 | 65536 | 65536 | 128 | 65536 | 256 |
hmacDRBG | "SHA2-384" | N/A | 256 | 256 | 65536 | 65536 | 65536 | 128 | 65536 | 384 |
hmacDRBG | "SHA2-512" | N/A | 256 | 256 | 65536 | 65536 | 65536 | 128 | 65536 | 512 |
hmacDRBG | "SHA2-512/224" | N/A | 192 | 192 | 65536 | 65536 | 65536 | 96 | 65536 | 224 |
hmacDRBG | "SHA2-512/256" | N/A | 256 | 256 | 65536 | 65536 | 65536 | 128 | 65536 | 256 |
hmacDRBG | "SHA3-224" | N/A | 192 | 192 | 65536 | 65536 | 65536 | 96 | 65536 | 224 |
hmacDRBG | "SHA3-256" | N/A | 256 | 256 | 65536 | 65536 | 65536 | 128 | 65536 | 256 |
hmacDRBG | "SHA3-384" | N/A | 256 | 256 | 65536 | 65536 | 65536 | 128 | 65536 | 384 |
hmacDRBG | "SHA3-512" | N/A | 256 | 256 | 65536 | 65536 | 65536 | 128 | 65536 | 512 |
The following is an example registration.¶
{ "algorithm": "ctrDRBG", "revision": "1.0", "predResistanceEnabled": [ true, false ], "reseedImplemented": true, "capabilities": [ { "mode": "TDES", "derFuncEnabled": true, "entropyInputLen": [ 232 ], "nonceLen": [ 232 ], "persoStringLen": [ 232 ], "additionalInputLen": [ 232 ], "returnedBitsLen": 512 }, { "mode": "AES-128", "derFuncEnabled": false, "entropyInputLen": [ 256 ], "nonceLen": [ 256 ], "persoStringLen": [ 256 ], "additionalInputLen": [ 256 ], "returnedBitsLen": 512 } ] }¶
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 SP800-90A DRBG 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 SP800-90A DRBG JSON elements of the Test Group JSON object¶
JSON Value | Description | JSON type |
---|---|---|
tgId | Test group identifier | integer |
mode | The mode of the DRBG, see Section 5 | string |
derFunc | Use derivation function or not | boolean |
predResistance | Use prediction resistance | boolean |
reSeed | Use reseeding | boolean |
entropyInputLen | Entropy length | integer |
nonceLen | Nonce length; set to 0 if not used/supported. See also notes after Table 3 above | integer |
persoStringLen | Personalization string length; set to 0 if not used/supported. See also notes after Table 3 above | integer |
additonalInputLen | Additional input length; set to 0 if not used/supported. See also notes after Table 3 above | integer |
returnedBitsLen | returned bits length | integer |
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' (see Section 6) the group is addressing.¶
Prediction Resistance Assurance Options | Test Procedure |
---|---|
"predResistanceEnabled" : true; "reseedImplemented": true | |
Instantiate DRBG | |
Generate but don't output | |
Generate output | |
Uninstantiate | |
"predResistanceEnabled" : false; "reseedImplemented" : true | |
Instantiate DRBG | |
Reseed | |
Generate but don't output | |
Generate output | |
Uninstantiate | |
"predResistanceEnabled" : true/false; "reseedImplemented": false | |
Instantiate DRBG | |
Generate but don't output | |
Generate output | |
Uninstantiate |
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 SP800-90A DRBG test vector.¶
JSON Value | Description | JSON type |
---|---|---|
tcId | Test case idenfitier | integer |
entropyInput | Entropy value | hex |
nonce | Value of the nonce | hex |
persoString | value of the personlization string | hex |
otherInput | array of additonal input/entropy input value pairs for testing. See Table 9 | array |
Each test group contains an array of one or more tests. Each test object contains an otherInput object, which is an array of objects, each with the intendedUse property indicating if the particular test data is to be used for reSeed or generate - see Table 7. Each test vector is a JSON object that represents a single test case to be processed by the ACVP client. The following table describes the JSON elements for each DRBG predcition resistance test vector.¶
JSON Value | Description | JSON type |
---|---|---|
additionalInput | value of the additional input string to use in predition resistance tests | hex |
entropyInput | value of the entropy input to use in prediction resistance tests | hex |
intendedUse | "reSeed", "generate" | string |
Here is an abbreviated yet fully constructed example of the prompt¶
{ "vsId": 1, "algorithm": "ctrDRBG", "revision": "1.0", "testGroups": [ { "tgId": 1, "testType": "AFT", "derFunc": true, "reSeed": true, "predResistance": true, "entropyInputLen": 256, "nonceLen": 256, "persoStringLen": 256, "additionalInputLen": 256, "returnedBitsLen": 512, "mode": "AES-128", "tests": [ { "tcId": 1, "entropyInput": "E9EDA8BF1E6155BDF11AD74E2702004C20B39...", "nonce": "D77D611F0665CBFD7E00D5E5118629F5F40996B764F0...", "persoString": "E9ADEA726418EF002C03DC2196296D4B273AB6...", "otherInput": [ { "intendedUse": "generate", "additionalInput": "52F47C6A1B12C202D309D062C3EE09...", "entropyInput": "C30F4C916B90A79B5764DC6FA950B3F34..." }, { "intendedUse": "generate", "additionalInput": "4FFDE712D249A99006F46D7070D5CA...", "entropyInput": "8A4724F1514C480DE1604C5D870CFA464..." } ] }, { "tcId": 2, "entropyInput": "DC1B4E9B1782A9E701CB2A74EDBDF483462E9...", "nonce": "A5B7D117BDE77D46A65DBD0EBA085C4376C7B72F164E...", "persoString": "D7FC54DD4E759C8D3FCE61463ED40BE130D2B4...", "otherInput": [ { "intendedUse": "generate", "additionalInput": "28EFD5114D06D1A065863C50BDD2DE...", "entropyInput": "F5C9DF132A4C066C5D0AFEE79FBC7EB07..." }, { "intendedUse": "generate", "additionalInput": "D1AACBAE8BA37208161CBA9042BB92...", "entropyInput": "5C6D2F80696D1691FCA40B0C3444CE927..." } ] } ] } ] }¶
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 following table describes the JSON object that represents a test case response for a SP800-90A DRBG.¶
JSON Property | Description | JSON Type |
---|---|---|
tcId | The test case identifier | integer |
returnedBits | The outputted bits from the DRBG | hex |
Here is an abbreviated example of the response¶
{ "vsId": 1, "algorithm": "ctrDRBG", "revision": "1.0", "testGroups": [ { "tgId": 1, "tests": [ { "tcId": 1, "returnedBits": "99F0D5740DCAA1ECC4E5329B38B..." }, { "tcId": 2, "returnedBits": "62A458CA72C19316A1ECBC3211B..." } ] } ] }¶
There are no additional security considerations outside of those outlined in the ACVP document.¶
This document does not require any action by IANA.¶
The following is a example JSON object advertising support for ctrDRBG with TDES and all key sizes of AES.¶
The following is a example JSON object advertising support for hashDRBG with various SHA sizes. Note that in this example the implementation works with or without additional input and personalization data.¶
The following is a example JSON object for ctrDRBG test vectors sent from the ACVP server to the crypto module.¶
The following is a example JSON object for hmacDRBG test vectors sent from the ACVP server to the crypto module.¶
The following is a example JSON object for hashDRBG test vectors sent from the ACVP server to the crypto module. In this example the implementation is tested without additional input and personalization data.¶
The following is a example JSON object for hashDRBG test vectors sent from the ACVP server to the crypto module. In this example the implementation is tested with "predResistance": false, "reSeed": true options.¶
The following is a example JSON object for hashDRBG test vectors sent from the ACVP server to the crypto module. In this example the implementation is tested with "predResistance": false, "reSeed": false options.¶
The following is a example JSON object for ctrDRBG with TDES test results sent from the crypto module to the ACVP server.¶
The following is a example JSON object for HMAC_DRBG test results sent from the crypto module to the ACVP server.¶
The following is a example JSON object for hashDRBG test results sent from the crypto module to the ACVP server.¶
The following is a example JSON object for hashDRBG test results sent from the crypto module to the ACVP server.¶
The following is a example JSON object for hashDRBG test results sent from the crypto module to the ACVP server.¶