Internet-Draft | ACVP SafePrimes | November 2024 |
Hammett | 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. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
There are no acknowledgements.¶
This document defines the JSON schema for testing SafePrimes 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 SafePrimes 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 Safe Prime operations MAY be advertised by the ACVP compliant cryptographic module listed as "algorithm" / "mode" / "revision":¶
The ACVP server performs a set of tests on the specified SafePrimes algorithm in order to assess the correctness and robustness of the implementation. A typical ACVP validation session SHALL require multiple tests to be performed for every supported permutation of SafePrimes capabilities. This section describes the design of the tests used to validate implementations of the SafePrimes algorithms.¶
0 < x < q
and y = g^x mod p
.¶
The tests described in this document have the intention of ensuring an implementation is conformant to [SP800-56Ar3], [RFC3526], and [RFC7919].¶
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 SafePrimes 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 safePrimes / * / * implementation relies on other cryptographic primitives. For example, safePrimes / * / * uses an underlying SHA 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 | DRBG, SHA, SHA_OPT2 |
valValue | algorithm validation number | string | actual number or "same" |
prereqAlgVal | prerequistie algorithm validation | object with algorithm and valValue properties | see above |
prereqVals | prerequistie algorithm validations | array of prereqAlgVal objects | see above |
Each algorithm capability advertised is a self-contained JSON object using the following values.¶
JSON Value | Description | JSON Type | Valid Values |
---|---|---|---|
algorithm | The algorithm under test | string | "safePrimes" |
mode | The SafePrimes mode to be validated | string | "keyGen" or "keyVer" |
revision | The algorithm testing revision to use | string | "1.0" |
prereqVals | Prerequisite algorithm validations | array of prereqAlgVal objects | See Table 2 |
safePrimeGroups | Safe prime groups to test with | array of string | Any non-empty subset of {"MODP-2048", "MODP-3072", "MODP-4096", "MODP-6144", "MODP-8192", "ffdhe2048", "ffdhe3072", "ffdhe4096", "ffdhe6144", "ffdhe8192"} |
A safePrime / keyGen / 1.0 registration looks like the following¶
{ "algorithm": "safePrimes", "mode": "keyGen", "revision": "1.0", "prereqVals": [{ "algorithm": "DRBG", "valValue": "123456" }], "safePrimeGroups": [ "ffdhe2048", "MODP-2048" ] }¶
A safePrime / keyVer / 1.0 registration looks like the following¶
{ "algorithm": "safePrimes", "mode": "keyVer", "revision": "1.0", "prereqVals": [{ "algorithm": "DRBG", "valValue": "123456" }], "safePrimeGroups": [ "ffdhe2048", "MODP-2048" ] }¶
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 SafePrimes 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 9 | array |
An example of this would look like this¶
[ { "acvVersion": <version> }, { "vsId": 1, "algorithm": "Alg1", "mode": "Mode1", "revision": "Revision1.0", "testGroups": [ ... ] } ]¶
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 session would require multiple test vector sets to be downloaded and processed by the ACVP client. Each test vector set represents an individual crypto algorithm, such as SafePrimes / keyVer / 1.0, etc. This section describes the JSON schema for a test vector set used with Safe Primes crypto 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 Value | Description | JSON type |
---|---|---|
acvVersion | Protocol version identifier | string |
vsId | Unique numeric identifier for the vector set | integer |
algorithm | The algorithm used for the test vectors | string |
mode | The mode used for the test vectors | string |
revision | The algorithm testing revision to use | string |
testGroups | Array of test group JSON objects, which are defined in Section 9.1, or Section 9.2 depending on the algorithm | array |
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 secure hash JSON elements of the Test Group JSON object.¶
The test group for safePrime / keyGen / 1.0 is as follows:¶
JSON Value | Description | JSON type |
---|---|---|
tgId | The test group identifier | integer |
testType | The test operation performed | string |
safePrimeGroup | The safe prime group that the IUT should use for generating keys | string |
tests | Array of individual test vector JSON objects, which are defined in Section 9.1.2 | array |
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 safePrime / keyGen / 1.0 test vector.¶
JSON Value | Description | JSON type |
---|---|---|
tcId | Numeric identifier for the test case, unique across the entire vector set | integer |
deferred | States that the values are generated by the client | boolean |
The following is an example JSON object sent from the server to the client for safePrimes / keyGen / 1.0.¶
[ { "acvVersion": <acvp-version> }, { "vsId": 0, "algorithm": "safePrimes", "mode": "keyGen", "revision": "1.0", "testGroups": [ { "tgId": 1, "safePrimeGroup": "ffdhe2048", "testType": "AFT", "tests": [ { "tcId": 1 }, { "tcId": 2 }, { "tcId": 3 } ] }, { "tgId": 2, "testType": "AFT", "safePrimeGroup": "MODP-2048", "tests": [ { "tcId": 4 }, { "tcId": 5 }, { "tcId": 6 } ] } ] } ]¶
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 secure hash JSON elements of the Test Group JSON object.¶
The test group for safePrime / keyVer / 1.0 is as follows:¶
JSON Value | Description | JSON type |
---|---|---|
tgId | The test group identifier | integer |
testType | The test operation performed | string |
safePrimeGroup | The safe prime group that the IUT should use for validating keys | string |
tests | Array of individual test vector JSON objects, which are defined in Section 9.2.2 | array |
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 safePrime / keyVer / 1.0 test vector.¶
JSON Value | Description | JSON type |
---|---|---|
tcId | Numeric identifier for the test case, unique across the entire vector set | integer |
x | The private key component X | hex |
y | The public key component Y | hex |
The following is an example JSON object sent from the server to the client for safePrimes / keyVer / 1.0.¶
[ { "acvVersion": <acvp-version> }, { "vsId": 0, "algorithm": "safePrimes", "mode": "keyVer", "revision": "1.0", "testGroups": [ { "tgId": 1, "safePrimeGroup": "ffdhe2048", "testType": "AFT", "tests": [ { "tcId": 1, "x": "399C088E4A1E1A03...", "y": "FADA8667E9126779..." }, { "tcId": 2, "x": "1DB3138EF400DDA7...", "y": "70AACAB9A69AFE62..." }, { "tcId": 3, "x": "099B19789CF2239F...", "y": "C8F7038CB275E50F..." } ] }, { "tgId": 2, "testType": "AFT", "safePrimeGroup": "MODP-2048", "tests": [ { "tcId": 4, "x": "248091D90CB00F58EF...", "y": "C08BF18980879C066E..." }, { "tcId": 5, "x": "74B61CE8B689BAA23B...", "y": "8EE385FFA770C9C9BF..." }, { "tcId": 6, "x": "1B73FF75B0A20D99D0...", "y": "4BF4509C0258E8E484..." } ] } ] } ]¶
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 ACVP version used | string |
vsId | The vector set identifier | integer |
testGroups | The test group objects in the response, see Table 11 | 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 distributes vectors. Some algorithm / mode / revision combinations might require that additional test group properties are provided in the response.¶
JSON Property | Description | JSON Type |
---|---|---|
tgId | The test group identifier | integer |
tests | The test case objects in the response, depending on the algorithm see Table 13 or Table 15 | array |
An example of this is the following¶
{ "tgId": 1, "tests": [ ... ] }¶
The test groups for SafePrimes / keyGen / 1.0 contain public key properties. The groups can be described using the following table.¶
JSON Value | Description | JSON type |
---|---|---|
tgId | The test group identifier | integer |
tests | The individual test cases for the group | array |
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 safePrimes / keyGen / 1.0 test vector.¶
JSON Value | Description | JSON type |
---|---|---|
tcId | The test case identifier | integer |
x | The private key component X | hex |
y | The public key component Y | hex |
The following is an example JSON test vector response object for safePrimes / keyGen / 1.0.¶
[ { "acvVersion": <acvp-version> }, { "vsId": 0, "testGroups": [ { "tgId": 1, "tests": [ { "tcId": 1, "x": "6316A9021906CB3F9F6...", "y": "8520DE9F113D659F708..." } ] } ] } ]¶
The test groups for SafePrimes / keyVer / 1.0 contain public key properties. The groups can be described using the following table.¶
JSON Value | Description | JSON type |
---|---|---|
tgId | The test group identifier | integer |
tests | The individual test cases for the group | array |
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 SafePrimes / keyVer / 1.0 test vector.¶
JSON Value | Description | JSON type |
---|---|---|
tcId | The test case identifier | integer |
testPassed | Whether or not the key verified | boolean |
The following is an example JSON test vector response object for SafePrimes / keyVer / 1.0.¶
[ { "acvVersion": <acvp-version> }, { "vsId": 0, "testGroups": [ { "tgId": 1, "tests": [ { "tcId": 1, "testPassed": true } ] } ] } ]¶
There are no additional security considerations outside of those outlined in the ACVP document.¶
This document does not require any action by IANA.¶