-
Notifications
You must be signed in to change notification settings - Fork 8
743 lines (630 loc) · 18.1 KB
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
module ietf-tcg-algs {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-tcg-algs";
prefix taa;
organization
"IETF RATS Working Group";
contact
"WG Web: <http://datatracker.ietf.org/wg/rats/>
WG List: <mailto:[email protected]>
Author: Eric Voit <mailto:[email protected]>";
description
"This module defines a identities for asymmetric algorithms.
Copyright (c) 2020 IETF Trust and the persons identified
as authors of the code. All rights reserved.
Redistribution and use in source and binary forms, with
or without modification, is permitted pursuant to, and
subject to the license terms contained in, the Simplified
BSD License set forth in Section 4.c of the IETF Trust's
Legal Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC XXXX
(https://www.rfc-editor.org/info/rfcXXXX); see the RFC
itself for full legal notices.
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 (RFC 2119)
(RFC 8174) when, and only when, they appear in all
capitals, as shown here.";
revision 2020-09-17 {
description
"Initial version";
reference
"RFC XXXX: tbd";
}
/*****************/
/* Features */
/*****************/
feature TPM12 {
description
"This feature indicates algorithm support for the TPM 1.2 API
as per TPM-main-1.2-Rev94-part-2, Section 4.8.";
}
feature TPM20 {
description
"This feature indicates algorithm support for the TPM 2.0 API
as per TPM-Rev-2.0-Part-1-Architecture-01.38 Section 11.4.";
}
/*****************/
/* Identities */
/*****************/
/* There needs to be collasping/verification of some of the identity
types between the various algorithm types listed below */
identity algorithm {
description
"Base identity identity listing the cryptographic object
defintions within contained within the TCG Algorithm Registry.";
reference
"http://trustedcomputinggroup.org/resource/tcg-algorithm-registry/
Version TCG_Algorithm_Registry_r1p32_pub";
}
identity asymmetric {
description
"A TCG recognized asymmetric algorithm with a public and
private key.";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 2";
}
identity symmetric {
description
"A TCG recognized symmetric algorithm with only a private key.";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 2";
}
identity hash {
description
"A TCG recognized hash algorithm that compresses input data to
a digest value or indicates a method that uses a hash.";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 2";
}
identity signing {
description
"A TCG recognized signing algorithm";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 2";
}
identity anonymous_signing {
description
"A TCG recognized anonymous signing algorithm.";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 2";
}
identity encryption_mode {
description
"A TCG recognized encryption mode.";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 2";
}
identity method {
description
"A TCG recognized method such as a mask generation function.";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 2";
}
identity object_type {
description
"A TCG recognized object type.";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 2";
}
identity tpm12 {
if-feature "TPM12";
base algorithm;
description
"Supportable by a TPM1.2.";
reference
"TPM-Main-Part-2-TPM-Structures_v1.2_rev116_01032011.pdf
TPM_ALGORITHM_ID values, page 18";
}
identity tpm2 {
if-feature "TPM12";
base algorithm;
description
"Supportable by a TPM2.";
reference
"TPM-Rev-2.0-Part-2-Structures-01.38.pdf
The TCG Algorithm Registry. Table 9";
}
identity TPM_ALG_RSA {
if-feature "TPM12 or TPM20";
base tpm12;
base tpm2;
base asymmetric;
base object_type;
description
"RSA algorithm";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
RFC 8017. ALG_ID: 0x0001";
}
identity TPM_ALG_TDES {
if-feature "TPM12";
base tpm12;
base symmetric;
description
"Block cipher with various key sizes (Triple Data Encryption
Algorithm, commonly called Triple Data Encryption Standard)
Note: was banned in TPM1.2 v94";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
ISO/IEC 18033-3. ALG_ID: 0x0003";
}
identity TPM_ALG_SHA1 {
if-feature "TPM12 or TPM20";
base hash;
base tpm12;
base tpm2;
description
"SHA1 algorithm - Deprecated due to insufficient cryptographic
protection. However it is still useful for hash algorithms
where protection is not required.";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
ISO/IEC 10118-3. ALG_ID: 0x0004";
}
identity TPM_ALG_HMAC {
if-feature "TPM12 or TPM20";
base tpm12;
base tpm2;
base hash;
base signing;
description
"Hash Message Authentication Code (HMAC) algorithm";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3,
ISO/IEC 9797-2 and RFC2014. ALG_ID: 0x0005";
}
identity TPM_ALG_AES {
if-feature "TPM12";
base tpm12;
base symmetric;
description
"The AES algorithm with various key sizes";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
ISO/IEC 18033-3. ALG_ID: 0x0006";
}
identity TPM_ALG_MGF1 {
if-feature "TPM20";
base tpm2;
base hash;
base method;
description
"hash-based mask-generation function";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3,
IEEE Std 1363-2000 and IEEE Std 1363a -2004.
ALG_ID: 0x0007";
}
identity TPM_ALG_KEYEDHASH {
if-feature "TPM20";
base tpm2;
base hash;
base object_type;
description
"An encryption or signing algorithm using a keyed hash. These
may use XOR for encryption or an HMAC for signing and may
also refer to a data object that is neither signing nor
encrypting.";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
TCG TPM 2.0 library specification. . ALG_ID: 0x0008";
}
identity TPM_ALG_XOR {
if-feature "TPM12 or TPM20";
base tpm12;
base tpm2;
base hash;
base symmetric;
description
"The XOR encryption algorithm.";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
TCG TPM 2.0 library specification. ALG_ID: 0x000A";
}
identity TPM_ALG_SHA256 {
if-feature "TPM20";
base tpm2;
base hash;
description
"The SHA 256 algorithm";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
ISO/IEC 10118-3. ALG_ID: 0x000B";
}
identity TPM_ALG_SHA384 {
if-feature "TPM20";
base tpm2;
base hash;
description
"The SHA 384 algorithm";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
ISO/IEC 10118-3. ALG_ID: 0x000C";
}
identity TPM_ALG_SHA512 {
if-feature "TPM20";
base tpm2;
base hash;
description
"The SHA 512 algorithm";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
ISO/IEC 10118-3. ALG_ID: 0x000D";
}
identity TPM_ALG_NULL {
if-feature "TPM20";
base tpm2;
description
"NULL algorithm";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
TCG TPM 2.0 library specification. ALG_ID: 0x0010";
}
identity TPM_ALG_SM3_256 {
if-feature "TPM20";
base tpm2;
base hash;
description
"The SM3 hash algorithm.";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
GM/T 0004-2012 - SM3_256. ALG_ID: 0x0012";
}
identity TPM_ALG_SM4 {
if-feature "TPM20";
base tpm2;
base symmetric;
description
"SM4 symmetric block cipher";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
GB/T 32907-2016. ALG_ID: 0x0013";
}
identity TPM_ALG_RSASSA {
if-feature "TPM20";
base tpm2;
base asymmetric;
base signing;
description
"Signature algorithm defined in section 8.2 (RSASSAPKCS1-v1_5)";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and RFC 8017.
ALG_ID: 0x0014";
}
identity TPM_ALG_RSAES {
if-feature "TPM20";
base tpm2;
base asymmetric;
base encryption_mode;
description
"Signature algorithm defined in section 7.2 (RSAES-PKCS1-v1_5)";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and RFC 8017
ALG_ID: 0x0015";
}
identity TPM_ALG_RSAPSS {
if-feature "TPM20";
base tpm2;
base asymmetric;
base signing;
description
"Padding algorithm defined in section 8.1 (RSASSA PSS)";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and RFC 8017.
ALG_ID: 0x0016";
}
identity TPM_ALG_OAEP {
if-feature "TPM20";
base tpm2;
base asymmetric;
base encryption_mode;
description
"Padding algorithm defined in section 7.1 (RSASSA OAEP)";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and RFC 8017.
ALG_ID: 0x0017";
}
identity TPM_ALG_ECDSA {
if-feature "TPM20";
base tpm2;
base asymmetric;
base signing;
description
"Signature algorithm using elliptic curve cryptography (ECC)";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
ISO/IEC 14888-3. ALG_ID: 0x0018";
}
identity TPM_ALG_ECDH {
if-feature "TPM20";
base tpm2;
base asymmetric;
base method;
description
"Secret sharing using ECC";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
NIST SP800-56A and RFC 7748. ALG_ID: 0x0019";
}
identity TPM_ALG_ECDAA {
if-feature "TPM20";
base tpm2;
base asymmetric;
base signing;
base anonymous_signing;
description
"Elliptic-curve based anonymous signing scheme";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
TCG TPM 2.0 library specification. ALG_ID: 0x001A";
}
identity TPM_ALG_SM2 {
if-feature "TPM20";
base tpm2;
base asymmetric;
base signing;
base encryption_mode;
base method;
description
"SM2 – depending on context, either an elliptic-curve based,
signature algorithm, an encryption scheme, or a key exchange
protocol";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
A GM/T 0003.1–2012, GM/T 0003.2–2012, GM/T 0003.3–2012,
GM/T 0003.5–2012 SM2. ALG_ID: 0x001B";
}
identity TPM_ALG_ECSCHNORR {
if-feature "TPM20";
base tpm2;
base asymmetric;
base signing;
description
"Elliptic-curve based Schnorr signature";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
TCG TPM 2.0 library specification. ALG_ID: 0x001C";
}
identity TPM_ALG_ECMQV {
if-feature "TPM20";
base tpm2;
base asymmetric;
base method;
description
"Two-phase elliptic-curve key";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
NIST SP800-56A. ALG_ID: 0x001D";
}
identity TPM_ALG_KDF1_SP800_56A {
if-feature "TPM20";
base tpm2;
base hash;
base method;
description
"Concatenation key derivation function";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
NIST SP800-56A (approved alternative1) section 5.8.1.
ALG_ID: 0x0020";
}
identity TPM_ALG_KDF2 {
if-feature "TPM20";
base tpm2;
base hash;
base method;
description
"Key derivation function";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
IEEE 1363a-2004 KDF2 section 13.2. ALG_ID: 0x0021";
}
identity TPM_ALG_KDF1_SP800_108 {
base TPM_ALG_KDF2;
description
"A key derivation method";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
NIST SP800-108 - Section 5.1 KDF. ALG_ID: 0x0022";
}
identity TPM_ALG_ECC {
if-feature "TPM20";
base tpm2;
base asymmetric;
base object_type;
description
"Prime field ECC";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
ISO/IEC 15946-1. ALG_ID: 0x0023";
}
identity TPM_ALG_SYMCIPHER {
if-feature "TPM20";
base tpm2;
description
"Object type for a symmetric block cipher";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
TCG TPM 2.0 library specification. ALG_ID: 0x0025";
}
identity TPM_ALG_CAMELLIA {
if-feature "TPM20";
base tpm2;
base symmetric;
description
"The Camellia algorithm";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
ISO/IEC 18033-3. ALG_ID: 0x0026";
}
identity TPM_ALG_SHA3_256 {
if-feature "TPM20";
base tpm2;
base hash;
description
"ISO/IEC 10118-3 - the SHA 256 algorithm";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
NIST PUB FIPS 202. ALG_ID: 0x0027";
}
identity TPM_ALG_SHA3_384 {
if-feature "TPM20";
base tpm2;
base hash;
description
"The SHA 384 algorithm";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
NIST PUB FIPS 202. ALG_ID: 0x0028";
}
identity TPM_ALG_SHA3_512 {
if-feature "TPM20";
base tpm2;
base hash;
description
"The SHA 512 algorithm";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
NIST PUB FIPS 202. ALG_ID: 0x0029";
}
identity TPM_ALG_CMAC {
if-feature "TPM20";
base tpm2;
base symmetric;
base signing;
description
"block Cipher-based Message Authentication Code (CMAC)";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
ISO/IEC 9797-1:2011 Algorithm 5. ALG_ID: 0x003F";
}
identity TPM_ALG_CTR {
if-feature "TPM20";
base tpm2;
base symmetric;
base encryption_mode;
description
"Counter mode";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
ISO/IEC 10116. ALG_ID: 0x0040";
}
identity TPM_ALG_OFB {
base tpm2;
base symmetric;
base encryption_mode;
description
"Output Feedback mode";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
ISO/IEC 10116. ALG_ID: 0x0041";
}
identity TPM_ALG_CBC {
if-feature "TPM20";
base tpm2;
base symmetric;
base encryption_mode;
description
"Cipher Block Chaining mode";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
ISO/IEC 10116. ALG_ID: 0x0042";
}
identity TPM_ALG_CFB {
if-feature "TPM20";
base tpm2;
base symmetric;
base encryption_mode;
description
"Cipher Feedback mode";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
ISO/IEC 10116. ALG_ID: 0x0043";
}
identity TPM_ALG_ECB {
if-feature "TPM20";
base tpm2;
base symmetric;
base encryption_mode;
description
"Electronic Codebook mode";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
ISO/IEC 10116. ALG_ID: 0x0044";
}
identity TPM_ALG_CCM {
if-feature "TPM20";
base tpm2;
base symmetric;
base signing;
base encryption_mode;
description
"Counter with Cipher Block Chaining-Message Authentication
Code (CCM)";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
NIST SP800-38C. ALG_ID: 0x0050";
}
identity TPM_ALG_GCM {
if-feature "TPM20";
base tpm2;
base symmetric;
base signing;
base encryption_mode;
description
"Galois/Counter Mode (GCM)";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
NIST SP800-38D. ALG_ID: 0x0051";
}
identity TPM_ALG_KW {
if-feature "TPM20";
base tpm2;
base symmetric;
base signing;
base encryption_mode;
description
"AES Key Wrap (KW)";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
NIST SP800-38F. ALG_ID: 0x0052";
}
identity TPM_ALG_KWP {
if-feature "TPM20";
base tpm2;
base symmetric;
base signing;
base encryption_mode;
description
"AES Key Wrap with Padding (KWP)";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
NIST SP800-38F. ALG_ID: 0x0053";
}
identity TPM_ALG_EAX {
if-feature "TPM20";
base tpm2;
base symmetric;
base signing;
base encryption_mode;
description
"Authenticated-Encryption Mode";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
NIST SP800-38F. ALG_ID: 0x0054";
}
identity TPM_ALG_EDDSA {
if-feature "TPM20";
base tpm2;
base asymmetric;
base signing;
description
"Edwards-curve Digital Signature Algorithm (PureEdDSA)";
reference
"TCG_Algorithm_Registry_r1p32_pub Table 3 and
RFC 8032. ALG_ID: 0x0060";
}
}