forked from usnistgov/ACVP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdraft-celi-acvp-sha-00.html
1014 lines (958 loc) · 35 KB
/
draft-celi-acvp-sha-00.html
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
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head profile="http://www.w3.org/2006/03/hcard http://dublincore.org/documents/2008/08/04/dc-html/">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
<title>ACVP Secure Hash Algorithm (SHA) JSON Specification</title>
<style type="text/css" title="Xml2Rfc (sans serif)">
/*<![CDATA[*/
a {
text-decoration: none;
}
/* info code from SantaKlauss at http://www.madaboutstyle.com/tooltip2.html */
a.info {
/* This is the key. */
position: relative;
z-index: 24;
text-decoration: none;
}
a.info:hover {
z-index: 25;
color: #FFF; background-color: #900;
}
a.info span { display: none; }
a.info:hover span.info {
/* The span will display just on :hover state. */
display: block;
position: absolute;
font-size: smaller;
top: 2em; left: -5em; width: 15em;
padding: 2px; border: 1px solid #333;
color: #900; background-color: #EEE;
text-align: left;
}
a.smpl {
color: black;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: underline;
}
address {
margin-top: 1em;
margin-left: 2em;
font-style: normal;
}
body {
color: black;
font-family: verdana, helvetica, arial, sans-serif;
font-size: 10pt;
max-width: 55em;
}
cite {
font-style: normal;
}
dd {
margin-right: 2em;
}
dl {
margin-left: 2em;
}
ul.empty {
list-style-type: none;
}
ul.empty li {
margin-top: .5em;
}
dl p {
margin-left: 0em;
}
dt {
margin-top: .5em;
}
h1 {
font-size: 14pt;
line-height: 21pt;
page-break-after: avoid;
}
h1.np {
page-break-before: always;
}
h1 a {
color: #333333;
}
h2 {
font-size: 12pt;
line-height: 15pt;
page-break-after: avoid;
}
h3, h4, h5, h6 {
font-size: 10pt;
page-break-after: avoid;
}
h2 a, h3 a, h4 a, h5 a, h6 a {
color: black;
}
img {
margin-left: 3em;
}
li {
margin-left: 2em;
margin-right: 2em;
}
ol {
margin-left: 2em;
margin-right: 2em;
}
ol p {
margin-left: 0em;
}
p {
margin-left: 2em;
margin-right: 2em;
}
pre {
margin-left: 3em;
background-color: lightyellow;
padding: .25em;
}
pre.text2 {
border-style: dotted;
border-width: 1px;
background-color: #f0f0f0;
width: 69em;
}
pre.inline {
background-color: white;
padding: 0em;
}
pre.text {
border-style: dotted;
border-width: 1px;
background-color: #f8f8f8;
width: 69em;
}
pre.drawing {
border-style: solid;
border-width: 1px;
background-color: #f8f8f8;
padding: 2em;
}
table {
margin-left: 2em;
}
table.tt {
vertical-align: top;
}
table.full {
border-style: outset;
border-width: 1px;
}
table.headers {
border-style: outset;
border-width: 1px;
}
table.tt td {
vertical-align: top;
}
table.full td {
border-style: inset;
border-width: 1px;
}
table.tt th {
vertical-align: top;
}
table.full th {
border-style: inset;
border-width: 1px;
}
table.headers th {
border-style: none none inset none;
border-width: 1px;
}
table.left {
margin-right: auto;
}
table.right {
margin-left: auto;
}
table.center {
margin-left: auto;
margin-right: auto;
}
caption {
caption-side: bottom;
font-weight: bold;
font-size: 9pt;
margin-top: .5em;
}
table.header {
border-spacing: 1px;
width: 95%;
font-size: 10pt;
color: white;
}
td.top {
vertical-align: top;
}
td.topnowrap {
vertical-align: top;
white-space: nowrap;
}
table.header td {
background-color: gray;
width: 50%;
}
table.header a {
color: white;
}
td.reference {
vertical-align: top;
white-space: nowrap;
padding-right: 1em;
}
thead {
display:table-header-group;
}
ul.toc, ul.toc ul {
list-style: none;
margin-left: 1.5em;
margin-right: 0em;
padding-left: 0em;
}
ul.toc li {
line-height: 150%;
font-weight: bold;
font-size: 10pt;
margin-left: 0em;
margin-right: 0em;
}
ul.toc li li {
line-height: normal;
font-weight: normal;
font-size: 9pt;
margin-left: 0em;
margin-right: 0em;
}
li.excluded {
font-size: 0pt;
}
ul p {
margin-left: 0em;
}
.comment {
background-color: yellow;
}
.center {
text-align: center;
}
.error {
color: red;
font-style: italic;
font-weight: bold;
}
.figure {
font-weight: bold;
text-align: center;
font-size: 9pt;
}
.filename {
color: #333333;
font-weight: bold;
font-size: 12pt;
line-height: 21pt;
text-align: center;
}
.fn {
font-weight: bold;
}
.hidden {
display: none;
}
.left {
text-align: left;
}
.right {
text-align: right;
}
.title {
color: #990000;
font-size: 18pt;
line-height: 18pt;
font-weight: bold;
text-align: center;
margin-top: 36pt;
}
.vcardline {
display: block;
}
.warning {
font-size: 14pt;
background-color: yellow;
}
@media print {
.noprint {
display: none;
}
a {
color: black;
text-decoration: none;
}
table.header {
width: 90%;
}
td.header {
width: 50%;
color: black;
background-color: white;
vertical-align: top;
font-size: 12pt;
}
ul.toc a::after {
content: leader('.') target-counter(attr(href), page);
}
ul.ind li li a {
content: target-counter(attr(href), page);
}
.print2col {
column-count: 2;
-moz-column-count: 2;
column-fill: auto;
}
}
@page {
@top-left {
content: "Internet-Draft";
}
@top-right {
content: "December 2010";
}
@top-center {
content: "Abbreviated Title";
}
@bottom-left {
content: "Doe";
}
@bottom-center {
content: "Expires June 2011";
}
@bottom-right {
content: "[Page " counter(page) "]";
}
}
@page:first {
@top-left {
content: normal;
}
@top-right {
content: normal;
}
@top-center {
content: normal;
}
}
/*]]>*/
</style>
<link href="#rfc.toc" rel="Contents">
<link href="#rfc.section.1" rel="Chapter" title="1 Introduction">
<link href="#rfc.section.1.1" rel="Chapter" title="1.1 Requirements Language">
<link href="#rfc.section.2" rel="Chapter" title="2 Supported Hash Algorithms">
<link href="#rfc.section.3" rel="Chapter" title="3 Test Types and Test Coverage">
<link href="#rfc.section.3.1" rel="Chapter" title="3.1 Monte Carlo tests for SHA-1 and SHA-2">
<link href="#rfc.section.3.2" rel="Chapter" title="3.2 Test Coverage">
<link href="#rfc.section.3.2.1" rel="Chapter" title="3.2.1 SHA Requirements Covered">
<link href="#rfc.section.3.2.2" rel="Chapter" title="3.2.2 SHA Requirements Not Covered">
<link href="#rfc.section.4" rel="Chapter" title="4 Capabilities Registration">
<link href="#rfc.section.4.1" rel="Chapter" title="4.1 HASH Algorithm Capabilities Registration">
<link href="#rfc.section.5" rel="Chapter" title="5 Test Vectors">
<link href="#rfc.section.5.1" rel="Chapter" title="5.1 Test Groups">
<link href="#rfc.section.5.2" rel="Chapter" title="5.2 Test Case">
<link href="#rfc.section.5.3" rel="Chapter" title="5.3 Test Vector Responses">
<link href="#rfc.section.5.4" rel="Chapter" title="5.4 Acknowledgements">
<link href="#rfc.section.5.5" rel="Chapter" title="5.5 IANA Considerations">
<link href="#rfc.section.5.6" rel="Chapter" title="5.6 Security Considerations">
<link href="#rfc.references" rel="Chapter" title="6 References">
<link href="#rfc.references.1" rel="Chapter" title="6.1 Normative References">
<link href="#rfc.references.2" rel="Chapter" title="6.2 Informative References">
<link href="#rfc.appendix.A" rel="Chapter" title="A Example Secure Hash Capabilities JSON Object">
<link href="#rfc.appendix.B" rel="Chapter" title="B Example Test Vectors JSON Object">
<link href="#rfc.appendix.C" rel="Chapter" title="C Example Test Results JSON Object">
<link href="#rfc.authors" rel="Chapter">
<meta name="generator" content="xml2rfc version 2.22.3 - https://tools.ietf.org/tools/xml2rfc" />
<link rel="schema.dct" href="http://purl.org/dc/terms/" />
<meta name="dct.creator" content="Celi, C., Ed." />
<meta name="dct.identifier" content="urn:ietf:id:draft-ietf-acvp-subsha-01" />
<meta name="dct.issued" scheme="ISO8601" content="2018-11-01" />
<meta name="dct.abstract" content="This document defines the JSON schema for using SHA1 and SHA2 with the ACVP specification." />
<meta name="description" content="This document defines the JSON schema for using SHA1 and SHA2 with the ACVP specification." />
</head>
<body>
<table class="header">
<tbody>
<tr>
<td class="left">TBD</td>
<td class="right">C. Celi, Ed.</td>
</tr>
<tr>
<td class="left">Internet-Draft</td>
<td class="right">National Institute of Standards and Technology</td>
</tr>
<tr>
<td class="left">Intended status: Informational</td>
<td class="right">November 1, 2018</td>
</tr>
<tr>
<td class="left">Expires: May 5, 2019</td>
<td class="right"></td>
</tr>
</tbody>
</table>
<p class="title">ACVP Secure Hash Algorithm (SHA) JSON Specification<br />
<span class="filename">draft-ietf-acvp-subsha-01</span></p>
<h1 id="rfc.abstract"><a href="#rfc.abstract">Abstract</a></h1>
<p>This document defines the JSON schema for using SHA1 and SHA2 with the ACVP specification.</p>
<h1 id="rfc.status"><a href="#rfc.status">Status of This Memo</a></h1>
<p>This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.</p>
<p>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/.</p>
<p>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."</p>
<p>This Internet-Draft will expire on May 5, 2019.</p>
<h1 id="rfc.copyrightnotice"><a href="#rfc.copyrightnotice">Copyright Notice</a></h1>
<p>Copyright (c) 2018 IETF Trust and the persons identified as the document authors. All rights reserved.</p>
<p>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.</p>
<hr class="noprint" />
<h1 class="np" id="rfc.toc"><a href="#rfc.toc">Table of Contents</a></h1>
<ul class="toc">
<li>1. <a href="#rfc.section.1">Introduction</a>
</li>
<ul><li>1.1. <a href="#rfc.section.1.1">Requirements Language</a>
</li>
</ul><li>2. <a href="#rfc.section.2">Supported Hash Algorithms</a>
</li>
<li>3. <a href="#rfc.section.3">Test Types and Test Coverage</a>
</li>
<ul><li>3.1. <a href="#rfc.section.3.1">Monte Carlo tests for SHA-1 and SHA-2</a>
</li>
<li>3.2. <a href="#rfc.section.3.2">Test Coverage</a>
</li>
<ul><li>3.2.1. <a href="#rfc.section.3.2.1">SHA Requirements Covered</a>
</li>
<li>3.2.2. <a href="#rfc.section.3.2.2">SHA Requirements Not Covered</a>
</li>
</ul></ul><li>4. <a href="#rfc.section.4">Capabilities Registration</a>
</li>
<ul><li>4.1. <a href="#rfc.section.4.1">HASH Algorithm Capabilities Registration</a>
</li>
</ul><li>5. <a href="#rfc.section.5">Test Vectors</a>
</li>
<ul><li>5.1. <a href="#rfc.section.5.1">Test Groups</a>
</li>
<li>5.2. <a href="#rfc.section.5.2">Test Case</a>
</li>
<li>5.3. <a href="#rfc.section.5.3">Test Vector Responses</a>
</li>
<li>5.4. <a href="#rfc.section.5.4">Acknowledgements</a>
</li>
<li>5.5. <a href="#rfc.section.5.5">IANA Considerations</a>
</li>
<li>5.6. <a href="#rfc.section.5.6">Security Considerations</a>
</li>
</ul><li>6. <a href="#rfc.references">References</a>
</li>
<ul><li>6.1. <a href="#rfc.references.1">Normative References</a>
</li>
<li>6.2. <a href="#rfc.references.2">Informative References</a>
</li>
</ul><li>Appendix A. <a href="#rfc.appendix.A">Example Secure Hash Capabilities JSON Object</a>
</li>
<li>Appendix B. <a href="#rfc.appendix.B">Example Test Vectors JSON Object</a>
</li>
<li>Appendix C. <a href="#rfc.appendix.C">Example Test Results JSON Object</a>
</li>
<li><a href="#rfc.authors">Author's Address</a>
</li>
</ul>
<h1 id="rfc.section.1">
<a href="#rfc.section.1">1.</a> Introduction</h1>
<p id="rfc.section.1.p.1">The Automated Cryptographic Validation Protocol <a href="#ACVP" class="xref">[ACVP]</a> defines a mechanism to automatically verify the cryptographic implementation of a software or hardware cryptographic module. The intention of the protocol is to minimize human involvement in the testing of cryptography. The ACVP specification defines how a cryptographic module communicates with an ACVP server, including cryptographic capabilities negotiation, session management, authentication, vector processing and more. Note that the ACVP specification does not define algorithm-specific JSON constructs for performing the cryptographic validation. However, a series of ACVP sub-specifications defines the constructs for testing individual cryptographic algorithms. Each sub-specification addresses a specific class or subset of cryptographic algorithms. This sub-specification defines the JSON constructs for testing hash cryptographic algorithms using ACVP. The ACVP server performs a set of tests on the hash functions 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 cryptographic algorithm, such as SHA-1, SHA2-256 and SHA2-512. </p>
<h1 id="rfc.section.1.1">
<a href="#rfc.section.1.1">1.1.</a> Requirements Language</h1>
<p id="rfc.section.1.1.p.1">The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted in <a href="#RFC2119" class="xref">RFC 2119</a>. </p>
<h1 id="rfc.section.2">
<a href="#rfc.section.2">2.</a> <a href="#supported_algs" id="supported_algs">Supported Hash Algorithms</a>
</h1>
<p id="rfc.section.2.p.1">The following hash algorithms MAY be advertised by the ACVP compliant cryptographic module:</p>
<p></p>
<ul>
<li>SHA-1</li>
<li>SHA2-224</li>
<li>SHA2-256</li>
<li>SHA2-384</li>
<li>SHA2-512</li>
<li>SHA2-512/224</li>
<li>SHA2-512/256</li>
</ul>
<p> </p>
<h1 id="rfc.section.3">
<a href="#rfc.section.3">3.</a> <a href="#testtypes" id="testtypes">Test Types and Test Coverage</a>
</h1>
<p id="rfc.section.3.p.1">This section describes the design of the tests used to validate implementations of SHA-1 and SHA-2. There are two types of tests for SHA-1 and SHA-2: functional tests and Monte Carlo tests. Each has a specific value to be used in the testType field. The testType field definitions are: </p>
<ul>
<li>"AFT" - Algorithm Functional Test. These tests can be processed by the client using a normal 'hash' operation. AFTs cause the implementation under test to exercise normal 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 hash function (block chunking, block padding etc.) are operating correctly. </li>
<li>"MCT" - Monte Carlo Test. These tests exercise the implementation under test under strenuous circumstances. The implementation under test must process the test vectors according to the correct algorithm and mode in this document. MCTs can help detect potential memory leaks over time, and problems in allocation of resources, addressing variables, error handling, and generally improper behavior in response to random inputs. Each MCT processes 100 pseudorandom tests. Each algorithm and mode SHOULD have at least one MCT group. See <a href="#MC_test" class="xref">Section 3.1</a> for implementation details. </li>
</ul>
<p> </p>
<h1 id="rfc.section.3.1">
<a href="#rfc.section.3.1">3.1.</a> <a href="#MC_test" id="MC_test">Monte Carlo tests for SHA-1 and SHA-2</a>
</h1>
<p id="rfc.section.3.1.p.1">The MCTs start with an initial condition (SEED, which is a single message) and perform a series of chained computations. </p>
<p id="rfc.section.3.1.p.2">The algorithm is shown in <a href="#xml_figureMCT" class="xref">Figure 1</a>. </p>
<div id="rfc.figure.1"></div>
<div id="xml_figureMCT"></div>
<p>SHA-1 and SHA-2 Monte Carlo Test</p>
<pre>
For i = 0 to 99
MD[0] = MD[1] = MD[2] = SEED
For j = 3 to 1002
MSG[j] = MD[j-3] || MD[j-2] || MD[j-1]
MD[j] = SHA(MSG[j])
SEED = MD[1002]
Output SEED
</pre>
<p class="figure">Figure 1</p>
<h1 id="rfc.section.3.2">
<a href="#rfc.section.3.2">3.2.</a> <a href="#test_coverage" id="test_coverage">Test Coverage</a>
</h1>
<p id="rfc.section.3.2.p.1">The tests described in this document have the intention of ensuring an implementation is conformant to <a href="#FIPS-180-4" class="xref">[FIPS-180-4]</a>. </p>
<h1 id="rfc.section.3.2.1">
<a href="#rfc.section.3.2.1">3.2.1.</a> <a href="#sha-coverage" id="sha-coverage">SHA Requirements Covered</a>
</h1>
<p id="rfc.section.3.2.1.p.1">Sections 3 and 4 in <a href="#FIPS-180-4" class="xref">[FIPS-180-4]</a> outline the core functions used within the hash algorithms. Normal AFTs test these operations. Section 5 outlines the hash function preprocessing. It is worth noting that not all test cases will cover the message padding process, but through the entire vector set, this operation will be fully tested. </p>
<h1 id="rfc.section.3.2.2">
<a href="#rfc.section.3.2.2">3.2.2.</a> <a href="#sha-not-coverage" id="sha-not-coverage">SHA Requirements Not Covered</a>
</h1>
<p id="rfc.section.3.2.2.p.1">Section 1 in <a href="#FIPS-180-4" class="xref">[FIPS-180-4]</a> outlines the maximum message sizes for each hash function. Due to the large size (either 2^64 or 2^128 bits) of these maximums, they are not tested by this specification. Section 7 outlines digest truncation for applications where a shortened digest is needed. These operations are not tested via this specification. </p>
<h1 id="rfc.section.4">
<a href="#rfc.section.4">4.</a> <a href="#caps_reg" id="caps_reg">Capabilities Registration</a>
</h1>
<p id="rfc.section.4.p.1">This section describes the constructs for advertising support of hash algorithms to the ACVP server. ACVP REQUIRES cryptographic modules to register their capabilities in a registration. This allows the cryptographic module to advertise support for specific algorithms, notifying the ACVP server which algorithms need test vectors generated for the validation process. </p>
<p id="rfc.section.4.p.2">The hash algorithm capabilities MUST be advertised as JSON objects within the 'algorithms' value of the ACVP registration message. The 'algorithms' value MUST be an array, where each array element is an individual JSON object defined in this section. The 'algorithms' value MUST be part of the 'capability_exchange' element of the ACVP JSON registration message. See the ACVP Protocol Specification Section 11.15.2 for details on the registration message. Each hash algorithm capability advertised SHALL be a self-contained JSON object. </p>
<h1 id="rfc.section.4.1">
<a href="#rfc.section.4.1">4.1.</a> <a href="#hash_caps_reg" id="hash_caps_reg">HASH Algorithm Capabilities Registration</a>
</h1>
<div id="rfc.table.1"></div>
<div id="caps_table"></div>
<table cellpadding="3" cellspacing="0" class="tt full center">
<caption>Hash Algorithm Capabilities JSON Values</caption>
<thead><tr>
<th class="left">JSON Value</th>
<th class="left">Description</th>
<th class="left">JSON type</th>
</tr></thead>
<tbody>
<tr>
<td class="left">algorithm</td>
<td class="left">The hash algorithm and mode to be validated.</td>
<td class="left">string</td>
</tr>
<tr>
<td class="left">revision</td>
<td class="left">The algorithm testing revision to use.</td>
<td class="left">string</td>
</tr>
<tr>
<td class="left">messageLength</td>
<td class="left">The message lengths in bits supported by the IUT. Minimum allowed is 0, maximum allowed is 65535.</td>
<td class="left">domain</td>
</tr>
</tbody>
</table>
<p id="rfc.section.4.1.p.1">The value of the algorithm property MUST be one of the elements from the list in <a href="#supported_algs" class="xref">Section 2</a>. </p>
<h1 id="rfc.section.5">
<a href="#rfc.section.5">5.</a> <a href="#test_vectors" id="test_vectors">Test Vectors</a>
</h1>
<p id="rfc.section.5.p.1">After receiving a valid registration of a cryptographic module, the ACVP server SHALL provide test vectors in the form of a prompt to the ACVP client, which then SHALL be processed and returned to the ACVP server for validation. A typical ACVP validation session would require the client to download and process multiple test vector sets. Each test vector set SHALL represent an individual cryptographic algorithm, such as SHA-1, SHA2-256, SHA2-512, etc. This section describes the JSON schema for a test vector set used with hash algorithms. </p>
<p id="rfc.section.5.p.2">The test vector set JSON schema is a multi-level hierarchy that contains meta-data for the entire vector set. The test vector set SHALL be comprised of test groups which SHALL subsequently contain individual test cases to be processed by the ACVP client. The following table describes the REQUIRED JSON elements at the top level of the hierarchy: </p>
<div id="rfc.table.2"></div>
<div id="vs_top_table"></div>
<table cellpadding="3" cellspacing="0" class="tt full center">
<caption>Vector Set JSON Object</caption>
<thead><tr>
<th class="left">JSON Value</th>
<th class="left">Description</th>
<th class="left">JSON type</th>
</tr></thead>
<tbody>
<tr>
<td class="left">acvVersion</td>
<td class="left">Protocol version identifier</td>
<td class="left">string</td>
</tr>
<tr>
<td class="left">vsId</td>
<td class="left">Unique numeric identifier for the vector set</td>
<td class="left">integer</td>
</tr>
<tr>
<td class="left">algorithm</td>
<td class="left">The hash algorithm and mode used for the test vectors. See <a href="#supported_algs" class="xref">Section 2</a> for possible values.</td>
<td class="left">string</td>
</tr>
<tr>
<td class="left">revision</td>
<td class="left">The algorithm testing revision to use.</td>
<td class="left">string</td>
</tr>
<tr>
<td class="left">testGroups</td>
<td class="left">Array of test group JSON objects, which are defined in <a href="#tgjs" class="xref">Section 5.1</a>
</td>
<td class="left">array of testGroup objects</td>
</tr>
</tbody>
</table>
<h1 id="rfc.section.5.1">
<a href="#rfc.section.5.1">5.1.</a> <a href="#tgjs" id="tgjs">Test Groups</a>
</h1>
<p id="rfc.section.5.1.p.1">Test vector sets MUST contain one or more test groups, each sharing similar properties. For instance, all test vectors that use the same testType would be grouped together. The testGroups element at the top level of the test vector JSON object SHALL be the array of test groups. The Test Group JSON object MUST contain meta-data that applies to all test cases within the group. The following table describes the JSON elements that MAY appear from the server in the Test Group JSON object: </p>
<div id="rfc.table.3"></div>
<div id="vs_tg_table"></div>
<table cellpadding="3" cellspacing="0" class="tt full center">
<caption>Test Group JSON Object</caption>
<thead><tr>
<th class="left">JSON Value</th>
<th class="left">Description</th>
<th class="left">JSON type</th>
</tr></thead>
<tbody>
<tr>
<td class="left">tgId</td>
<td class="left">Numeric identifier for the test group, unique across the entire vector set</td>
<td class="left">integer</td>
</tr>
<tr>
<td class="left">testType</td>
<td class="left">Test category type (AFT or MCT). See <a href="#testtypes" class="xref">Section 3</a> for more information</td>
<td class="left">string</td>
</tr>
<tr>
<td class="left">tests</td>
<td class="left">Array of individual test case JSON objects, which are defined in <a href="#tcjs" class="xref">Section 5.2</a>
</td>
<td class="left">array of testCase objects</td>
</tr>
</tbody>
</table>
<p id="rfc.section.5.1.p.2">All properties described in the previous table MUST appear in the prompt file from the server for every testGroup object. </p>
<h1 id="rfc.section.5.2">
<a href="#rfc.section.5.2">5.2.</a> <a href="#tcjs" id="tcjs">Test Case</a>
</h1>
<p id="rfc.section.5.2.p.1">Each test group SHALL contain an array of one or more test cases. Each test case is a JSON object that represents a single case to be processed by the ACVP client. The following table describes the JSON elements for each test case. </p>
<div id="rfc.table.4"></div>
<div id="vs_tc_table"></div>
<table cellpadding="3" cellspacing="0" class="tt full center">
<caption>Test Case JSON Object</caption>
<thead><tr>
<th class="left">JSON Value</th>
<th class="left">Description</th>
<th class="left">JSON type</th>
</tr></thead>
<tbody>
<tr>
<td class="left">tcId</td>
<td class="left">Numeric identifier for the test case, unique across the entire vector set.</td>
<td class="left">integer</td>
</tr>
<tr>
<td class="left">len</td>
<td class="left">Length, in bits, of the message or MCT seed</td>
<td class="left">integer</td>
</tr>
<tr>
<td class="left">msg</td>
<td class="left">Value of the message or MCT seed in big-endian hex</td>
<td class="left">string</td>
</tr>
</tbody>
</table>
<p id="rfc.section.5.2.p.2">All properties described in the previous table MUST appear in the prompt file from the server for every testCase object. </p>
<h1 id="rfc.section.5.3">
<a href="#rfc.section.5.3">5.3.</a> <a href="#vector_responses" id="vector_responses">Test Vector Responses</a>
</h1>
<p id="rfc.section.5.3.p.1">After the ACVP client downloads and processes a vector set, it SHALL send the response vectors back to the ACVP server within the alloted timeframe. The following table describes the JSON object that represents a vector set response. </p>
<div id="rfc.table.5"></div>
<div id="vr_top_table"></div>
<table cellpadding="3" cellspacing="0" class="tt full center">
<caption>Vector Set Response JSON Object</caption>
<thead><tr>
<th class="left">JSON Value</th>
<th class="left">Description</th>
<th class="left">JSON type</th>
</tr></thead>
<tbody>
<tr>
<td class="left">acvVersion</td>
<td class="left">Protocol version identifier</td>
<td class="left">string</td>
</tr>
<tr>
<td class="left">vsId</td>
<td class="left">Unique numeric identifier for the vector set</td>
<td class="left">integer</td>
</tr>
<tr>
<td class="left">testGroups</td>
<td class="left">Array of JSON objects that represent the results of each test group.</td>
<td class="left">array of testGroup objects</td>
</tr>
</tbody>
</table>
<p id="rfc.section.5.3.p.2">The testGroup Response 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 its response. This structure helps accommodate that. </p>
<div id="rfc.table.6"></div>
<div id="vr_group_table"></div>
<table cellpadding="3" cellspacing="0" class="tt full center">
<caption>Vector Set Group Response JSON Object</caption>
<thead><tr>
<th class="left">JSON Value</th>
<th class="left">Description</th>
<th class="left">JSON type</th>
</tr></thead>
<tbody>
<tr>
<td class="left">tgId</td>
<td class="left">The test group identifier</td>
<td class="left">integer</td>
</tr>
<tr>
<td class="left">tests</td>
<td class="left">The tests associated to the group specified in tgId</td>
<td class="left">array of testCase objects</td>
</tr>
</tbody>
</table>
<p id="rfc.section.5.3.p.3">Each test case is a JSON object that represents a single test object to be processed by the ACVP client. The following table describes the JSON elements for each test case object. </p>
<div id="rfc.table.7"></div>
<div id="vs_tr_table"></div>
<table cellpadding="3" cellspacing="0" class="tt full center">
<caption>Test Case Results JSON Object</caption>
<thead><tr>
<th class="left">JSON Value</th>
<th class="left">Description</th>
<th class="left">JSON type</th>
</tr></thead>
<tbody>
<tr>
<td class="left">tcId</td>
<td class="left">Numeric identifier for the test case, unique across the entire vector set.</td>
<td class="left">integer</td>
</tr>
<tr>
<td class="left">md</td>
<td class="left">The IUT's message digest response to an AFT test, hex encoded. (Omitted for non-AFT test cases.)</td>
<td class="left">string (hex)</td>
</tr>
<tr>
<td class="left">resultsArray</td>
<td class="left">Array of JSON objects that represent each iteration of an MCT. Each element contains a single key, “md”, whose value is the hex encoded output of that iteration. (Omitted for non-MCT test cases.)</td>
<td class="left">array of 100 objects</td>
</tr>
</tbody>
</table>
<p id="rfc.section.5.3.p.4">Note: The tcId MUST be included in every test case object sent between the client and the server. </p>
<h1 id="rfc.section.5.4">
<a href="#rfc.section.5.4">5.4.</a> <a href="#Acknowledgements" id="Acknowledgements">Acknowledgements</a>
</h1>
<p id="rfc.section.5.4.p.1">TBD...</p>
<h1 id="rfc.section.5.5">
<a href="#rfc.section.5.5">5.5.</a> <a href="#IANA" id="IANA">IANA Considerations</a>
</h1>
<p id="rfc.section.5.5.p.1">This memo includes requests to IANA to join draft-vassilev-acvp-iana-00.</p>
<h1 id="rfc.section.5.6">
<a href="#rfc.section.5.6">5.6.</a> <a href="#Security" id="Security">Security Considerations</a>
</h1>
<p id="rfc.section.5.6.p.1">Security considerations are addressed by the ACVP specification.</p>
<h1 id="rfc.references">
<a href="#rfc.references">6.</a> References</h1>
<h1 id="rfc.references.1">
<a href="#rfc.references.1">6.1.</a> Normative References</h1>
<table><tbody>
<tr>
<td class="reference"><b id="ACVP">[ACVP]</b></td>
<td class="top">
<a title="Cisco">Fussell, B.</a>, "<a>ACVP Specification</a>", 2019.</td>
</tr>
<tr>
<td class="reference"><b id="RFC2119">[RFC2119]</b></td>
<td class="top">
<a>Bradner, S.</a>, "<a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997.</td>
</tr>
</tbody></table>
<h1 id="rfc.references.2">
<a href="#rfc.references.2">6.2.</a> Informative References</h1>
<table><tbody><tr>
<td class="reference"><b id="FIPS-180-4">[FIPS-180-4]</b></td>
<td class="top">
<a>NIST</a>, "<a>Secure Hash Standard (SHS)</a>", August 2015.</td>
</tr></tbody></table>
<h1 id="rfc.appendix.A">
<a href="#rfc.appendix.A">Appendix A.</a> <a href="#app-reg-ex" id="app-reg-ex">Example Secure Hash Capabilities JSON Object</a>
</h1>
<p id="rfc.section.A.p.1">The following is a example JSON object advertising support for SHA-256.</p>
<pre>
{
"algorithm": "SHA2-256",
"revision": "1.0",
"messageLength": [{"min": 0, "max": 65535, "increment": 1}]
}
</pre>
<h1 id="rfc.appendix.B">
<a href="#rfc.appendix.B">Appendix B.</a> <a href="#app-vs-ex" id="app-vs-ex">Example Test Vectors JSON Object</a>
</h1>
<p id="rfc.section.B.p.1">The following is an example JSON object for secure hash test vectors sent from the ACVP server to the crypto module. Note the single bit message is represented as "80". This complies with SHA1 and SHA2 being big-endian by nature. All hex strings associated with SHA1 and SHA2 will be big-endian. </p>
<pre>
[
{ "acvVersion": <acvp-version> },
{ "vsId": 1564,
"algorithm": "SHA2-512/224",
"revision": "1.0",
"testGroups": [
{
"testType": "AFT",
"tests": [
{
"tcId": 0,
"len": 0,
"msg": "00"
},
{
"tcId": 1,
"len": 1,
"msg": "80"
}],
"tgId": 1
}]
}
]
</pre>
<p id="rfc.section.B.p.2">The following is another example JSON object for secure hash test vectors sent from the ACVP server to the crypto module.</p>
<pre>
[
{ "acvVersion": <acvp-version> },
{ "vsId": 1564,
"algorithm": "SHA2-256",
"revision": "1.0",
"testGroups": [
{
"testType": "AFT",
"tests": [
{
"tcId": 2170,
"len": 1304,
"msg": "7f65733c...706d707"
},
{
"tcId": 2171,
"len": 2096,
"msg": "e2c3b1a2...946e8e13"
}],
"tgId": 1
}]
}
]
</pre>
<p id="rfc.section.B.p.3">The following is an example JSON object for secure hash Monte Carlo test vectors sent from the ACVP server to the crypto module.</p>
<pre>
[
{ "acvVersion": <acvp-version> },
{ "vsId": 1564,
"algorithm": "SHA-1",
"revision": "1.0",
"testGroups": [
{
"testType": "MCT",
"tests": [
{
"tcId": 2175,
"len": 20,
"msg": "331b04d56f6e3ed5af349bf1fd9f9591b6ec886e",
}],
"tgId": 1
}]
}
]
</pre>
<h1 id="rfc.appendix.C">
<a href="#rfc.appendix.C">Appendix C.</a> <a href="#app-results-ex" id="app-results-ex">Example Test Results JSON Object</a>
</h1>
<p id="rfc.section.C.p.1">The following is a example JSON object for secure hash test results sent from the crypto module to the ACVP server.</p>
<pre>
[
{ "acvVersion": <acvp-version> },
{ "vsId": 1564,
"testGroups": [
{
"tgId": 1,
"tests": [
{
"tcId": 2170,
"md": "7115011d...3c4283f3"
},
{
"tcId": 2171,
"md": "79820a52...3a79acd5"
}]
}
}
]
</pre>
<p id="rfc.section.C.p.2">The following is a example JSON object for secure hash Monte Carlo test results sent from the crypto module to the ACVP server. (Reduced to three iterations for brevity.)</p>
<pre>
[
{ "acvVersion": <acvp-version> },
{ "vsId": 1564,
"testGroups": [
{
"tgId": 1,
"tests": [
{
"tcId": 10246,
"resultsArray": [
{
"md": "220b2bd1...e3c023f7"
},
{
"md": "5eec0361...0ff2caf9"
},
{
"md": "efbed761...d4d23ce6"
}]
}
}]
}
]
</pre>
<h1 id="rfc.authors"><a href="#rfc.authors">Author's Address</a></h1>
<div class="avoidbreak">
<address class="vcard">
<span class="vcardline">
<span class="fn">Christopher Celi</span> (editor)
<span class="n hidden">
<span class="family-name">Celi</span>
</span>
</span>
<span class="org vcardline">National Institute of Standards and Technology</span>
<span class="adr">
<span class="vcardline">100 Bureau Drive</span>