Network Working Group C. Celi, Ed. Internet-Draft 10 August 2020 Intended status: Informational Expires: 11 February 2021 ACVP SP800-108 Key Derivation Function JSON Specification draft-gold-acvp-kdf-01 Status of This Memo 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 11 February 2021. Copyright Notice Copyright (c) 2020 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. Table of Contents 1. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 2 2. Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . 2 3. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 4. Terms and definitions . . . . . . . . . . . . . . . . . . . . 2 5. Supported SP800-108 KDFs . . . . . . . . . . . . . . . . . . 3 6. Test Types and Test Coverage . . . . . . . . . . . . . . . . 3 7. Capabilities Registration . . . . . . . . . . . . . . . . . . 3 7.1. Prerequisites . . . . . . . . . . . . . . . . . . . . . . 3 Celi Expires 11 February 2021 [Page 1] Internet-Draft ACVP KDFs August 2020 7.2. Required Prerequisite Algorithms for SP800-108 KDF Validations . . . . . . . . . . . . . . . . . . . . . . . 4 7.3. SP800-108 KDF Algorithm Capabilities Registration . . . . 5 7.4. Supported SP800-108 KDF Modes . . . . . . . . . . . . . . 6 7.5. Supported KDF Modes Capabilities . . . . . . . . . . . . 6 7.6. Supported SP800-108 KDF MACs . . . . . . . . . . . . . . 9 7.7. Registration Example . . . . . . . . . . . . . . . . . . 9 8. Test Vectors . . . . . . . . . . . . . . . . . . . . . . . . 10 8.1. Test Groups . . . . . . . . . . . . . . . . . . . . . . . 11 8.2. Test Cases . . . . . . . . . . . . . . . . . . . . . . . 13 9. Responses . . . . . . . . . . . . . . . . . . . . . . . . . . 13 10. Security Considerations . . . . . . . . . . . . . . . . . . . 15 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 15 12. Example SP800-108 KDF Capabilities JSON Object . . . . . . . 15 13. Example Test Vectors JSON Object . . . . . . . . . . . . . . 18 14. Example Test Results JSON Object . . . . . . . . . . . . . . 18 15. Normative references . . . . . . . . . . . . . . . . . . . . 19 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 19 1. Acknowledgements There are no acknowledgements. 2. Abstract This document defines the JSON schema for testing SP800-108 KDF implementations with the ACVP specification. 3. Introduction 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-108 KDF implementations using ACVP. 4. Terms and definitions No terms and definitions are listed in this document. Celi Expires 11 February 2021 [Page 2] Internet-Draft ACVP KDFs August 2020 5. Supported SP800-108 KDFs The following key derivation functions MAY be advertised by the ACVP compliant cryptographic module: * ACVP-KDF 6. Test Types and Test Coverage 7. Capabilities Registration 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 KDF 108 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. 7.1. Prerequisites 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 Celi Expires 11 February 2021 [Page 3] Internet-Draft ACVP KDFs August 2020 +===============+=============================+===========+ | JSON Property | Description | JSON Type | +===============+=============================+===========+ | algorithm | a prerequisite algorithm | string | +---------------+-----------------------------+-----------+ | valValue | algorithm validation number | string | +---------------+-----------------------------+-----------+ Table 1: Prerequisite Properties 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" } ] Figure 1 7.2. Required Prerequisite Algorithms for SP800-108 KDF Validations Each SP800-108 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: Celi Expires 11 February 2021 [Page 4] Internet-Draft ACVP KDFs August 2020 +==============+================+=====================+============+ | JSON Value | Description | JSON Type | Valid | | | | | Values | +==============+================+=====================+============+ | algorithm | A prerequisite | string | AES, DRBG, | | | algorithm | | CMAC, HMAC | +--------------+----------------+---------------------+------------+ | valValue | Algorithm | string | Actual | | | validation | | number or | | | number | | "same" | +--------------+----------------+---------------------+------------+ | prereqAlgVal | Prerequisite | object with | See above | | | algorithm | algorithm and | | | | validation | valValue properties | | +--------------+----------------+---------------------+------------+ | prereqVals | Prerequisite | array of | See above | | | algorithm | prereqAlgVal | | | | validations | objects | | +--------------+----------------+---------------------+------------+ Table 2: SP800-108 KDF Required Prerequisites 7.3. SP800-108 KDF Algorithm Capabilities Registration Each algorithm capability advertised is a self-contained JSON object using the following values. Celi Expires 11 February 2021 [Page 5] Internet-Draft ACVP KDFs August 2020 +==============+==========================+==============+=========+ | JSON Value | Description | JSON Type | Valid | | | | | Values | +==============+==========================+==============+=========+ | algorithm | The KDF to be validated. | string | KDF | +--------------+--------------------------+--------------+---------+ | revision | The algorithm testing | string | "1.0" | | | revision to use. | | | +--------------+--------------------------+--------------+---------+ | prereqVals | Prerequisite algorithm | array of | See | | | validations | prereqAlgVal | Section | | | | objects | 7.2 | +--------------+--------------------------+--------------+---------+ | capabilities | Array of JSON objects, | array of | See | | | each with fields | JSON objects | Section | | | pertaining to the KDF | | 7.5 | | | mode identified uniquely | | | | | by the combination of | | | | | the "kdfMode" and | | | | | indicated properties | | | +--------------+--------------------------+--------------+---------+ Table 3: SP800-108 KDF Algorithm Capabilities JSON Values | NOTE: Some optional values are required depending on the | algorithm. Failure to provide these values will result in the | ACVP server returning an error to the ACVP client during | registration. 7.4. Supported SP800-108 KDF Modes The following SP800-108 KDF modes may be advertised by the ACVP compliant crypto module: * counter * feedback * double pipeline iteration 7.5. Supported KDF Modes Capabilities 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. Celi Expires 11 February 2021 [Page 6] Internet-Draft ACVP KDFs August 2020 See the ACVP specification [ACVP] for details on the registration message. Each KDF mode's capabilities are advertised as JSON objects. The complete list of KDF key generation capabilities may be advertised by the ACVP compliant crypto module: Celi Expires 11 February 2021 [Page 7] Internet-Draft ACVP KDFs August 2020 +==================+=============+=========+======================+ | JSON Value | Description | JSON | Valid Values | | | | Type | | +==================+=============+=========+======================+ | kdfMode | The type of | string | See Section 7.4 | | | SP800-108 | | | | | KDF | | | +------------------+-------------+---------+----------------------+ | macMode | The MAC | string | See Section 7.6 | | | algorithm | | | | | used | | | +------------------+-------------+---------+----------------------+ | supportedLengths | The key | domain | Min: 1, Max: 4096 | | | lengths | | | | | supported | | | | | in bits | | | +------------------+-------------+---------+----------------------+ | fixedDataOrder | Describes | array | Any non-empty subset | | | where the | | of {"none", "after | | | counter | | fixed data", "before | | | appears in | | fixed data", "middle | | | the fixed | | fixed data", "before | | | data | | iterator"} | +------------------+-------------+---------+----------------------+ | counterLength | The length | array | Any non-empty subset | | | of the | | of {0, 8, 16, 24, | | | counter in | | 32} | | | bits | | | +------------------+-------------+---------+----------------------+ | supportsEmptyIv | Whether or | boolean | true/false | | | not the IUT | | | | | supports an | | | | | empty IV | | | +------------------+-------------+---------+----------------------+ | requiresEmptyIv | Whether or | boolean | true/false | | | not the IUT | | | | | requires an | | | | | empty IV | | | +------------------+-------------+---------+----------------------+ Table 4: KDF Mode Capabilities | NOTE 1: The 'fixedDataOrder' options "none" and "before | iterator" are not valid for "counter" KDF. The | 'fixedDataOrder' option "middle fixed data" is not valid for | "feedback" nor "double pipeline iterator" KDF. Celi Expires 11 February 2021 [Page 8] Internet-Draft ACVP KDFs August 2020 | NOTE 2: A 'counterLength' of 0 describes that there is no | counter used. The 0 option is not valid for "counter" KDF. 7.6. Supported SP800-108 KDF MACs The following MAC functions MAY be advertised by an ACVP compliant client * CMAC-AES128 * CMAC-AES192 * CMAC-AES256 * CMAC-TDES * HMAC-SHA1 * HMAC-SHA2-224 * HMAC-SHA2-256 * HMAC-SHA2-384 * HMAC-SHA2-512 * HMAC-SHA2-512/224 * HMAC-SHA2-512/256 * HMAC-SHA3-224 * HMAC-SHA3-256 * HMAC-SHA3-384 * HMAC-SHA3-512 7.7. Registration Example A registration SHALL use these properties Celi Expires 11 February 2021 [Page 9] Internet-Draft ACVP KDFs August 2020 +==============+=============================+========+=============+ | JSON | Description | JSON | Valid | | Property | | Type | Values | +==============+=============================+========+=============+ | algorithm | Name of the algorithm | string | "KDF" | | | to be validated | | | +--------------+-----------------------------+--------+-------------+ | revision | ACVP Test version | string | "1.0" | +--------------+-----------------------------+--------+-------------+ | prereqVals | Prerequisites of the | object | See | | | algorithm | | Section 7.1 | +--------------+-----------------------------+--------+-------------+ | capabilities | Properties of the | array | See | | | algorithm and mode | | Section 7.5 | | | the IUT supports | | | +--------------+-----------------------------+--------+-------------+ Table 5: Registration Properties 8. Test Vectors 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 algorithm defined during the capability exchange. This section describes the JSON schema for a test vector set used with SP800-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. Celi Expires 11 February 2021 [Page 10] Internet-Draft ACVP KDFs August 2020 +=============+======================================+===========+ | JSON Values | Description | JSON Type | +=============+======================================+===========+ | acvVersion | Protocol version identifier | string | +-------------+--------------------------------------+-----------+ | vsId | Unique numeric vector set identifier | integer | +-------------+--------------------------------------+-----------+ | algorithm | Algorithm defined in the capability | string | | | exchange | | +-------------+--------------------------------------+-----------+ | mode | Mode defined in the capability | string | | | exchange | | +-------------+--------------------------------------+-----------+ | revision | Protocol test revision selected | string | +-------------+--------------------------------------+-----------+ | testGroups | Array of test groups containing test | array | | | data, see Section 8.1 | | +-------------+--------------------------------------+-----------+ Table 6: Top Level Test Vector JSON Elements An example of this would look like this { "acvVersion": "version", "vsId": 1, "algorithm": "Alg1", "mode": "Mode1", "revision": "Revision1.0", "testGroups": [ ... ] } Figure 2 8.1. Test Groups 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 the secure hash JSON elements of the Test Group JSON object. The prompt test group for KDF is as follows: Celi Expires 11 February 2021 [Page 11] Internet-Draft ACVP KDFs August 2020 +=================+===================================+============+ | JSON Values | Description | JSON Type | +=================+===================================+============+ | tgId | Test group identifier | integer | +-----------------+-----------------------------------+------------+ | kdfMode | The kdfMode used for the test | string | | | group | | +-----------------+-----------------------------------+------------+ | macMode | Psuedorandom function HMAC or | string | | | CMAC used | | +-----------------+-----------------------------------+------------+ | counterLocation | "none", "after fixed data", | string | | | "before fixed data", "middle | | | | fixed data", or "before iterator" | | +-----------------+-----------------------------------+------------+ | keyOutLength | Expected length of the derived | integer | | | key in bits | | +-----------------+-----------------------------------+------------+ | counterLength | Expected length of the counter in | integer | | | bits | | +-----------------+-----------------------------------+------------+ | zeroLengthIv | Whether or not the group utilizes | boolean | | | a null IV | | +-----------------+-----------------------------------+------------+ | testType | Describes the operation being | string | | | performed | | +-----------------+-----------------------------------+------------+ | No | tests | Array of | | | | individual | | | | test cases | +-----------------+-----------------------------------+------------+ Table 7: Test Group JSON Object | NOTE: The feedback mode KDF counter location of "counter after | iterator" is referenced with the option "before fixed data" in | the 'counterLocation' specification. 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. Celi Expires 11 February 2021 [Page 12] Internet-Draft ACVP KDFs August 2020 8.2. Test Cases 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-108 KDF test vector. +==========+==================================+=========+ | JSON | Description | JSON | | Values | | Type | +==========+==================================+=========+ | tcId | Test case idenfitier | integer | +----------+----------------------------------+---------+ | keyIn | Input key | hex | +----------+----------------------------------+---------+ | iv | The initialization vector used | hex | | | only for feedback KDFs | | +----------+----------------------------------+---------+ | deferred | Indicates the client is required | boolean | | | to provide additional input | | | | values to complete the test case | | +----------+----------------------------------+---------+ Table 8: Test Case JSON Object | NOTE 1: If the "middle fixed data" option is used for the | 'counterLocation', then the test case is deferred from the | server. In this case, the client MUST provide a | 'breakLocation' integer value which is the length of the fixed | data before the counter is inserted. | NOTE 2: If the 'deferred' property is not present, it MAY be | assumed to be 'false'. 9. Responses 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. Celi Expires 11 February 2021 [Page 13] Internet-Draft ACVP KDFs August 2020 +===============+=============================+===========+ | JSON Property | Description | JSON Type | +===============+=============================+===========+ | acvVersion | The version of the protocol | string | +---------------+-----------------------------+-----------+ | vsId | The vector set identifier | integer | +---------------+-----------------------------+-----------+ | testGroups | The test group data | array | +---------------+-----------------------------+-----------+ Table 9: Vector Set Response JSON Object An example of this is the following { "acvVersion": "version", "vsId": 1, "testGroups": [ ... ] } Figure 3 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 | +---------------+---------------------------+-----------+ Table 10: Vector Set Group Response JSON Object An example of this is the following { "tgId": 1, "tests": [ ... ] } Figure 4 The following table describes the JSON object that represents a test case response for a SP800-108 KDF. Celi Expires 11 February 2021 [Page 14] Internet-Draft ACVP KDFs August 2020 +===============+==================================+===========+ | JSON Property | Description | JSON Type | +===============+==================================+===========+ | tcId | The test case identifier | integer | +---------------+----------------------------------+-----------+ | breakLocation | The bit location in the fixed | integer | | | data where the counter is placed | | +---------------+----------------------------------+-----------+ | fixedData | The fixed data used | hex | +---------------+----------------------------------+-----------+ | keyOut | The outputted key | hex | +---------------+----------------------------------+-----------+ Table 11: Test Case Results JSON Object 10. Security Considerations There are no additional security considerations outside of those outlined in the ACVP document. 11. IANA Considerations This document does not require any action by IANA. 12. Example SP800-108 KDF Capabilities JSON Object The following is a example JSON object advertising support for KDF. { "algorithm": "KDF", "revision": "1.0", "prereqVals": [ { "algorithm": "SHA", "valValue": "123456" }, { "algorithm": "DRBG", "valValue": "123456" } ], "capabilities": [ { "kdfMode": "counter", "macMode": [ "CMAC-AES128", "CMAC-AES192", "CMAC-AES256", Celi Expires 11 February 2021 [Page 15] Internet-Draft ACVP KDFs August 2020 "CMAC-TDES", "HMAC-SHA-1", "HMAC-SHA2-224", "HMAC-SHA2-256", "HMAC-SHA2-384", "HMAC-SHA2-512" ], "supportedLengths": [ { "min": 8, "max": 1024, "increment": 1 } ], "fixedDataOrder": [ "after fixed data", "before fixed data", "middle fixed data" ], "counterLength": [ 8, 16, 24, 32 ], "supportsEmptyIv": false }, { "kdfMode": "feedback", "macMode": [ "CMAC-AES128", "CMAC-AES192", "CMAC-AES256", "CMAC-TDES", "HMAC-SHA-1", "HMAC-SHA2-224", "HMAC-SHA2-256", "HMAC-SHA2-384", "HMAC-SHA2-512" ], "supportedLengths": [ { "min": 8, "max": 1024, "increment": 1 } ], "fixedDataOrder": [ Celi Expires 11 February 2021 [Page 16] Internet-Draft ACVP KDFs August 2020 "none", "after fixed data", "before fixed data", "before iterator" ], "counterLength": [ 0, 8, 16, 24, 32 ], "supportsEmptyIv": true, "requiresEmptyIv": false }, { "kdfMode": "double pipeline iteration", "macMode": [ "CMAC-AES128", "CMAC-AES192", "CMAC-AES256", "CMAC-TDES", "HMAC-SHA-1", "HMAC-SHA2-224", "HMAC-SHA2-256", "HMAC-SHA2-384", "HMAC-SHA2-512" ], "supportedLengths": [ { "min": 8, "max": 1024, "increment": 1 } ], "fixedDataOrder": [ "none", "after fixed data", "before fixed data", "before iterator" ], "counterLength": [ 0, 8, 16, 24, 32 ], Celi Expires 11 February 2021 [Page 17] Internet-Draft ACVP KDFs August 2020 "supportsEmptyIv": false } ] } Figure 5 13. Example Test Vectors JSON Object The following is a example JSON object for SP800-108 KDF test vectors sent from the ACVP server to the crypto module. [{ "acvVersion": "0..54" }, { "vsId": 1564, "algorithm": "counterMode", "revision": "1.0", "testGroups": [{ "tgId": 1, "kdfMode": "counter", "macMode": "CMAC-AES128", "counterLocation": "after fixed data", "keyOutLength": 1024, "counterLength": 8, "tests": [{ "tcId": 1, "keyIn": "5DA38931E8D9174BC3279C8942D2DB82", "deferred": false }, { "tcId": 2, "keyIn": "58F5426A40E3D5D2C94F0F97EB30C739", "deferred": false } ] }] } ] Figure 6 14. Example Test Results JSON Object The following is a example JSON object for SP800-108 KDF test results sent from the crypto module to the ACVP server. Celi Expires 11 February 2021 [Page 18] Internet-Draft ACVP KDFs August 2020 [{ "acvVersion": }, { "vsId": 1564, "testGroups": [{ "tgId": 1, "tests": [{ "tcId": 1, "keyOut": "94D58F22FA9092B0375F7EE6841B6775226703E3232BF9CF496E4EF3CDE1037765DDC060C08C9B3A845E288EED171535EBA97D23DCF8F6D2D4CF9D980CB4F6D270D3A7859B1FE2BFCA81F0702B5767E35BE9B96BA65C5263EB0DECD5FA721FFA57CE208F53F910DB6087E93BEE1A24E790E1DF02C140E89E04DF5299A63B71DA", "fixedData": "FBF14DF02EE6C7DABCA6EF9AF59BB9A2" }] }] } ] Figure 7 15. Normative references [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", IETF RFC 2119, IETF RFC 2119, DOI 10.17487/RFC2119, March 1997, . [RFC7991] Hoffman, P., "The "xml2rfc" Version 3 Vocabulary", IETF RFC 7991, IETF RFC 7991, DOI 10.17487/RFC7991, December 2016, . [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", IETF RFC 8174, IETF RFC 8174, DOI 10.17487/RFC8174, May 2017, . [ACVP] National Institute of Standards and Technology, "Automatic Cryptographic Validation Protocol", ACVP ACVP, 2019. Author's Address Christopher Celi (editor) Email: christopher.celi@nist.gov Celi Expires 11 February 2021 [Page 19]