forked from usnistgov/ACVP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathacvp_sub_mac.txt
3248 lines (2355 loc) · 137 KB
/
acvp_sub_mac.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
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
TBD B. Fussell, Ed.
Internet-Draft Cisco Systems, Inc.
Intended status: Informational R. Hammett, Ed.
Expires: February 2, 2019 G2, Inc.
August 1, 2018
ACVP Message Authentication Algorithm JSON Specification
draft-ietf-acvp-submac-1.0
Abstract
This document defines the JSON schema for using HMAC and CMAC
algorithms 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 February 2, 2019.
Copyright Notice
Copyright (c) 2018 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.
Fussell & Hammett Expires February 2, 2019 [Page 1]
Internet-Draft Sym Alg JSON August 2018
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1. Requirements Language . . . . . . . . . . . . . . . . . . 3
2. Test Types and Test Coverage . . . . . . . . . . . . . . . . 3
2.1. Test Coverage . . . . . . . . . . . . . . . . . . . . . . 4
2.1.1. CMAC Requirements Covered . . . . . . . . . . . . . . 4
2.1.2. CMAC Requirements Not Covered . . . . . . . . . . . . 4
2.1.3. GMAC Requirements Covered . . . . . . . . . . . . . . 4
2.1.4. GMAC Requirements Not Covered . . . . . . . . . . . . 5
2.1.5. HMAC Requirements Covered . . . . . . . . . . . . . . 5
2.1.6. HMAC Requirements Not Covered . . . . . . . . . . . . 5
3. Capabilities Registration . . . . . . . . . . . . . . . . . . 6
3.1. Required Prerequisite Algorithms for MAC Validations . . 6
4. CMAC-AES . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.1. CMAC-AES Algorithm Capabilities Registration . . . . . . 7
4.1.1. Example CMAC-AES Capabilities JSON Object . . . . . . 8
4.2. CMAC-AES Test Vectors . . . . . . . . . . . . . . . . . . 11
4.2.1. CMAC-AES Test Groups JSON Schema . . . . . . . . . . 12
4.2.2. CMAC-AES Test Case JSON Schema . . . . . . . . . . . 13
4.2.3. Example CMAC-AES Test Vector JSON Object . . . . . . 14
4.3. CMAC-AES Test Vector Responses . . . . . . . . . . . . . 18
4.3.1. Example CMAC-AES Test Vector Response JSON Object . . 19
5. CMAC-TDES . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.1. CMAC-TDES Algorithm Capabilities Registration . . . . . . 22
5.1.1. Example CMAC-TDES Capabilities JSON Object . . . . . 25
5.2. CMAC-TDES Test Vectors . . . . . . . . . . . . . . . . . 26
5.2.1. CMAC-TDES Test Groups JSON Schema . . . . . . . . . . 27
5.2.2. CMAC-TDES Test Case JSON Schema . . . . . . . . . . . 28
5.2.3. Example CMAC-TDES Test Vector JSON Object . . . . . . 29
5.3. CMAC-TDES Test Vector Responses . . . . . . . . . . . . . 35
5.3.1. Example CMAC-TDES Test Vector Response JSON Object . 36
6. GMAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
6.1. AES-GMAC Algorithm Capabilities Registration . . . . . . 39
6.1.1. Example AES-GMAC Capabilities JSON Object . . . . . . 40
6.2. AES-GMAC Test Vectors . . . . . . . . . . . . . . . . . . 41
6.2.1. AES-GMAC Test Groups JSON Schema . . . . . . . . . . 42
6.2.2. AES-GMAC Test Case JSON Schema . . . . . . . . . . . 43
6.2.3. Example AES-GMAC Test Vector JSON Object . . . . . . 44
6.3. AES-GMAC Test Vector Responses . . . . . . . . . . . . . 45
6.3.1. Example AES-GMAC Test Vector Response JSON Object . . 47
7. HMAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
7.1. HMAC Algorithm Capabilities Registration . . . . . . . . 48
7.2. Supported HMAC Algorithms . . . . . . . . . . . . . . . . 49
7.2.1. Example HMAC Capabilities JSON Object . . . . . . . . 50
7.3. HMAC Test Vectors . . . . . . . . . . . . . . . . . . . . 50
7.3.1. HMAC Test Groups JSON Schema . . . . . . . . . . . . 51
7.3.2. HMAC Test Case JSON Schema . . . . . . . . . . . . . 52
Fussell & Hammett Expires February 2, 2019 [Page 2]
Internet-Draft Sym Alg JSON August 2018
7.3.3. Example HMAC Test Vector JSON Object . . . . . . . . 53
7.4. HMAC Test Vector Responses . . . . . . . . . . . . . . . 54
7.4.1. Example HMAC Test Vector Response JSON Object . . . . 55
8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 56
9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 57
10. Security Considerations . . . . . . . . . . . . . . . . . . . 57
11. References . . . . . . . . . . . . . . . . . . . . . . . . . 57
11.1. Normative References . . . . . . . . . . . . . . . . . . 57
11.2. Informative References . . . . . . . . . . . . . . . . . 57
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 58
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 HMAC and
CMAC crypto algorithms using ACVP.
1.1. Requirements Language
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 RFC 2119 [RFC2119].
2. Test Types and Test Coverage
The ACVP server performs a set of tests on the MAC algorithms 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 CMAC-
AES, CMAC-TDES, HMAC-SHA-1, HMAC-SHA2-256, etc. This section
describes the design of the tests used to validate implementations of
MAC algorithms. There is a single test type for MACs (broken into
subsections for CMACs). the single test type, algorithm functional
test (AFT) can be described as follows:
"AFT" - Algorithm Function Test. The IUT processes all of HMAC
and the "gen" direction of CMAC by running the randomly chosen key
and message data (with constraints as per the IUT's capabilities
registration) through the MAC algorithm. CMAC has an additional
Fussell & Hammett Expires February 2, 2019 [Page 3]
Internet-Draft Sym Alg JSON August 2018
"ver" direction present in its testing to ensure the IUT can
successfully determine when a MAC does not match its originating
message/key combination.
2.1. Test Coverage
The tests described in this document have the intention of ensuring
an implementation is conformant to [SP-800-38B] and [FIPS-198-1].
2.1.1. CMAC Requirements Covered
SP 800-38b - 6.2 Mac Generation. ACVP server creates random sets
of keys and messages for the IUT to process, then compares the
IUT's result to the ACVP result.
SP 800-38b - 6.3 Mac Verification. ACVP server creates random
sets of keys, messages, and macs. These test vectors are then
randomly altered to ensure the MAC will not match the given key
and message. Using the provided test case, the IUT is expected to
validate the mac against the provided key and message.
2.1.2. CMAC Requirements Not Covered
SP 800-38b - 5.4 Sub-keys. While sub-keys are computed, as they
are intermediate values, are not validated via current testing.
SP 800-38b - 5.5 Input and Output Data. The mlen is currently
provided and not inferred.
SP 800-38b - Appendix A. Length of MAC. The ACVP server will
generate vectors as per the IUT's specified criteria. The IUT
should register its entire range of supported MAC lengths,
regardless of security strength. The ACVP server will test a
random sampling of valid MAC lengths as per the IUT registration -
this generally includes the minimum and maximum mac length.
2.1.3. GMAC Requirements Covered
SP 800-38d - 5.1 Block Cipher. ACVP testing SHALL make use of the
AES block cipher when testing GMAC.
SP 800-38d - 5.2 Two Gcm Functions. ACVP testing MAY test both
the generate and verify functions of GCM (without making use of a
payload) to help ensure a proper implementation. The ACVP and IUT
MAY test the encrypt (generate) and decrypt (verify) utilizing a
key, iv/nonce, and aad as described in this document section.
Fussell & Hammett Expires February 2, 2019 [Page 4]
Internet-Draft Sym Alg JSON August 2018
SP 800-38d - 6 Mathematical Components of GCM. GHASH and GCTR
produce intermediate values and SHALL be (indirectly) evaluated
for correctness via the ACVP generated GMAC test vectors.
SP 800-38d - 7 GCM Specification. When the IUT registers a
direction capability of "encrypt", the ACVP server MUST generate
vectors for the GCM-AE function. When the IUT registers a
capability of "decrypt", the ACVP server MUST generate test
vectors for the GCM-AD function.
2.1.4. GMAC Requirements Not Covered
SP 800-38d - 5.2.1.1 Input Data. GMAC MUST NOT make use of a
plaintext.
SP 800-38d - 5.2.1.2 Output Data. GMAC MUST NOT make use of a
ciphertext.
SP 800-38d - 7 GCM Specification. The ACVP server MUST NOT make
use of a plaintext or ciphertext for the generation of test
vectors for use in GMAC testing.
SP 800-38d - 8 Uniqueness Requirement on IVs and Keys. Key
establishment, IV construction, or number of invocations for a
specific key/iv SHALL NOT be tested under the scope of the ACVP
testing.
2.1.5. HMAC Requirements Covered
FIPS 198-1 - 3 Cryptographic Keys. The ACVP server will test,
depending on the nature of the IUT capabilities registration, keys
that are below, at, or above the hashing algorithm block size.
FIPS 198-1 - 4 HMAC Specification. Mac Generation. ACVP server
creates random sets of keys and messages for the IUT to process,
then compares the IUT's result to the ACVP result.
FIPS 198-1 - 5 Truncation. The ACVP server is capable of
generating MACs as per the capability registration of the IUT.
Groups will be created containing a random sampling of valid MAC
lengths from the IUT registration.
2.1.6. HMAC Requirements Not Covered
N/A
Fussell & Hammett Expires February 2, 2019 [Page 5]
Internet-Draft Sym Alg JSON August 2018
3. 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 HMAC and CMAC algorithms to
the ACVP server.
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 details on the
registration message. Each algorithm capability advertised is a
self-contained JSON object.
3.1. Required Prerequisite Algorithms for MAC Validations
Each MAC implementation relies on other cryptographic primitives.
For example, CMAC uses an underlying SHA algorithm. Each of these
underlying algorithm primitives must be validated, either separately
or as part of the same submission. ACVP provides a mechanism for
specifying the required prerequisites:
+--------------+--------------+---------------+----------+----------+
| JSON Value | Description | JSON type | Valid | Optional |
| | | | Values | |
+--------------+--------------+---------------+----------+----------+
| algorithm | a | value | AES, | No |
| | prerequisite | | SHA, | |
| | algorithm | | TDES | |
| | | | | |
| valValue | algorithm | value | actual | No |
| | validation | | number | |
| | number | | or | |
| | | | "same" | |
| | | | | |
| prereqAlgVal | prerequistie | object with | see | No |
| | algorithm | algorithm and | above | |
| | validation | valValue | | |
| | | properties | | |
+--------------+--------------+---------------+----------+----------+
Table 1: Required MAC Prerequisite Algorithms JSON Values
Fussell & Hammett Expires February 2, 2019 [Page 6]
Internet-Draft Sym Alg JSON August 2018
4. CMAC-AES
4.1. CMAC-AES Algorithm Capabilities Registration
Each algorithm capability advertised is a self-contained JSON object
using the following values.
+--------------+---------------+--------------+----------+----------+
| JSON Value | Description | JSON type | Valid | Optional |
| | | | Values | |
+--------------+---------------+--------------+----------+----------+
| algorithm | The MAC | value | CMAC-AES | No |
| | algorithm to | | | |
| | be validated. | | | |
| | | | | |
| revision | The algorithm | value | "1.0" | No |
| | testing | | | |
| | revision to | | | |
| | use. | | | |
| | | | | |
| prereqVals | prerequistie | array of | See Sect | No |
| | algorithm | prereqAlgVal | ion 3.1 | |
| | validations, | objects | | |
| | See | | | |
| | Section 3.1 | | | |
| | for examples | | | |
| | | | | |
| capabilities | The CMAC-AES | array of | See | No |
| | capabilities | capability | Table 3 | |
| | | objects | | |
| | | | | |
+--------------+---------------+--------------+----------+----------+
Table 2: CMAC-AES Algorithm Capabilities JSON Values
Each capability object describes a separate permutation of direction
and key length.
Fussell & Hammett Expires February 2, 2019 [Page 7]
Internet-Draft Sym Alg JSON August 2018
+-----------+------------------------+--------+----------+----------+
| JSON | Description | JSON | Valid | Optional |
| Value | | type | Values | |
+-----------+------------------------+--------+----------+----------+
| direction | The MAC direction(s) | array | gen, ver | No |
| | to test. | | | |
| | | | | |
| keyLen | The keyLen supported | value | 128, | No |
| | | | 192, 256 | |
| | | | | |
| msgLen | The CMAC message | Domain | 0-524288 | No |
| | lengths supported in | | | |
| | bits. | | | |
| | Min/max/increment and | | | |
| | values must be mod 8. | | | |
| | | | | |
| macLen | The supported mac | Domain | 32-128 | No |
| | sizes. | | | |
| | | | | |
+-----------+------------------------+--------+----------+----------+
Table 3: CMAC-AES Capabilities JSON Values
macLen for CMAC contains a Domain of values, the server may choose
values defined by these rules:
o The smallest CMAC length supported
o A second CMAC length supported
o The largest CMAC length supported
msgLen for CMAC contains a Domain of values, the server may choose
values defined by these rules:
o The smallest message length supported
o Two message lengths divisible by block size
o Two message lengths NOT divisible by block size
o The largest message length supported
4.1.1. Example CMAC-AES Capabilities JSON Object
The following is an example JSON object advertising support for CMAC-
AES.
Fussell & Hammett Expires February 2, 2019 [Page 8]
Internet-Draft Sym Alg JSON August 2018
{
"algorithm": "CMAC-AES",
"revision": "1.0",
"capabilities": [
{
"direction": "gen",
"keyLen": 128,
"keyingOption": 0,
"msgLen": [
{
"min": 0,
"max": 65536,
"increment": 8
}
],
"macLen": [
{
"min": 64,
"max": 128,
"increment": 8
}
]
},
{
"direction": "ver",
"keyLen": 128,
"keyingOption": 0,
"msgLen": [
{
"min": 0,
"max": 65536,
"increment": 8
}
],
"macLen": [
{
"min": 64,
"max": 128,
"increment": 8
}
]
},
{
"direction": "gen",
"keyLen": 192,
"keyingOption": 0,
"msgLen": [
{
Fussell & Hammett Expires February 2, 2019 [Page 9]
Internet-Draft Sym Alg JSON August 2018
"min": 0,
"max": 65536,
"increment": 8
}
],
"macLen": [
{
"min": 64,
"max": 128,
"increment": 8
}
]
},
{
"direction": "ver",
"keyLen": 192,
"keyingOption": 0,
"msgLen": [
{
"min": 0,
"max": 65536,
"increment": 8
}
],
"macLen": [
{
"min": 64,
"max": 128,
"increment": 8
}
]
},
{
"direction": "gen",
"keyLen": 256,
"keyingOption": 0,
"msgLen": [
{
"min": 0,
"max": 65536,
"increment": 8
}
],
"macLen": [
{
"min": 64,
"max": 128,
"increment": 8
Fussell & Hammett Expires February 2, 2019 [Page 10]
Internet-Draft Sym Alg JSON August 2018
}
]
},
{
"direction": "ver",
"keyLen": 256,
"keyingOption": 0,
"msgLen": [
{
"min": 0,
"max": 65536,
"increment": 8
}
],
"macLen": [
{
"min": 64,
"max": 128,
"increment": 8
}
]
}
]
}
4.2. CMAC-AES 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 session would require multiple test vector
sets to be downloaded and processed by the ACVP client. Each test
vector set represents an individual crypto algorithm, such as HMAC-
SHA-1, HMAC-SHA2-224, CMAC-AES, etc. This section describes the JSON
schema for a test vector set used with HMAC and CMAC crypto
algorithms.
The test vector set JSON schema is a multi-level hierarchy that
contains meta data for the entire vector set as well as individual
test vectors to be processed by the ACVP client. The following table
describes the JSON elements at the top level of the hierarchy.
Fussell & Hammett Expires February 2, 2019 [Page 11]
Internet-Draft Sym Alg JSON August 2018
+------------+---------------------------------------------+--------+
| JSON Value | Description | JSON |
| | | type |
+------------+---------------------------------------------+--------+
| acvVersion | Protocol version identifier | value |
| | | |
| vsId | Unique numeric identifier for the vector | value |
| | set | |
| | | |
| algorithm | The algorithm used for the test vectors. | value |
| | | |
| revision | The algorithm testing revision to use. | value |
| | | |
| testGroups | Array of test group JSON objects, which are | array |
| | defined in Section 4.2.1 | |
+------------+---------------------------------------------+--------+
Table 4: CMAC-AES Vector Set JSON Object
4.2.1. CMAC-AES Test Groups JSON Schema
The testGroups element at the top level in the test vector JSON
object is an array of test groups. Test vectors are grouped into
similar test cases to reduce the amount of data transmitted in the
vector set. For instance, all test vectors that use the same key
size would be grouped together. The Test Group JSON object contains
meta data that applies to all test vectors within the group. The
following table describes the secure HMAC and CMAC JSON elements of
the Test Group JSON object.
Fussell & Hammett Expires February 2, 2019 [Page 12]
Internet-Draft Sym Alg JSON August 2018
+-----------+------------------------------------+-------+----------+
| JSON | Description | JSON | Optional |
| Value | | type | |
+-----------+------------------------------------+-------+----------+
| tgId | Numeric identifier for the test | value | No |
| | group, unique across the entire | | |
| | vector set. | | |
| | | | |
| testType | Test category type (AFT) | value | No |
| | | | |
| direction | The direction of the tests - gen | value | No |
| | or ver | | |
| | | | |
| keyLen | Length of key in bits to use | value | No |
| | | | |
| msgLen | Length of message/hash in bits | value | No |
| | | | |
| macLen | Length of MAC in bits to | value | No |
| | generate/verify | | |
| | | | |
| tests | Array of individual test vector | array | No |
| | JSON objects, which are defined in | | |
| | Section 4.2.2 | | |
+-----------+------------------------------------+-------+----------+
Table 5: CMAC-AES Test Group JSON Object
4.2.2. CMAC-AES Test Case JSON Schema
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 secure MAC test vector.
Fussell & Hammett Expires February 2, 2019 [Page 13]
Internet-Draft Sym Alg JSON August 2018
+--------+---------------------------------------+-------+----------+
| JSON | Description | JSON | Optional |
| Value | | type | |
+--------+---------------------------------------+-------+----------+
| tcId | Numeric identifier for the test case, | value | No |
| | unique across the entire vector set. | | |
| | | | |
| key | Encryption key to use AES | value | No |
| | | | |
| msg | Value of the message | value | No |
| | | | |
| mac | MAC value, for CMAC verify | value | Yes |
+--------+---------------------------------------+-------+----------+
Table 6: CMAC-AES Test Case JSON Object
4.2.3. Example CMAC-AES Test Vector JSON Object
The following is an example JSON test vector object for CMAC-AES.
{
"vsId": 1,
"algorithm": "CMAC-AES",
"revision": "1.0",
"testGroups": [{
"tgId": 4,
"testType": "AFT",
"direction": "gen",
"keyLen": 128,
"msgLen": 2752,
"macLen": 64,
"tests": [{
"tcId": 25,
"key": "E2547E38B28B2C24892C133FF4770688",
"message": "89DE09D747FB4B2669B59759A15BAAF068CAF31FD938DFCFFB38ECED53BA91DD659FD91E6CCCFEC5F972B1AD66BF78FE7FE319E58F514362FC75A346C144981B63FD18195A2AD482AF83711C9ADC449F7EAD32EBD5F4DB7EB93348404EAD496B8F4C89AB5FF7ACB2CFEFD96BD0FC9645B6F1F30AB02767ECA8771106DCA47188EE42183121FB9172B8E2133DE084F6CA3924E4BF3638ADA77DAAA6F06A6494E32CBAEFC6C6D0699BB12A425DCFE5974F687B6A71879D42DE08DF018A96429CFA40E32378D35E46A4956C5D7916B6877F353D33075FD4C64F32C3250D74FF070EA358135664CD8C9B82C9454EED75A12EEC758A9E514053533A884560FAC96DDBBA4AEEB8E473F4BFDB8447B22800D7782320D6E2DAC2599111F8CA598D6720CA7C6E4FC5EDC54FC3576460AAD1644B04E1D2C81B93EA49090FDB7E33374C243B2F19177405B94BEC3C69CC24CC686D8F2B01A6B2A350E394"
},
{
"tcId": 26,
"key": "D1D99979CD96C3401291905F53B2ECA4",
"message": "6D054A7D1CD161B21F80E6586E5821DDA97451D98F815663932872720BD2156752EA650AE0EC4AB9FEE5635B1CCF1B123CF0247D2487BCD3102B6A668B5F9882DB03278A6B5DCECDF176604B55668FFD8EFED2A454F16A7A75D168AFBA3C305E31B8C1ABCCAA110E94796F8F0231A479DA25A2BCBECA3A9DAFF4357C6C63476106627DF9DF692231BA906E8F8E196FAA4DD412019D36C1AEB2A015EFDCCB9E0308FDA871DBF14DED263FF28079ED3DC4E411470A664F5EAED458EB2D564971AD10E77DCCDE53BB95DF7951FCE595079ECD6C394D78AFEB85CA87C596872D66783BD816808B0B311E5EC0BA52D5283699EE725ABDC2AD85266808D80F72195599CB27241B2FF6112829FCFBFDD5548EA29637B0DCC731A060F345769D335B1B5ABE90A664CBCCD19F4F21EE630E786BDFA60C6A8D731329718CEFE80095604918600976413334AE01C524F0F0A22D50DB460CFE7D737B6334"
},
{
"tcId": 27,
"key": "672556E105B83BF39FC9E45268BD35D1",
"message": "39A3DD0652483A26FB9D71F30A5E29D326627FE16E29E3A3BF8EDF68645B477B5DE88499EDB3CF9E036F3D0D316241EE7C569F74925AD0BD3DCBBA21E73D9638ABA2554C4CA62AC5D7113B3FE7216E79AFC7A6FB94F21EB234D0401879A6B03EAE242EA0DCF1B523513467B00C048E7DE333C8977C455DD943323D01C97CF93EC24843769E52AD785E2340F2CC61E571D2099472E47286F29BCDF28A69144692263312F176618777A6AD0A0338F8A636BCA6150F0E1F72D539BAD726C95425682678EA7297A118E819A2925747C0AD72F3BCDF8E7D6C0A11A6AA938E4AA119390451C4E56B99F29C34927C1830197FCD4921C7E38E29BAEA5E560C8A3D4D7B96BBC370C78EF794BA9F6DB737576867B334D1DCC537D4FD751952DDFF549109ECCAD38198CCB49F25E7FEB88B9FD33D3B56601B473946693C5C3D7B2D1C7BB857F9560B94A3BD145019150BA11159B39480F97B0DE90243D6"
},
{
Fussell & Hammett Expires February 2, 2019 [Page 14]
Internet-Draft Sym Alg JSON August 2018
"tcId": 28,
"key": "1E220113298DA3B30E14F1432C16FCE8",
"message": "497E82B322B18B0295F3B4359AC0CFAF1D36B46F36C9E123B95B90985B06AC6AFAFB772E21CCA4665CEABFF9C1CE3D78F804BEBAC6F171C0ADA47FC718E7EC55EC7603D739C8B4DBF07B60A78A8EC83922A880485B99E0FED2B1F7D5A895E2BD9149888A085F21794C1953A6EF4471A47A285CFAA57E9F75000B375A4100F5432150ECFC3342627FA325C7FB0EE0090A0B39D69ED9030E7D46BBCC6ADFC49F14156187F94F7DDE50C736FEB3FCE530CC76171EE1150AA5A94A3B79119329B5A1D9C3E03EAC7F212A1AECA97EAD58B8BFCD5F94946578D8F5A0347970A7F93C70B4AB0BB5A4FE2B0AAC8459ED0045DDC3AC210ACF996A4DE478853CD88ACEAE73D9A9C48A1B64E0D82F2EFFB25C517BDD0C033E566C16197835271A85D65A38AB37B63E7B23E9C7EA7777E6B3E3820C930B1333C279E5291724E774E34F574F15E1E23568E486F03FC6B83B962E3E60A90A69DD26701A8D6C"
},
{
"tcId": 29,
"key": "B2EDB3F5189E14E1E860A8B70D5CF676",
"message": "EAF87567D104DF3DA93312EEB0B695409E927F6D2EF287AC12130AC82082D600DDCFDD0074DF3CFB41CE347FAC8BEADAA522D7CE33E539C7F8E9470E00210CDDB3BF799B913B627561B35368BA80955A210AE92C5F89C0566A6E3BD6559DAE9537EE0042E60BE58E4F3757F43CA43634C09CABAEB644CCB30260A776C9B2ACB8A7900DF0B556F7CDB9A0712C3CC2B711E505880156552645DFB598DDD99E2FC06394B6F3B51C3A499E0204DD89AB699A3E8015F9720F4D5D84C30CEF9F95CFBE7DFAD7A55DF591FBFFFB10A3B3AA08EBA53873A95CADBA3A3913E947173945AFA6B88791970ED2B12972A62D4A86716D0A2429E4447676058C6EB42FA6BB6DA5295B2A2518130FCF1CB81FD3B247A9EE438F0284DF6E0AD0DEA0A4A7DDEF6A48465974F375B5FD0DA809534F4654A53116921F1004B3FF9E4E9FDA1520B8D86F0766285878BF8062A00638DE0C5970B9B6C560B65F71AF6E"
},
{
"tcId": 30,
"key": "7BD39F41F80079D7D0DC0154F833086A",
"message": "AB1311F60133E446CEF81973E4FC67DB365441AD367BA0E38AFD564F137AE8AC7ED0C64551EBC7A5A5F49765835C67A33F38BA1A3EFDA4725962E2C9D9893A665D9CD04BA0A613F06F7FAADBEDF9466CC62FD84DE146494E1C67EB65DC362450CF855FC9C92DD217869B60874CC0D944C7BEFFFDDA09ECBC66997873BE9A8BD007F79CC73E0E2BC52DB257CD02B0E794DAAAFF68062C476B4C9DD7F4F3FFCADE6863383455B3EEC727062A2175395A3E8D6C738878F4333F2BF27A2DD653CC57D4CC065DEE75014D32785D3A6B725DC7CBAE47BF579EAB6FC126A95701214084409594D20025ECD52CCA272364F466D4497C4F16D80CED689F0783DB4B2D185A9CC12FD247A6431AC51FCC44074B774402F584197BDD466F68DC794440B1F5F80F2F6FDB3968CACE95CBF41E7C5544194CC38D412627890B9D683A1175D9E6B93E499A4C64C4088F36AA4105E8E3D8A2EEEE1E266A3441A9"
},
{
"tcId": 31,
"key": "64F8BD1CC49FD16A4DF0253F31917ED4",
"message": "340104D85093FDB0740B597207D25496D5670CAF006507470783EFE2071E2026CE2C333D86F5E7BBDA91F2440C4589366BE8C337CA0B59683E8ACD384FD842675066B79008BF7F989FD7BB5ACE46D2D5BB3EBB4985708D85BD3CFC058D869295ECC18ADF1A4475263249A7579117A53B905BBFE26E2E29DA46D1D57DE6B1E2462E4C71738262307A212978AE4BD35792BAE2B770CDC1E25D350C424BBF9650ABF8F22BE9A95F1E47CC8CA4518C5EE7881C9414365DDB3959361AD3A0A9FC07C57B050D335B7426CE19144B061B197809ADEC47C75BCBB00525865ED02E375C1793BF6A05679574645B6F020EE15EE094EB02D706149B85E50A74C8CFD9823E1B222C65FCAD630B84F25C62E0B1BB7AED5637526C537F44F9BC1869721966C1BE50B3C95B4C37CC3D6E2A85589441FE73E7E2369A418ECFEB88B2337AA179AF77B5F622B02E62CF8CD294FB226ACCABF0920AECC9DD76B572"
},
{
"tcId": 32,
"key": "AF2B918C3CC53D064688E1A517A33D2C",
"message": "8FC205EB22775C0570A1867E3FB6E2FCF2A743171107190B89CE8A2A04C1B46A0D45781207AAB25BEC6C55F35E21F662F660C68BED54DD08D40C95D4D24872C595E49F3519D85DB933306BEF10EE181FA25C727787494FAD7A91EA6563E58B575C65E2774098BF69D74DD53D015899BF71F9B95EA0CE2A775BE0CED8423507086E6C48A9AE89195CBB1345B1C0AB8D496A2D9A6AEEFAC4A40F900159F47A7C1DFF96E88EA104EC0C64A858657239085C3AC353BE53069E57FBE9AE9B967D041478B8EBC908C70CBEEBEE718D51C08EBD2C97D7F98EF4D6EA5FF156ADC2D8FAD535AA2501F734F411BCE2B329F0FE485297707490523ABE9DB9E2FEFCD8C8A09E18628B9912262DA0282A334D9290CC5DED2F7662771237C144382724D51C3BF02F45BABD5B35810ED3EBA38AFC03D6E107D31814B8D0E4D21FE7CF9434018BCCB42F506971D33106432F325BE456A914CD5C2561E8F01F80"
}
]
},
{
"tgId": 10,
"testType": "AFT",
"direction": "ver",
"keyLen": 128,
"msgLen": 0,
"macLen": 64,
"tests": [{
"tcId": 73,
"key": "D5E09A89B2A4627BF987517B66A51564",
"message": "",
"mac": "CBBC968859633C24"
},
{
"tcId": 74,
"key": "646A150116ABAA37662FE9D8BB278693",
"message": "",
"mac": "21D069331196E579"
},
{
"tcId": 75,
"key": "5C185C01FBC57A40FC373F199374D1CC",
Fussell & Hammett Expires February 2, 2019 [Page 15]
Internet-Draft Sym Alg JSON August 2018
"message": "",
"mac": "9507F00153543DE6"
},
{
"tcId": 76,
"key": "4E3A4C7AE2DCA644FF752B8B74CACEF8",
"message": "",
"mac": "6D58E6464497A9B4"
},
{
"tcId": 77,
"key": "BA924D356A696E97BEF0477A9D600FCE",
"message": "",
"mac": "93FEA54132999B1D"
},
{
"tcId": 78,
"key": "DA877E0EFC098E1EAD8B2DC61A5B98D5",
"message": "",
"mac": "24E6ED4D00D7122C"
},
{
"tcId": 79,
"key": "61698DB0B49E2F252849590E940CBCF3",
"message": "",
"mac": "2C531F92D23D6B2B"
},
{
"tcId": 80,
"key": "BE149E46BE89BF16BDDE41D1A494AEA4",
"message": "",
"mac": "7A858023143F6B98"
},
{
"tcId": 81,
"key": "9A9F006EF8EDFDA0F1113FC6FEF2E84D",
"message": "",
"mac": "C0750CD586472C8A"
},
{
"tcId": 82,
"key": "F68A91DE6AC099F7D72D7B211245D8D9",
"message": "",
"mac": "C91C3DCC36F2BC21"
},
{
"tcId": 83,
"key": "23E9BEA8C4F14330B2836FDD0B6E803F",
Fussell & Hammett Expires February 2, 2019 [Page 16]
Internet-Draft Sym Alg JSON August 2018
"message": "",
"mac": "F884E64E0CA4D34F"
},
{
"tcId": 84,
"key": "02636CC18751A5CF27C56D2C69793BC4",
"message": "",
"mac": "1D5F5531BA263CC2"
},
{
"tcId": 85,
"key": "46D7DA4F123C37F05FC269FCF92B1FC1",
"message": "",
"mac": "06D743483812AAB4"
},
{
"tcId": 86,
"key": "C28DD76F2A31C90EE4A91313CB7D4ECC",
"message": "",
"mac": "09B6D2C848F8C9FD"
},
{
"tcId": 87,
"key": "810BAE6E85149F244179CA7F1488353B",
"message": "",
"mac": "68D7AFF612EAEDB4"
},
{
"tcId": 88,
"key": "C67C04544E0DDDE14FAE608135909FED",
"message": "",
"mac": "E9B7FE8ECF21DDD7"
},
{
"tcId": 89,
"key": "D9D5B9D32533DB3276BE4FFF3D79374A",
"message": "",
"mac": "081BAFA11BFDF238"
},
{
"tcId": 90,
"key": "D8A05E45602DD6ACBE989BD0F26CED9E",
"message": "",
"mac": "D84F8EE112352837"
},
{
"tcId": 91,
"key": "E09B79F64B11F00B48081EEEA0482821",
Fussell & Hammett Expires February 2, 2019 [Page 17]
Internet-Draft Sym Alg JSON August 2018
"message": "",
"mac": "4D927CED15907953"
},
{
"tcId": 92,
"key": "24B7BE1D4F72AE1A1C5FBDB2A3AC8287",
"message": "",
"mac": "548CBD558D8F6E3A"
}
]
}
]
}
4.3. CMAC-AES Test Vector 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 Value | Description | JSON |
| | | type |
+------------+---------------------------------------------+--------+
| acvVersion | Protocol version identifier | value |
| | | |
| vsId | Unique numeric identifier for the vector | value |
| | set | |
| | | |
| testGroups | Array of JSON objects that represent each | array |
| | test vector group. See Table 8 | |
| | | |
+------------+---------------------------------------------+--------+
Table 7: CMAC-AES Vector Set Response JSON Object
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.