Network Working Group C. Celi
Internet-Draft National Institute of Standards and Technology
Intended status: Informational June 5, 2019
Expires: December 7, 2019

ACVP ANS x9.42 Key Derivation Function JSON Specification
draft-celi-acvp-ans-x942-00

Abstract

This document defines the JSON schema for testing ANS x9.42 KDF implementations with the ACVP specification.

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 December 7, 2019.

Copyright Notice

Copyright (c) 2019 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 Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.


Table of Contents

1. 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 ANS x9.42 KDF implementations using ACVP.

2. Terms and Definitions

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 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.

This document also refers to the following terms and definitions:

Prompt

thing
Registration

thing
Response

thing
Test Case

thing
Test Group

thing
Test Vector Set

thing
Validation

thing

3. Supported KDFs

The following key derivation functions MAY be advertised by the ACVP compliant cryptographic module:

4. Test Types and Test Coverage

This section describes the design of the tests used to validate ANS x9.42 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 definitions are:

"AFT" - Algorithm Functional Test. These tests can be processed by the client using a normal 'derive_key' operation. AFTs cause the implementation under test to exercise nomral operations on a single block, multiple blocks, or partial blocks. In all cases, random data is used. The functional tests are designed to verify that the logical components of the key deriviation process are operating correctly.

4.1. Test Coverage

The tests described in this document have the intention of ensuring an implementation is conformant to XXX.

5. 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.

The algorithm capabilities are 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 for more details on the registration message.

5.1. Prerequisites

Each algorithm implementation MAY rely on other cryptographic primitives. For example, XXXXXX. 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 Valid Values
algorithm a prerequisite algorithm string XXX
valValue algorithm validation number string XXX

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 prequisites within a single algorithm capability exchange looks like this

"prereqVals":
[
	{
		"algorithm": "Alg1",
		"valValue": "Val-1234"
	},
	{
		"algorithm": "Alg2",
		"valValue": "same"
	}
]

5.2. Property Registration

The ANS x9.42 KDF mode capabilities are advertised as JSON objects within the 'capabilities_exchange' property.

5.3. Registration Example

A registration SHALL use these properties

JSON Property Description JSON Type Valid Values
algorithm Name of the algorithm to be validated string "kdf-components"
mode Mode of the algorithm to be validated string "ansix9.42"
revision ACVP Test version string "1.0"
prereqVals Prerequisites of the algorithm object See Section 5.1
kdfType The type of KDF array "DER" and/or "concatenation"
keyLen The length of the output key in bits domain Min: 1, Max: 65536
otherInfoLen The length of the other info in bits domain Min: 0, Max: 65536
zzLen The length of ZZ in bits domain Min: 1, Max: 65536
hashAlg The supported hash algorithms array See Section 5.3.1

An example registration within an algorithm capability exchange looks like this

"capability_exchange":
[
	{
		"algorithm": "kdf-components",
		"mode": "ansix9.42",
		"revision": "1.0",
		"prereqVals": [
			{
				"algorithm": "SHA",
				"valValue": "same"
			}
		 ],
		"kdfType": [
			"DER",
			"concatenation"
		],
		"keyLen": [
			256,
			1024
		],
		"otherInfoLen": [
			0,
			1024
		],
		"zzLen": [
			8,
			1024
		],
		"hashAlg": [
			"sha-1",
			"sha2-224",
			"sha2-256",
			"sha2-384",
			"sha2-512",
			"sha2-512/224",
			"sha2-512/256",
			"sha3-224",
			"sha3-256",
			"sha3-384",
			"sha3-512"
		]
	}
]

5.3.1. Valid Hash Functions

The following hash functions MAY be advertised by an ACVP compliant client under the 'hashAlg' property

6. 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 ANS x9.42 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 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 groups containing test data array

An example of this would look like this

{
	"acvVersion": "version",
	"vsId": 1,
	"algorithm": "Alg1",
	"mode": "Mode1",
	"revision": "Revision1.0",
	"testGroups": [ ... ]
}

6.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 ANS x9.42 KDF JSON elements of the Test Group JSON object

JSON Values Description JSON Type
tgId Test group identifier integer
kdfType The type of ANS x9.42 KDF string
zzLen The length of ZZ in bits integer
otherInfoLen The length of the other info in bits integer
keyLen The key output length in bits integer
hashAlg The hash algorithm used string
testType Describes the operation the client should perform on the tests data 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.

6.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 ANS x9.42 KDF test vector.

JSON Values Description JSON Type
tcId Test case idenfitier integer
zz Zz value hex
otherInfo Other info value hex

Here is an abbreviated yet fully constructed example of the prompt

{
  "vsId": 1,
  "algorithm": "kdf-components",
  "mode": "ansix9.42",
  "revision": "1.0",
  "testGroups": [
    {
      "tgId": 1,
      "testType": "AFT",
      "tests": [
        {
          "tcId": 1,
          "zz": "F2",
          "otherInfo": ""
        },
        {
          "tcId": 2,
          "zz": "96",
          "otherInfo": ""
        }
      ],
      "hashAlg": "SHA-1",
      "keyLen": 256,
      "kdfType": "DER",
      "otherInfoLen": 0,
      "zzLen": 8
    }
  ]
}

7. 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.

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 ANS x9.42 KDF.

JSON Property Description JSON Type
tcId The test case identifier integer
derivedKey The outputted key hex

Here is an abbreviated example of the response

{
  "vsId": 1,
  "algorithm": "kdf-components",
  "mode": "ansix9.42",
  "revision": "1.0",
  "testGroups": [
    {
      "tgId": 1,
      "tests": [
        {
          "tcId": 1,
          "derivedKey": "986B212420E3B977068244E6BD..."
        },
        {
          "tcId": 2,
          "derivedKey": "B8F3EEC6B5FA270FB05644DE40..."
        }
      ]
    }
  ]
}

8. Security Considerations

There are no additional security considerations outside of those outlined in the ACVP document.

9. IANA Considerations

This document does not require any action by IANA.

10. Acknowledgements

There are no acknowledgements.

11. References

11.1. Normative References

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997.
[RFC7991] Hoffman, P., "The "xml2rfc" Version 3 Vocabulary", RFC 7991, DOI 10.17487/RFC7991, December 2016.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017.

11.2. Informative References

[I-D.ribose-asciirfc] Tse, R., Nicholas, N. and P. Brasolin, "AsciiRFC: Authoring Internet-Drafts And RFCs Using AsciiDoc", Internet-Draft draft-ribose-asciirfc-08, April 2018.
[IETF.TLP] IETF, "IETF Trust Legal Provisions (TLP)", April 2018.
[RFC3552] Rescorla, E. and B. Korver, "Guidelines for Writing RFC Text on Security Considerations", BCP 72, RFC 3552, DOI 10.17487/RFC3552, July 2003.
[RFC5378] Bradner, S. and J. Contreras, "Rights Contributors Provide to the IETF Trust", BCP 78, RFC 5378, DOI 10.17487/RFC5378, November 2008.
[RFC7253] Krovetz, T. and P. Rogaway, "The OCB Authenticated-Encryption Algorithm", RFC 7253, DOI 10.17487/RFC7253, May 2014.
[RNP] Ribose Inc., "RNP: A C library approach to OpenPGP", March 2018.

Author's Address

Christopher Celi National Institute of Standards and Technology 100 Bureau Drive Gaithersburg, 20899 United States of America EMail: christopher.celi@nist.gov