forked from usnistgov/ACVP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdraft-celi-acvp-ans-x942.txt
728 lines (479 loc) · 23.5 KB
/
draft-celi-acvp-ans-x942.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
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.
Celi Expires December 7, 2019 [Page 1]
Internet-Draft ACVP ANS x9.42 KDF June 2019
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
2. Terms and Definitions . . . . . . . . . . . . . . . . . . . . 2
3. Supported KDFs . . . . . . . . . . . . . . . . . . . . . . . 3
4. Test Types and Test Coverage . . . . . . . . . . . . . . . . 3
4.1. Test Coverage . . . . . . . . . . . . . . . . . . . . . . 3
5. Capabilities Registration . . . . . . . . . . . . . . . . . . 4
5.1. Prerequisites . . . . . . . . . . . . . . . . . . . . . . 4
5.2. Property Registration . . . . . . . . . . . . . . . . . . 5
5.3. Registration Example . . . . . . . . . . . . . . . . . . 5
5.3.1. Valid Hash Functions . . . . . . . . . . . . . . . . 7
6. Test Vectors . . . . . . . . . . . . . . . . . . . . . . . . 7
6.1. Test Groups . . . . . . . . . . . . . . . . . . . . . . . 8
6.2. Test Cases . . . . . . . . . . . . . . . . . . . . . . . 9
7. Responses . . . . . . . . . . . . . . . . . . . . . . . . . . 10
8. Security Considerations . . . . . . . . . . . . . . . . . . . 12
9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 12
10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 12
11. References . . . . . . . . . . . . . . . . . . . . . . . . . 12
11.1. Normative References . . . . . . . . . . . . . . . . . . 12
11.2. Informative References . . . . . . . . . . . . . . . . . 13
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 13
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:
Celi Expires December 7, 2019 [Page 2]
Internet-Draft ACVP ANS x9.42 KDF June 2019
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:
o ACVP-KDF-ANSX9.42
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.
Celi Expires December 7, 2019 [Page 3]
Internet-Draft ACVP ANS x9.42 KDF June 2019
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 | Description | JSON Type | Valid |
| Property | | | Values |
+--------------+--------------------------+-----------+-------------+
| algorithm | a prerequisite algorithm | string | XXX |
| valValue | algorithm validation | string | XXX |
| | number | | |
+--------------+--------------------------+-----------+-------------+
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
Celi Expires December 7, 2019 [Page 4]
Internet-Draft ACVP ANS x9.42 KDF June 2019
"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 | Description | JSON | Valid Values |
| Property | | Type | |
+--------------+---------------------+--------+---------------------+
| algorithm | Name of the | string | "kdf-components" |
| | algorithm to be | | |
| | validated | | |
| mode | Mode of the | string | "ansix9.42" |
| | algorithm to be | | |
| | validated | | |
| revision | ACVP Test version | string | "1.0" |
| prereqVals | Prerequisites of | object | See Section 5.1 |
| | the algorithm | | |
| kdfType | The type of KDF | array | "DER" and/or |
| | | | "concatenation" |
| keyLen | The length of the | domain | Min: 1, Max: 65536 |
| | output key in bits | | |
| otherInfoLen | The length of the | domain | Min: 0, Max: 65536 |
| | other info in bits | | |
| zzLen | The length of ZZ in | domain | Min: 1, Max: 65536 |
| | bits | | |
| hashAlg | The supported hash | array | See Section 5.3.1 |
| | algorithms | | |
+--------------+---------------------+--------+---------------------+
An example registration within an algorithm capability exchange looks
like this
Celi Expires December 7, 2019 [Page 5]
Internet-Draft ACVP ANS x9.42 KDF June 2019
"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"
]
}
]
Celi Expires December 7, 2019 [Page 6]
Internet-Draft ACVP ANS x9.42 KDF June 2019
5.3.1. Valid Hash Functions
The following hash functions *MAY* be advertised by an ACVP compliant
client under the 'hashAlg' property
o SHA-1
o SHA2-224
o SHA2-256
o SHA2-384
o SHA2-512
o SHA2-512/224
o SHA2-512/256
o SHA3-224
o SHA3-256
o SHA3-384
o SHA3-512
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
Celi Expires December 7, 2019 [Page 7]
Internet-Draft ACVP ANS x9.42 KDF June 2019
+-------------+-----------------------------------------+-----------+
| JSON Values | Description | JSON Type |
+-------------+-----------------------------------------+-----------+
| acvVersion | Protocol version identifier | string |
| vsId | Vector set identifier | integer |
| algorithm | Algorithm defined in the capability | string |
| | exchange | |
| mode | Mode defined in the capability exchange | string |
| revision | Protocol test revision selected | string |
| testGroups | Array of test groups containing test | array |
| | data | |
+-------------+-----------------------------------------+-----------+
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
Celi Expires December 7, 2019 [Page 8]
Internet-Draft ACVP ANS x9.42 KDF June 2019
+--------------+------------------------------------------+---------+
| 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 | string |
| | should perform on the tests data | |
| 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
Celi Expires December 7, 2019 [Page 9]
Internet-Draft ACVP ANS x9.42 KDF June 2019
{
"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
Celi Expires December 7, 2019 [Page 10]
Internet-Draft ACVP ANS x9.42 KDF June 2019
{
"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
Celi Expires December 7, 2019 [Page 11]
Internet-Draft ACVP ANS x9.42 KDF June 2019
{
"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,
<https://www.rfc-editor.org/info/rfc2119>.
[RFC7991] Hoffman, P., "The "xml2rfc" Version 3 Vocabulary",
RFC 7991, DOI 10.17487/RFC7991, December 2016,
<https://www.rfc-editor.org/info/rfc7991>.
Celi Expires December 7, 2019 [Page 12]
Internet-Draft ACVP ANS x9.42 KDF June 2019
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>.
11.2. Informative References
[I-D.ribose-asciirfc]
Tse, R., Nicholas, N., and P. Brasolin, "AsciiRFC:
Authoring Internet-Drafts And RFCs Using AsciiDoc", draft-
ribose-asciirfc-08 (work in progress), April 2018.
[IETF.TLP]
IETF, "IETF Trust Legal Provisions (TLP)", April 2018,
<https://trustee.ietf.org/trust-legal-provisions.html>.
[RFC3552] Rescorla, E. and B. Korver, "Guidelines for Writing RFC
Text on Security Considerations", BCP 72, RFC 3552,
DOI 10.17487/RFC3552, July 2003,
<https://www.rfc-editor.org/info/rfc3552>.
[RFC5378] Bradner, S., Ed. and J. Contreras, Ed., "Rights
Contributors Provide to the IETF Trust", BCP 78, RFC 5378,
DOI 10.17487/RFC5378, November 2008,
<https://www.rfc-editor.org/info/rfc5378>.
[RFC7253] Krovetz, T. and P. Rogaway, "The OCB Authenticated-
Encryption Algorithm", RFC 7253, DOI 10.17487/RFC7253, May
2014, <https://www.rfc-editor.org/info/rfc7253>.
[RNP] Ribose Inc., "RNP: A C library approach to OpenPGP", March
2018, <https://github.com/riboseinc/rnp/>.
Author's Address
Christopher Celi
National Institute of Standards and Technology
100 Bureau Drive
Gaithersburg 20899
United States of America
Email: [email protected]
Celi Expires December 7, 2019 [Page 13]