forked from microsoft/ms-tpm-20-ref
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TpmTypes.h
2127 lines (1915 loc) · 101 KB
/
TpmTypes.h
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
/* Microsoft Reference Implementation for TPM 2.0
*
* The copyright in this software is being made available under the BSD License,
* included below. This software may be subject to other third party and
* contributor rights, including patent rights, and no such rights are granted
* under this license.
*
* Copyright (c) Microsoft Corporation
*
* All rights reserved.
*
* BSD License
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice, this
* list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ""AS IS""
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*(Auto-generated)
* Created by TpmStructures; Version 4.1 Dec 8, 2018
* Date: Jan 29, 2019 Time: 04:50:31PM
*/
#ifndef _TPM_TYPES_H_
#define _TPM_TYPES_H_
// Table 2:5 - Definition of Types for Documentation Clarity
typedef UINT32 TPM_ALGORITHM_ID;
#define TYPE_OF_TPM_ALGORITHM_ID UINT32
typedef UINT32 TPM_MODIFIER_INDICATOR;
#define TYPE_OF_TPM_MODIFIER_INDICATOR UINT32
typedef UINT32 TPM_AUTHORIZATION_SIZE;
#define TYPE_OF_TPM_AUTHORIZATION_SIZE UINT32
typedef UINT32 TPM_PARAMETER_SIZE;
#define TYPE_OF_TPM_PARAMETER_SIZE UINT32
typedef UINT16 TPM_KEY_SIZE;
#define TYPE_OF_TPM_KEY_SIZE UINT16
typedef UINT16 TPM_KEY_BITS;
#define TYPE_OF_TPM_KEY_BITS UINT16
// Table 2:6 - Definition of TPM_SPEC Constants
typedef UINT32 TPM_SPEC;
#define TYPE_OF_TPM_SPEC UINT32
#define SPEC_FAMILY 0x322E3000
#define TPM_SPEC_FAMILY (TPM_SPEC)(SPEC_FAMILY)
#define SPEC_LEVEL 00
#define TPM_SPEC_LEVEL (TPM_SPEC)(SPEC_LEVEL)
#define SPEC_VERSION 152
#define TPM_SPEC_VERSION (TPM_SPEC)(SPEC_VERSION)
#define SPEC_YEAR 2019
#define TPM_SPEC_YEAR (TPM_SPEC)(SPEC_YEAR)
#define SPEC_DAY_OF_YEAR 28
#define TPM_SPEC_DAY_OF_YEAR (TPM_SPEC)(SPEC_DAY_OF_YEAR)
// Table 2:7 - Definition of TPM_GENERATED Constants
typedef UINT32 TPM_GENERATED;
#define TYPE_OF_TPM_GENERATED UINT32
#define TPM_GENERATED_VALUE (TPM_GENERATED)(0xFF544347)
// Table 2:16 - Definition of TPM_RC Constants
typedef UINT32 TPM_RC;
#define TYPE_OF_TPM_RC UINT32
#define TPM_RC_SUCCESS (TPM_RC)(0x000)
#define TPM_RC_BAD_TAG (TPM_RC)(0x01E)
#define RC_VER1 (TPM_RC)(0x100)
#define TPM_RC_INITIALIZE (TPM_RC)(RC_VER1+0x000)
#define TPM_RC_FAILURE (TPM_RC)(RC_VER1+0x001)
#define TPM_RC_SEQUENCE (TPM_RC)(RC_VER1+0x003)
#define TPM_RC_PRIVATE (TPM_RC)(RC_VER1+0x00B)
#define TPM_RC_HMAC (TPM_RC)(RC_VER1+0x019)
#define TPM_RC_DISABLED (TPM_RC)(RC_VER1+0x020)
#define TPM_RC_EXCLUSIVE (TPM_RC)(RC_VER1+0x021)
#define TPM_RC_AUTH_TYPE (TPM_RC)(RC_VER1+0x024)
#define TPM_RC_AUTH_MISSING (TPM_RC)(RC_VER1+0x025)
#define TPM_RC_POLICY (TPM_RC)(RC_VER1+0x026)
#define TPM_RC_PCR (TPM_RC)(RC_VER1+0x027)
#define TPM_RC_PCR_CHANGED (TPM_RC)(RC_VER1+0x028)
#define TPM_RC_UPGRADE (TPM_RC)(RC_VER1+0x02D)
#define TPM_RC_TOO_MANY_CONTEXTS (TPM_RC)(RC_VER1+0x02E)
#define TPM_RC_AUTH_UNAVAILABLE (TPM_RC)(RC_VER1+0x02F)
#define TPM_RC_REBOOT (TPM_RC)(RC_VER1+0x030)
#define TPM_RC_UNBALANCED (TPM_RC)(RC_VER1+0x031)
#define TPM_RC_COMMAND_SIZE (TPM_RC)(RC_VER1+0x042)
#define TPM_RC_COMMAND_CODE (TPM_RC)(RC_VER1+0x043)
#define TPM_RC_AUTHSIZE (TPM_RC)(RC_VER1+0x044)
#define TPM_RC_AUTH_CONTEXT (TPM_RC)(RC_VER1+0x045)
#define TPM_RC_NV_RANGE (TPM_RC)(RC_VER1+0x046)
#define TPM_RC_NV_SIZE (TPM_RC)(RC_VER1+0x047)
#define TPM_RC_NV_LOCKED (TPM_RC)(RC_VER1+0x048)
#define TPM_RC_NV_AUTHORIZATION (TPM_RC)(RC_VER1+0x049)
#define TPM_RC_NV_UNINITIALIZED (TPM_RC)(RC_VER1+0x04A)
#define TPM_RC_NV_SPACE (TPM_RC)(RC_VER1+0x04B)
#define TPM_RC_NV_DEFINED (TPM_RC)(RC_VER1+0x04C)
#define TPM_RC_BAD_CONTEXT (TPM_RC)(RC_VER1+0x050)
#define TPM_RC_CPHASH (TPM_RC)(RC_VER1+0x051)
#define TPM_RC_PARENT (TPM_RC)(RC_VER1+0x052)
#define TPM_RC_NEEDS_TEST (TPM_RC)(RC_VER1+0x053)
#define TPM_RC_NO_RESULT (TPM_RC)(RC_VER1+0x054)
#define TPM_RC_SENSITIVE (TPM_RC)(RC_VER1+0x055)
#define RC_MAX_FM0 (TPM_RC)(RC_VER1+0x07F)
#define RC_FMT1 (TPM_RC)(0x080)
#define TPM_RC_ASYMMETRIC (TPM_RC)(RC_FMT1+0x001)
#define TPM_RCS_ASYMMETRIC (TPM_RC)(RC_FMT1+0x001)
#define TPM_RC_ATTRIBUTES (TPM_RC)(RC_FMT1+0x002)
#define TPM_RCS_ATTRIBUTES (TPM_RC)(RC_FMT1+0x002)
#define TPM_RC_HASH (TPM_RC)(RC_FMT1+0x003)
#define TPM_RCS_HASH (TPM_RC)(RC_FMT1+0x003)
#define TPM_RC_VALUE (TPM_RC)(RC_FMT1+0x004)
#define TPM_RCS_VALUE (TPM_RC)(RC_FMT1+0x004)
#define TPM_RC_HIERARCHY (TPM_RC)(RC_FMT1+0x005)
#define TPM_RCS_HIERARCHY (TPM_RC)(RC_FMT1+0x005)
#define TPM_RC_KEY_SIZE (TPM_RC)(RC_FMT1+0x007)
#define TPM_RCS_KEY_SIZE (TPM_RC)(RC_FMT1+0x007)
#define TPM_RC_MGF (TPM_RC)(RC_FMT1+0x008)
#define TPM_RCS_MGF (TPM_RC)(RC_FMT1+0x008)
#define TPM_RC_MODE (TPM_RC)(RC_FMT1+0x009)
#define TPM_RCS_MODE (TPM_RC)(RC_FMT1+0x009)
#define TPM_RC_TYPE (TPM_RC)(RC_FMT1+0x00A)
#define TPM_RCS_TYPE (TPM_RC)(RC_FMT1+0x00A)
#define TPM_RC_HANDLE (TPM_RC)(RC_FMT1+0x00B)
#define TPM_RCS_HANDLE (TPM_RC)(RC_FMT1+0x00B)
#define TPM_RC_KDF (TPM_RC)(RC_FMT1+0x00C)
#define TPM_RCS_KDF (TPM_RC)(RC_FMT1+0x00C)
#define TPM_RC_RANGE (TPM_RC)(RC_FMT1+0x00D)
#define TPM_RCS_RANGE (TPM_RC)(RC_FMT1+0x00D)
#define TPM_RC_AUTH_FAIL (TPM_RC)(RC_FMT1+0x00E)
#define TPM_RCS_AUTH_FAIL (TPM_RC)(RC_FMT1+0x00E)
#define TPM_RC_NONCE (TPM_RC)(RC_FMT1+0x00F)
#define TPM_RCS_NONCE (TPM_RC)(RC_FMT1+0x00F)
#define TPM_RC_PP (TPM_RC)(RC_FMT1+0x010)
#define TPM_RCS_PP (TPM_RC)(RC_FMT1+0x010)
#define TPM_RC_SCHEME (TPM_RC)(RC_FMT1+0x012)
#define TPM_RCS_SCHEME (TPM_RC)(RC_FMT1+0x012)
#define TPM_RC_SIZE (TPM_RC)(RC_FMT1+0x015)
#define TPM_RCS_SIZE (TPM_RC)(RC_FMT1+0x015)
#define TPM_RC_SYMMETRIC (TPM_RC)(RC_FMT1+0x016)
#define TPM_RCS_SYMMETRIC (TPM_RC)(RC_FMT1+0x016)
#define TPM_RC_TAG (TPM_RC)(RC_FMT1+0x017)
#define TPM_RCS_TAG (TPM_RC)(RC_FMT1+0x017)
#define TPM_RC_SELECTOR (TPM_RC)(RC_FMT1+0x018)
#define TPM_RCS_SELECTOR (TPM_RC)(RC_FMT1+0x018)
#define TPM_RC_INSUFFICIENT (TPM_RC)(RC_FMT1+0x01A)
#define TPM_RCS_INSUFFICIENT (TPM_RC)(RC_FMT1+0x01A)
#define TPM_RC_SIGNATURE (TPM_RC)(RC_FMT1+0x01B)
#define TPM_RCS_SIGNATURE (TPM_RC)(RC_FMT1+0x01B)
#define TPM_RC_KEY (TPM_RC)(RC_FMT1+0x01C)
#define TPM_RCS_KEY (TPM_RC)(RC_FMT1+0x01C)
#define TPM_RC_POLICY_FAIL (TPM_RC)(RC_FMT1+0x01D)
#define TPM_RCS_POLICY_FAIL (TPM_RC)(RC_FMT1+0x01D)
#define TPM_RC_INTEGRITY (TPM_RC)(RC_FMT1+0x01F)
#define TPM_RCS_INTEGRITY (TPM_RC)(RC_FMT1+0x01F)
#define TPM_RC_TICKET (TPM_RC)(RC_FMT1+0x020)
#define TPM_RCS_TICKET (TPM_RC)(RC_FMT1+0x020)
#define TPM_RC_RESERVED_BITS (TPM_RC)(RC_FMT1+0x021)
#define TPM_RCS_RESERVED_BITS (TPM_RC)(RC_FMT1+0x021)
#define TPM_RC_BAD_AUTH (TPM_RC)(RC_FMT1+0x022)
#define TPM_RCS_BAD_AUTH (TPM_RC)(RC_FMT1+0x022)
#define TPM_RC_EXPIRED (TPM_RC)(RC_FMT1+0x023)
#define TPM_RCS_EXPIRED (TPM_RC)(RC_FMT1+0x023)
#define TPM_RC_POLICY_CC (TPM_RC)(RC_FMT1+0x024)
#define TPM_RCS_POLICY_CC (TPM_RC)(RC_FMT1+0x024)
#define TPM_RC_BINDING (TPM_RC)(RC_FMT1+0x025)
#define TPM_RCS_BINDING (TPM_RC)(RC_FMT1+0x025)
#define TPM_RC_CURVE (TPM_RC)(RC_FMT1+0x026)
#define TPM_RCS_CURVE (TPM_RC)(RC_FMT1+0x026)
#define TPM_RC_ECC_POINT (TPM_RC)(RC_FMT1+0x027)
#define TPM_RCS_ECC_POINT (TPM_RC)(RC_FMT1+0x027)
#define RC_WARN (TPM_RC)(0x900)
#define TPM_RC_CONTEXT_GAP (TPM_RC)(RC_WARN+0x001)
#define TPM_RC_OBJECT_MEMORY (TPM_RC)(RC_WARN+0x002)
#define TPM_RC_SESSION_MEMORY (TPM_RC)(RC_WARN+0x003)
#define TPM_RC_MEMORY (TPM_RC)(RC_WARN+0x004)
#define TPM_RC_SESSION_HANDLES (TPM_RC)(RC_WARN+0x005)
#define TPM_RC_OBJECT_HANDLES (TPM_RC)(RC_WARN+0x006)
#define TPM_RC_LOCALITY (TPM_RC)(RC_WARN+0x007)
#define TPM_RC_YIELDED (TPM_RC)(RC_WARN+0x008)
#define TPM_RC_CANCELED (TPM_RC)(RC_WARN+0x009)
#define TPM_RC_TESTING (TPM_RC)(RC_WARN+0x00A)
#define TPM_RC_REFERENCE_H0 (TPM_RC)(RC_WARN+0x010)
#define TPM_RC_REFERENCE_H1 (TPM_RC)(RC_WARN+0x011)
#define TPM_RC_REFERENCE_H2 (TPM_RC)(RC_WARN+0x012)
#define TPM_RC_REFERENCE_H3 (TPM_RC)(RC_WARN+0x013)
#define TPM_RC_REFERENCE_H4 (TPM_RC)(RC_WARN+0x014)
#define TPM_RC_REFERENCE_H5 (TPM_RC)(RC_WARN+0x015)
#define TPM_RC_REFERENCE_H6 (TPM_RC)(RC_WARN+0x016)
#define TPM_RC_REFERENCE_S0 (TPM_RC)(RC_WARN+0x018)
#define TPM_RC_REFERENCE_S1 (TPM_RC)(RC_WARN+0x019)
#define TPM_RC_REFERENCE_S2 (TPM_RC)(RC_WARN+0x01A)
#define TPM_RC_REFERENCE_S3 (TPM_RC)(RC_WARN+0x01B)
#define TPM_RC_REFERENCE_S4 (TPM_RC)(RC_WARN+0x01C)
#define TPM_RC_REFERENCE_S5 (TPM_RC)(RC_WARN+0x01D)
#define TPM_RC_REFERENCE_S6 (TPM_RC)(RC_WARN+0x01E)
#define TPM_RC_NV_RATE (TPM_RC)(RC_WARN+0x020)
#define TPM_RC_LOCKOUT (TPM_RC)(RC_WARN+0x021)
#define TPM_RC_RETRY (TPM_RC)(RC_WARN+0x022)
#define TPM_RC_NV_UNAVAILABLE (TPM_RC)(RC_WARN+0x023)
#define TPM_RC_NOT_USED (TPM_RC)(RC_WARN+0x7F)
#define TPM_RC_H (TPM_RC)(0x000)
#define TPM_RC_P (TPM_RC)(0x040)
#define TPM_RC_S (TPM_RC)(0x800)
#define TPM_RC_1 (TPM_RC)(0x100)
#define TPM_RC_2 (TPM_RC)(0x200)
#define TPM_RC_3 (TPM_RC)(0x300)
#define TPM_RC_4 (TPM_RC)(0x400)
#define TPM_RC_5 (TPM_RC)(0x500)
#define TPM_RC_6 (TPM_RC)(0x600)
#define TPM_RC_7 (TPM_RC)(0x700)
#define TPM_RC_8 (TPM_RC)(0x800)
#define TPM_RC_9 (TPM_RC)(0x900)
#define TPM_RC_A (TPM_RC)(0xA00)
#define TPM_RC_B (TPM_RC)(0xB00)
#define TPM_RC_C (TPM_RC)(0xC00)
#define TPM_RC_D (TPM_RC)(0xD00)
#define TPM_RC_E (TPM_RC)(0xE00)
#define TPM_RC_F (TPM_RC)(0xF00)
#define TPM_RC_N_MASK (TPM_RC)(0xF00)
// Table 2:17 - Definition of TPM_CLOCK_ADJUST Constants
typedef INT8 TPM_CLOCK_ADJUST;
#define TYPE_OF_TPM_CLOCK_ADJUST UINT8
#define TPM_CLOCK_COARSE_SLOWER (TPM_CLOCK_ADJUST)(-3)
#define TPM_CLOCK_MEDIUM_SLOWER (TPM_CLOCK_ADJUST)(-2)
#define TPM_CLOCK_FINE_SLOWER (TPM_CLOCK_ADJUST)(-1)
#define TPM_CLOCK_NO_CHANGE (TPM_CLOCK_ADJUST)(0)
#define TPM_CLOCK_FINE_FASTER (TPM_CLOCK_ADJUST)(1)
#define TPM_CLOCK_MEDIUM_FASTER (TPM_CLOCK_ADJUST)(2)
#define TPM_CLOCK_COARSE_FASTER (TPM_CLOCK_ADJUST)(3)
// Table 2:18 - Definition of TPM_EO Constants
typedef UINT16 TPM_EO;
#define TYPE_OF_TPM_EO UINT16
#define TPM_EO_EQ (TPM_EO)(0x0000)
#define TPM_EO_NEQ (TPM_EO)(0x0001)
#define TPM_EO_SIGNED_GT (TPM_EO)(0x0002)
#define TPM_EO_UNSIGNED_GT (TPM_EO)(0x0003)
#define TPM_EO_SIGNED_LT (TPM_EO)(0x0004)
#define TPM_EO_UNSIGNED_LT (TPM_EO)(0x0005)
#define TPM_EO_SIGNED_GE (TPM_EO)(0x0006)
#define TPM_EO_UNSIGNED_GE (TPM_EO)(0x0007)
#define TPM_EO_SIGNED_LE (TPM_EO)(0x0008)
#define TPM_EO_UNSIGNED_LE (TPM_EO)(0x0009)
#define TPM_EO_BITSET (TPM_EO)(0x000A)
#define TPM_EO_BITCLEAR (TPM_EO)(0x000B)
// Table 2:19 - Definition of TPM_ST Constants
typedef UINT16 TPM_ST;
#define TYPE_OF_TPM_ST UINT16
#define TPM_ST_RSP_COMMAND (TPM_ST)(0x00C4)
#define TPM_ST_NULL (TPM_ST)(0x8000)
#define TPM_ST_NO_SESSIONS (TPM_ST)(0x8001)
#define TPM_ST_SESSIONS (TPM_ST)(0x8002)
#define TPM_ST_ATTEST_NV (TPM_ST)(0x8014)
#define TPM_ST_ATTEST_COMMAND_AUDIT (TPM_ST)(0x8015)
#define TPM_ST_ATTEST_SESSION_AUDIT (TPM_ST)(0x8016)
#define TPM_ST_ATTEST_CERTIFY (TPM_ST)(0x8017)
#define TPM_ST_ATTEST_QUOTE (TPM_ST)(0x8018)
#define TPM_ST_ATTEST_TIME (TPM_ST)(0x8019)
#define TPM_ST_ATTEST_CREATION (TPM_ST)(0x801A)
#define TPM_ST_ATTEST_NV_DIGEST (TPM_ST)(0x801C)
#define TPM_ST_CREATION (TPM_ST)(0x8021)
#define TPM_ST_VERIFIED (TPM_ST)(0x8022)
#define TPM_ST_AUTH_SECRET (TPM_ST)(0x8023)
#define TPM_ST_HASHCHECK (TPM_ST)(0x8024)
#define TPM_ST_AUTH_SIGNED (TPM_ST)(0x8025)
#define TPM_ST_FU_MANIFEST (TPM_ST)(0x8029)
// Table 2:20 - Definition of TPM_SU Constants
typedef UINT16 TPM_SU;
#define TYPE_OF_TPM_SU UINT16
#define TPM_SU_CLEAR (TPM_SU)(0x0000)
#define TPM_SU_STATE (TPM_SU)(0x0001)
// Table 2:21 - Definition of TPM_SE Constants
typedef UINT8 TPM_SE;
#define TYPE_OF_TPM_SE UINT8
#define TPM_SE_HMAC (TPM_SE)(0x00)
#define TPM_SE_POLICY (TPM_SE)(0x01)
#define TPM_SE_TRIAL (TPM_SE)(0x03)
// Table 2:22 - Definition of TPM_CAP Constants
typedef UINT32 TPM_CAP;
#define TYPE_OF_TPM_CAP UINT32
#define TPM_CAP_FIRST (TPM_CAP)(0x00000000)
#define TPM_CAP_ALGS (TPM_CAP)(0x00000000)
#define TPM_CAP_HANDLES (TPM_CAP)(0x00000001)
#define TPM_CAP_COMMANDS (TPM_CAP)(0x00000002)
#define TPM_CAP_PP_COMMANDS (TPM_CAP)(0x00000003)
#define TPM_CAP_AUDIT_COMMANDS (TPM_CAP)(0x00000004)
#define TPM_CAP_PCRS (TPM_CAP)(0x00000005)
#define TPM_CAP_TPM_PROPERTIES (TPM_CAP)(0x00000006)
#define TPM_CAP_PCR_PROPERTIES (TPM_CAP)(0x00000007)
#define TPM_CAP_ECC_CURVES (TPM_CAP)(0x00000008)
#define TPM_CAP_AUTH_POLICIES (TPM_CAP)(0x00000009)
#define TPM_CAP_LAST (TPM_CAP)(0x00000009)
#define TPM_CAP_VENDOR_PROPERTY (TPM_CAP)(0x00000100)
// Table 2:23 - Definition of TPM_PT Constants
typedef UINT32 TPM_PT;
#define TYPE_OF_TPM_PT UINT32
#define TPM_PT_NONE (TPM_PT)(0x00000000)
#define PT_GROUP (TPM_PT)(0x00000100)
#define PT_FIXED (TPM_PT)(PT_GROUP*1)
#define TPM_PT_FAMILY_INDICATOR (TPM_PT)(PT_FIXED+0)
#define TPM_PT_LEVEL (TPM_PT)(PT_FIXED+1)
#define TPM_PT_REVISION (TPM_PT)(PT_FIXED+2)
#define TPM_PT_DAY_OF_YEAR (TPM_PT)(PT_FIXED+3)
#define TPM_PT_YEAR (TPM_PT)(PT_FIXED+4)
#define TPM_PT_MANUFACTURER (TPM_PT)(PT_FIXED+5)
#define TPM_PT_VENDOR_STRING_1 (TPM_PT)(PT_FIXED+6)
#define TPM_PT_VENDOR_STRING_2 (TPM_PT)(PT_FIXED+7)
#define TPM_PT_VENDOR_STRING_3 (TPM_PT)(PT_FIXED+8)
#define TPM_PT_VENDOR_STRING_4 (TPM_PT)(PT_FIXED+9)
#define TPM_PT_VENDOR_TPM_TYPE (TPM_PT)(PT_FIXED+10)
#define TPM_PT_FIRMWARE_VERSION_1 (TPM_PT)(PT_FIXED+11)
#define TPM_PT_FIRMWARE_VERSION_2 (TPM_PT)(PT_FIXED+12)
#define TPM_PT_INPUT_BUFFER (TPM_PT)(PT_FIXED+13)
#define TPM_PT_HR_TRANSIENT_MIN (TPM_PT)(PT_FIXED+14)
#define TPM_PT_HR_PERSISTENT_MIN (TPM_PT)(PT_FIXED+15)
#define TPM_PT_HR_LOADED_MIN (TPM_PT)(PT_FIXED+16)
#define TPM_PT_ACTIVE_SESSIONS_MAX (TPM_PT)(PT_FIXED+17)
#define TPM_PT_PCR_COUNT (TPM_PT)(PT_FIXED+18)
#define TPM_PT_PCR_SELECT_MIN (TPM_PT)(PT_FIXED+19)
#define TPM_PT_CONTEXT_GAP_MAX (TPM_PT)(PT_FIXED+20)
#define TPM_PT_NV_COUNTERS_MAX (TPM_PT)(PT_FIXED+22)
#define TPM_PT_NV_INDEX_MAX (TPM_PT)(PT_FIXED+23)
#define TPM_PT_MEMORY (TPM_PT)(PT_FIXED+24)
#define TPM_PT_CLOCK_UPDATE (TPM_PT)(PT_FIXED+25)
#define TPM_PT_CONTEXT_HASH (TPM_PT)(PT_FIXED+26)
#define TPM_PT_CONTEXT_SYM (TPM_PT)(PT_FIXED+27)
#define TPM_PT_CONTEXT_SYM_SIZE (TPM_PT)(PT_FIXED+28)
#define TPM_PT_ORDERLY_COUNT (TPM_PT)(PT_FIXED+29)
#define TPM_PT_MAX_COMMAND_SIZE (TPM_PT)(PT_FIXED+30)
#define TPM_PT_MAX_RESPONSE_SIZE (TPM_PT)(PT_FIXED+31)
#define TPM_PT_MAX_DIGEST (TPM_PT)(PT_FIXED+32)
#define TPM_PT_MAX_OBJECT_CONTEXT (TPM_PT)(PT_FIXED+33)
#define TPM_PT_MAX_SESSION_CONTEXT (TPM_PT)(PT_FIXED+34)
#define TPM_PT_PS_FAMILY_INDICATOR (TPM_PT)(PT_FIXED+35)
#define TPM_PT_PS_LEVEL (TPM_PT)(PT_FIXED+36)
#define TPM_PT_PS_REVISION (TPM_PT)(PT_FIXED+37)
#define TPM_PT_PS_DAY_OF_YEAR (TPM_PT)(PT_FIXED+38)
#define TPM_PT_PS_YEAR (TPM_PT)(PT_FIXED+39)
#define TPM_PT_SPLIT_MAX (TPM_PT)(PT_FIXED+40)
#define TPM_PT_TOTAL_COMMANDS (TPM_PT)(PT_FIXED+41)
#define TPM_PT_LIBRARY_COMMANDS (TPM_PT)(PT_FIXED+42)
#define TPM_PT_VENDOR_COMMANDS (TPM_PT)(PT_FIXED+43)
#define TPM_PT_NV_BUFFER_MAX (TPM_PT)(PT_FIXED+44)
#define TPM_PT_MODES (TPM_PT)(PT_FIXED+45)
#define TPM_PT_MAX_CAP_BUFFER (TPM_PT)(PT_FIXED+46)
#define PT_VAR (TPM_PT)(PT_GROUP*2)
#define TPM_PT_PERMANENT (TPM_PT)(PT_VAR+0)
#define TPM_PT_STARTUP_CLEAR (TPM_PT)(PT_VAR+1)
#define TPM_PT_HR_NV_INDEX (TPM_PT)(PT_VAR+2)
#define TPM_PT_HR_LOADED (TPM_PT)(PT_VAR+3)
#define TPM_PT_HR_LOADED_AVAIL (TPM_PT)(PT_VAR+4)
#define TPM_PT_HR_ACTIVE (TPM_PT)(PT_VAR+5)
#define TPM_PT_HR_ACTIVE_AVAIL (TPM_PT)(PT_VAR+6)
#define TPM_PT_HR_TRANSIENT_AVAIL (TPM_PT)(PT_VAR+7)
#define TPM_PT_HR_PERSISTENT (TPM_PT)(PT_VAR+8)
#define TPM_PT_HR_PERSISTENT_AVAIL (TPM_PT)(PT_VAR+9)
#define TPM_PT_NV_COUNTERS (TPM_PT)(PT_VAR+10)
#define TPM_PT_NV_COUNTERS_AVAIL (TPM_PT)(PT_VAR+11)
#define TPM_PT_ALGORITHM_SET (TPM_PT)(PT_VAR+12)
#define TPM_PT_LOADED_CURVES (TPM_PT)(PT_VAR+13)
#define TPM_PT_LOCKOUT_COUNTER (TPM_PT)(PT_VAR+14)
#define TPM_PT_MAX_AUTH_FAIL (TPM_PT)(PT_VAR+15)
#define TPM_PT_LOCKOUT_INTERVAL (TPM_PT)(PT_VAR+16)
#define TPM_PT_LOCKOUT_RECOVERY (TPM_PT)(PT_VAR+17)
#define TPM_PT_NV_WRITE_RECOVERY (TPM_PT)(PT_VAR+18)
#define TPM_PT_AUDIT_COUNTER_0 (TPM_PT)(PT_VAR+19)
#define TPM_PT_AUDIT_COUNTER_1 (TPM_PT)(PT_VAR+20)
// Table 2:24 - Definition of TPM_PT_PCR Constants
typedef UINT32 TPM_PT_PCR;
#define TYPE_OF_TPM_PT_PCR UINT32
#define TPM_PT_PCR_FIRST (TPM_PT_PCR)(0x00000000)
#define TPM_PT_PCR_SAVE (TPM_PT_PCR)(0x00000000)
#define TPM_PT_PCR_EXTEND_L0 (TPM_PT_PCR)(0x00000001)
#define TPM_PT_PCR_RESET_L0 (TPM_PT_PCR)(0x00000002)
#define TPM_PT_PCR_EXTEND_L1 (TPM_PT_PCR)(0x00000003)
#define TPM_PT_PCR_RESET_L1 (TPM_PT_PCR)(0x00000004)
#define TPM_PT_PCR_EXTEND_L2 (TPM_PT_PCR)(0x00000005)
#define TPM_PT_PCR_RESET_L2 (TPM_PT_PCR)(0x00000006)
#define TPM_PT_PCR_EXTEND_L3 (TPM_PT_PCR)(0x00000007)
#define TPM_PT_PCR_RESET_L3 (TPM_PT_PCR)(0x00000008)
#define TPM_PT_PCR_EXTEND_L4 (TPM_PT_PCR)(0x00000009)
#define TPM_PT_PCR_RESET_L4 (TPM_PT_PCR)(0x0000000A)
#define TPM_PT_PCR_NO_INCREMENT (TPM_PT_PCR)(0x00000011)
#define TPM_PT_PCR_DRTM_RESET (TPM_PT_PCR)(0x00000012)
#define TPM_PT_PCR_POLICY (TPM_PT_PCR)(0x00000013)
#define TPM_PT_PCR_AUTH (TPM_PT_PCR)(0x00000014)
#define TPM_PT_PCR_LAST (TPM_PT_PCR)(0x00000014)
// Table 2:25 - Definition of TPM_PS Constants
typedef UINT32 TPM_PS;
#define TYPE_OF_TPM_PS UINT32
#define TPM_PS_MAIN (TPM_PS)(0x00000000)
#define TPM_PS_PC (TPM_PS)(0x00000001)
#define TPM_PS_PDA (TPM_PS)(0x00000002)
#define TPM_PS_CELL_PHONE (TPM_PS)(0x00000003)
#define TPM_PS_SERVER (TPM_PS)(0x00000004)
#define TPM_PS_PERIPHERAL (TPM_PS)(0x00000005)
#define TPM_PS_TSS (TPM_PS)(0x00000006)
#define TPM_PS_STORAGE (TPM_PS)(0x00000007)
#define TPM_PS_AUTHENTICATION (TPM_PS)(0x00000008)
#define TPM_PS_EMBEDDED (TPM_PS)(0x00000009)
#define TPM_PS_HARDCOPY (TPM_PS)(0x0000000A)
#define TPM_PS_INFRASTRUCTURE (TPM_PS)(0x0000000B)
#define TPM_PS_VIRTUALIZATION (TPM_PS)(0x0000000C)
#define TPM_PS_TNC (TPM_PS)(0x0000000D)
#define TPM_PS_MULTI_TENANT (TPM_PS)(0x0000000E)
#define TPM_PS_TC (TPM_PS)(0x0000000F)
// Table 2:26 - Definition of Types for Handles
typedef UINT32 TPM_HANDLE;
#define TYPE_OF_TPM_HANDLE UINT32
// Table 2:27 - Definition of TPM_HT Constants
typedef UINT8 TPM_HT;
#define TYPE_OF_TPM_HT UINT8
#define TPM_HT_PCR (TPM_HT)(0x00)
#define TPM_HT_NV_INDEX (TPM_HT)(0x01)
#define TPM_HT_HMAC_SESSION (TPM_HT)(0x02)
#define TPM_HT_LOADED_SESSION (TPM_HT)(0x02)
#define TPM_HT_POLICY_SESSION (TPM_HT)(0x03)
#define TPM_HT_SAVED_SESSION (TPM_HT)(0x03)
#define TPM_HT_PERMANENT (TPM_HT)(0x40)
#define TPM_HT_TRANSIENT (TPM_HT)(0x80)
#define TPM_HT_PERSISTENT (TPM_HT)(0x81)
#define TPM_HT_AC (TPM_HT)(0x90)
// Table 2:28 - Definition of TPM_RH Constants
typedef TPM_HANDLE TPM_RH;
#define TPM_RH_FIRST (TPM_RH)(0x40000000)
#define TPM_RH_SRK (TPM_RH)(0x40000000)
#define TPM_RH_OWNER (TPM_RH)(0x40000001)
#define TPM_RH_REVOKE (TPM_RH)(0x40000002)
#define TPM_RH_TRANSPORT (TPM_RH)(0x40000003)
#define TPM_RH_OPERATOR (TPM_RH)(0x40000004)
#define TPM_RH_ADMIN (TPM_RH)(0x40000005)
#define TPM_RH_EK (TPM_RH)(0x40000006)
#define TPM_RH_NULL (TPM_RH)(0x40000007)
#define TPM_RH_UNASSIGNED (TPM_RH)(0x40000008)
#define TPM_RS_PW (TPM_RH)(0x40000009)
#define TPM_RH_LOCKOUT (TPM_RH)(0x4000000A)
#define TPM_RH_ENDORSEMENT (TPM_RH)(0x4000000B)
#define TPM_RH_PLATFORM (TPM_RH)(0x4000000C)
#define TPM_RH_PLATFORM_NV (TPM_RH)(0x4000000D)
#define TPM_RH_AUTH_00 (TPM_RH)(0x40000010)
#define TPM_RH_AUTH_FF (TPM_RH)(0x4000010F)
#define TPM_RH_LAST (TPM_RH)(0x4000010F)
// Table 2:29 - Definition of TPM_HC Constants
typedef TPM_HANDLE TPM_HC;
#define HR_HANDLE_MASK (TPM_HC)(0x00FFFFFF)
#define HR_RANGE_MASK (TPM_HC)(0xFF000000)
#define HR_SHIFT (TPM_HC)(24)
#define HR_PCR (TPM_HC)((TPM_HT_PCR<<HR_SHIFT))
#define HR_HMAC_SESSION (TPM_HC)((TPM_HT_HMAC_SESSION<<HR_SHIFT))
#define HR_POLICY_SESSION (TPM_HC)((TPM_HT_POLICY_SESSION<<HR_SHIFT))
#define HR_TRANSIENT (TPM_HC)((TPM_HT_TRANSIENT<<HR_SHIFT))
#define HR_PERSISTENT (TPM_HC)((TPM_HT_PERSISTENT<<HR_SHIFT))
#define HR_NV_INDEX (TPM_HC)((TPM_HT_NV_INDEX<<HR_SHIFT))
#define HR_PERMANENT (TPM_HC)((TPM_HT_PERMANENT<<HR_SHIFT))
#define PCR_FIRST (TPM_HC)((HR_PCR+0))
#define PCR_LAST (TPM_HC)((PCR_FIRST+IMPLEMENTATION_PCR-1))
#define HMAC_SESSION_FIRST (TPM_HC)((HR_HMAC_SESSION+0))
#define HMAC_SESSION_LAST (TPM_HC)((HMAC_SESSION_FIRST+MAX_ACTIVE_SESSIONS-1))
#define LOADED_SESSION_FIRST (TPM_HC)(HMAC_SESSION_FIRST)
#define LOADED_SESSION_LAST (TPM_HC)(HMAC_SESSION_LAST)
#define POLICY_SESSION_FIRST (TPM_HC)((HR_POLICY_SESSION+0))
#define POLICY_SESSION_LAST \
(TPM_HC)((POLICY_SESSION_FIRST+MAX_ACTIVE_SESSIONS-1))
#define TRANSIENT_FIRST (TPM_HC)((HR_TRANSIENT+0))
#define ACTIVE_SESSION_FIRST (TPM_HC)(POLICY_SESSION_FIRST)
#define ACTIVE_SESSION_LAST (TPM_HC)(POLICY_SESSION_LAST)
#define TRANSIENT_LAST (TPM_HC)((TRANSIENT_FIRST+MAX_LOADED_OBJECTS-1))
#define PERSISTENT_FIRST (TPM_HC)((HR_PERSISTENT+0))
#define PERSISTENT_LAST (TPM_HC)((PERSISTENT_FIRST+0x00FFFFFF))
#define PLATFORM_PERSISTENT (TPM_HC)((PERSISTENT_FIRST+0x00800000))
#define NV_INDEX_FIRST (TPM_HC)((HR_NV_INDEX+0))
#define NV_INDEX_LAST (TPM_HC)((NV_INDEX_FIRST+0x00FFFFFF))
#define PERMANENT_FIRST (TPM_HC)(TPM_RH_FIRST)
#define PERMANENT_LAST (TPM_HC)(TPM_RH_LAST)
#define HR_NV_AC (TPM_HC)(((TPM_HT_NV_INDEX<<HR_SHIFT)+0xD00000))
#define NV_AC_FIRST (TPM_HC)((HR_NV_AC+0))
#define NV_AC_LAST (TPM_HC)((HR_NV_AC+0x0000FFFF))
#define HR_AC (TPM_HC)((TPM_HT_AC<<HR_SHIFT))
#define AC_FIRST (TPM_HC)((HR_AC+0))
#define AC_LAST (TPM_HC)((HR_AC+0x0000FFFF))
#define TYPE_OF_TPMA_ALGORITHM UINT32
#define TPMA_ALGORITHM_TO_UINT32(a) (*((UINT32 *)&(a)))
#define UINT32_TO_TPMA_ALGORITHM(a) (*((TPMA_ALGORITHM *)&(a)))
#define TPMA_ALGORITHM_TO_BYTE_ARRAY(i, a) \
UINT32_TO_BYTE_ARRAY((TPMA_ALGORITHM_TO_UINT32(i)), (a))
#define BYTE_ARRAY_TO_TPMA_ALGORITHM(i, a) \
{UINT32 x = BYTE_ARRAY_TO_UINT32(a):i = UINT32_TO_TPMA_ALGORITHM(x):}
#if USE_BIT_FIELD_STRUCTURES
typedef struct TPMA_ALGORITHM { // Table 2:30
unsigned asymmetric : 1;
unsigned symmetric : 1;
unsigned hash : 1;
unsigned object : 1;
unsigned Reserved_bits_at_4 : 4;
unsigned signing : 1;
unsigned encrypting : 1;
unsigned method : 1;
unsigned Reserved_bits_at_11 : 21;
} TPMA_ALGORITHM; /* Bits */
// This is the initializer for a TPMA_ALGORITHM structure
#define TPMA_ALGORITHM_INITIALIZER( \
asymmetric, symmetric, hash, object, bits_at_4, \
signing, encrypting, method, bits_at_11) \
{asymmetric, symmetric, hash, object, bits_at_4, \
signing, encrypting, method, bits_at_11}
#else // USE_BIT_FIELD_STRUCTURES
// This implements Table 2:30 TPMA_ALGORITHM using bit masking
typedef UINT32 TPMA_ALGORITHM;
#define TYPE_OF_TPMA_ALGORITHM UINT32
#define TPMA_ALGORITHM_asymmetric ((TPMA_ALGORITHM)1 << 0)
#define TPMA_ALGORITHM_symmetric ((TPMA_ALGORITHM)1 << 1)
#define TPMA_ALGORITHM_hash ((TPMA_ALGORITHM)1 << 2)
#define TPMA_ALGORITHM_object ((TPMA_ALGORITHM)1 << 3)
#define TPMA_ALGORITHM_signing ((TPMA_ALGORITHM)1 << 8)
#define TPMA_ALGORITHM_encrypting ((TPMA_ALGORITHM)1 << 9)
#define TPMA_ALGORITHM_method ((TPMA_ALGORITHM)1 << 10)
// This is the initializer for a TPMA_ALGORITHM bit array.
#define TPMA_ALGORITHM_INITIALIZER( \
asymmetric, symmetric, hash, object, bits_at_4, \
signing, encrypting, method, bits_at_11) \
((asymmetric << 0) + (symmetric << 1) + (hash << 2) + \
(object << 3) + (signing << 8) + (encrypting << 9) + \
(method << 10))
#endif // USE_BIT_FIELD_STRUCTURES
#define TYPE_OF_TPMA_OBJECT UINT32
#define TPMA_OBJECT_TO_UINT32(a) (*((UINT32 *)&(a)))
#define UINT32_TO_TPMA_OBJECT(a) (*((TPMA_OBJECT *)&(a)))
#define TPMA_OBJECT_TO_BYTE_ARRAY(i, a) \
UINT32_TO_BYTE_ARRAY((TPMA_OBJECT_TO_UINT32(i)), (a))
#define BYTE_ARRAY_TO_TPMA_OBJECT(i, a) \
{ UINT32 x = BYTE_ARRAY_TO_UINT32(a); i = UINT32_TO_TPMA_OBJECT(x); }
#if USE_BIT_FIELD_STRUCTURES
typedef struct TPMA_OBJECT { // Table 2:31
unsigned Reserved_bit_at_0 : 1;
unsigned fixedTPM : 1;
unsigned stClear : 1;
unsigned Reserved_bit_at_3 : 1;
unsigned fixedParent : 1;
unsigned sensitiveDataOrigin : 1;
unsigned userWithAuth : 1;
unsigned adminWithPolicy : 1;
unsigned Reserved_bits_at_8 : 2;
unsigned noDA : 1;
unsigned encryptedDuplication : 1;
unsigned Reserved_bits_at_12 : 4;
unsigned restricted : 1;
unsigned decrypt : 1;
unsigned sign : 1;
unsigned x509sign : 1;
unsigned Reserved_bits_at_20 : 12;
} TPMA_OBJECT; /* Bits */
// This is the initializer for a TPMA_OBJECT structure
#define TPMA_OBJECT_INITIALIZER( \
bit_at_0, fixedtpm, stclear, \
bit_at_3, fixedparent, sensitivedataorigin, \
userwithauth, adminwithpolicy, bits_at_8, \
noda, encryptedduplication, bits_at_12, \
restricted, decrypt, sign, \
x509sign, bits_at_20) \
{bit_at_0, fixedtpm, stclear, \
bit_at_3, fixedparent, sensitivedataorigin, \
userwithauth, adminwithpolicy, bits_at_8, \
noda, encryptedduplication, bits_at_12, \
restricted, decrypt, sign, \
x509sign, bits_at_20}
#else // USE_BIT_FIELD_STRUCTURES
// This implements Table 2:31 TPMA_OBJECT using bit masking
typedef UINT32 TPMA_OBJECT;
#define TYPE_OF_TPMA_OBJECT UINT32
#define TPMA_OBJECT_fixedTPM ((TPMA_OBJECT)1 << 1)
#define TPMA_OBJECT_stClear ((TPMA_OBJECT)1 << 2)
#define TPMA_OBJECT_fixedParent ((TPMA_OBJECT)1 << 4)
#define TPMA_OBJECT_sensitiveDataOrigin ((TPMA_OBJECT)1 << 5)
#define TPMA_OBJECT_userWithAuth ((TPMA_OBJECT)1 << 6)
#define TPMA_OBJECT_adminWithPolicy ((TPMA_OBJECT)1 << 7)
#define TPMA_OBJECT_noDA ((TPMA_OBJECT)1 << 10)
#define TPMA_OBJECT_encryptedDuplication ((TPMA_OBJECT)1 << 11)
#define TPMA_OBJECT_restricted ((TPMA_OBJECT)1 << 16)
#define TPMA_OBJECT_decrypt ((TPMA_OBJECT)1 << 17)
#define TPMA_OBJECT_sign ((TPMA_OBJECT)1 << 18)
#define TPMA_OBJECT_x509sign ((TPMA_OBJECT)1 << 19)
// This is the initializer for a TPMA_OBJECT bit array.
#define TPMA_OBJECT_INITIALIZER( \
bit_at_0, fixedtpm, stclear, \
bit_at_3, fixedparent, sensitivedataorigin, \
userwithauth, adminwithpolicy, bits_at_8, \
noda, encryptedduplication, bits_at_12, \
restricted, decrypt, sign, \
x509sign, bits_at_20) \
((fixedtpm << 1) + (stclear << 2) + \
(fixedparent << 4) + (sensitivedataorigin << 5) + \
(userwithauth << 6) + (adminwithpolicy << 7) + \
(noda << 10) + (encryptedduplication << 11) + \
(restricted << 16) + (decrypt << 17) + \
(sign << 18) + (x509sign << 19))
#endif // USE_BIT_FIELD_STRUCTURES
#define TYPE_OF_TPMA_SESSION UINT8
#define TPMA_SESSION_TO_UINT8(a) (*((UINT8 *)&(a)))
#define UINT8_TO_TPMA_SESSION(a) (*((TPMA_SESSION *)&(a)))
#define TPMA_SESSION_TO_BYTE_ARRAY(i, a) \
UINT8_TO_BYTE_ARRAY((TPMA_SESSION_TO_UINT8(i)), (a))
#define BYTE_ARRAY_TO_TPMA_SESSION(i, a) \
{ UINT8 x = BYTE_ARRAY_TO_UINT8(a); i = UINT8_TO_TPMA_SESSION(x); }
#if USE_BIT_FIELD_STRUCTURES
typedef struct TPMA_SESSION { // Table 2:32
unsigned continueSession : 1;
unsigned auditExclusive : 1;
unsigned auditReset : 1;
unsigned Reserved_bits_at_3 : 2;
unsigned decrypt : 1;
unsigned encrypt : 1;
unsigned audit : 1;
} TPMA_SESSION; /* Bits */
// This is the initializer for a TPMA_SESSION structure
#define TPMA_SESSION_INITIALIZER( \
continuesession, auditexclusive, auditreset, bits_at_3, \
decrypt, encrypt, audit) \
{continuesession, auditexclusive, auditreset, bits_at_3, \
decrypt, encrypt, audit}
#else // USE_BIT_FIELD_STRUCTURES
// This implements Table 2:32 TPMA_SESSION using bit masking
typedef UINT8 TPMA_SESSION;
#define TYPE_OF_TPMA_SESSION UINT8
#define TPMA_SESSION_continueSession ((TPMA_SESSION)1 << 0)
#define TPMA_SESSION_auditExclusive ((TPMA_SESSION)1 << 1)
#define TPMA_SESSION_auditReset ((TPMA_SESSION)1 << 2)
#define TPMA_SESSION_decrypt ((TPMA_SESSION)1 << 5)
#define TPMA_SESSION_encrypt ((TPMA_SESSION)1 << 6)
#define TPMA_SESSION_audit ((TPMA_SESSION)1 << 7)
// This is the initializer for a TPMA_SESSION bit array.
#define TPMA_SESSION_INITIALIZER( \
continuesession, auditexclusive, auditreset, bits_at_3, \
decrypt, encrypt, audit) \
((continuesession << 0) + (auditexclusive << 1) + \
(auditreset << 2) + (decrypt << 5) + \
(encrypt << 6) + (audit << 7))
#endif // USE_BIT_FIELD_STRUCTURES
#define TYPE_OF_TPMA_LOCALITY UINT8
#define TPMA_LOCALITY_TO_UINT8(a) (*((UINT8 *)&(a)))
#define UINT8_TO_TPMA_LOCALITY(a) (*((TPMA_LOCALITY *)&(a)))
#define TPMA_LOCALITY_TO_BYTE_ARRAY(i, a) \
UINT8_TO_BYTE_ARRAY((TPMA_LOCALITY_TO_UINT8(i)), (a))
#define BYTE_ARRAY_TO_TPMA_LOCALITY(i, a) \
{ UINT8 x = BYTE_ARRAY_TO_UINT8(a); i = UINT8_TO_TPMA_LOCALITY(x); }
#if USE_BIT_FIELD_STRUCTURES
typedef struct TPMA_LOCALITY { // Table 2:33
unsigned TPM_LOC_ZERO : 1;
unsigned TPM_LOC_ONE : 1;
unsigned TPM_LOC_TWO : 1;
unsigned TPM_LOC_THREE : 1;
unsigned TPM_LOC_FOUR : 1;
unsigned Extended : 3;
} TPMA_LOCALITY; /* Bits */
// This is the initializer for a TPMA_LOCALITY structure
#define TPMA_LOCALITY_INITIALIZER( \
tpm_loc_zero, tpm_loc_one, tpm_loc_two, tpm_loc_three, \
tpm_loc_four, extended) \
{tpm_loc_zero, tpm_loc_one, tpm_loc_two, tpm_loc_three, \
tpm_loc_four, extended}
#else // USE_BIT_FIELD_STRUCTURES
// This implements Table 2:33 TPMA_LOCALITY using bit masking
typedef UINT8 TPMA_LOCALITY;
#define TYPE_OF_TPMA_LOCALITY UINT8
#define TPMA_LOCALITY_TPM_LOC_ZERO ((TPMA_LOCALITY)1 << 0)
#define TPMA_LOCALITY_TPM_LOC_ONE ((TPMA_LOCALITY)1 << 1)
#define TPMA_LOCALITY_TPM_LOC_TWO ((TPMA_LOCALITY)1 << 2)
#define TPMA_LOCALITY_TPM_LOC_THREE ((TPMA_LOCALITY)1 << 3)
#define TPMA_LOCALITY_TPM_LOC_FOUR ((TPMA_LOCALITY)1 << 4)
#define TPMA_LOCALITY_Extended_SHIFT 5
#define TPMA_LOCALITY_Extended ((TPMA_LOCALITY)0x7 << 5)
// This is the initializer for a TPMA_LOCALITY bit array.
#define TPMA_LOCALITY_INITIALIZER( \
tpm_loc_zero, tpm_loc_one, tpm_loc_two, tpm_loc_three, \
tpm_loc_four, extended) \
((tpm_loc_zero << 0) + (tpm_loc_one << 1) + (tpm_loc_two << 2) + \
(tpm_loc_three << 3) + (tpm_loc_four << 4) + (extended << 5))
#endif // USE_BIT_FIELD_STRUCTURES
#define TYPE_OF_TPMA_PERMANENT UINT32
#define TPMA_PERMANENT_TO_UINT32(a) (*((UINT32 *)&(a)))
#define UINT32_TO_TPMA_PERMANENT(a) (*((TPMA_PERMANENT *)&(a)))
#define TPMA_PERMANENT_TO_BYTE_ARRAY(i, a) \
UINT32_TO_BYTE_ARRAY((TPMA_PERMANENT_TO_UINT32(i)), (a))
#define BYTE_ARRAY_TO_TPMA_PERMANENT(i, a) \
{UINT32 x = BYTE_ARRAY_TO_UINT32(a):i = UINT32_TO_TPMA_PERMANENT(x):}
#if USE_BIT_FIELD_STRUCTURES
typedef struct TPMA_PERMANENT { // Table 2:34
unsigned ownerAuthSet : 1;
unsigned endorsementAuthSet : 1;
unsigned lockoutAuthSet : 1;
unsigned Reserved_bits_at_3 : 5;
unsigned disableClear : 1;
unsigned inLockout : 1;
unsigned tpmGeneratedEPS : 1;
unsigned Reserved_bits_at_11 : 21;
} TPMA_PERMANENT; /* Bits */
// This is the initializer for a TPMA_PERMANENT structure
#define TPMA_PERMANENT_INITIALIZER( \
ownerauthset, endorsementauthset, lockoutauthset, \
bits_at_3, disableclear, inlockout, \
tpmgeneratedeps, bits_at_11) \
{ownerauthset, endorsementauthset, lockoutauthset, \
bits_at_3, disableclear, inlockout, \
tpmgeneratedeps, bits_at_11}
#else // USE_BIT_FIELD_STRUCTURES
// This implements Table 2:34 TPMA_PERMANENT using bit masking
typedef UINT32 TPMA_PERMANENT;
#define TYPE_OF_TPMA_PERMANENT UINT32
#define TPMA_PERMANENT_ownerAuthSet ((TPMA_PERMANENT)1 << 0)
#define TPMA_PERMANENT_endorsementAuthSet ((TPMA_PERMANENT)1 << 1)
#define TPMA_PERMANENT_lockoutAuthSet ((TPMA_PERMANENT)1 << 2)
#define TPMA_PERMANENT_disableClear ((TPMA_PERMANENT)1 << 8)
#define TPMA_PERMANENT_inLockout ((TPMA_PERMANENT)1 << 9)
#define TPMA_PERMANENT_tpmGeneratedEPS ((TPMA_PERMANENT)1 << 10)
// This is the initializer for a TPMA_PERMANENT bit array.
#define TPMA_PERMANENT_INITIALIZER( \
ownerauthset, endorsementauthset, lockoutauthset, \
bits_at_3, disableclear, inlockout, \
tpmgeneratedeps, bits_at_11) \
((ownerauthset << 0) + (endorsementauthset << 1) + \
(lockoutauthset << 2) + (disableclear << 8) + \
(inlockout << 9) + (tpmgeneratedeps << 10))
#endif // USE_BIT_FIELD_STRUCTURES
#define TYPE_OF_TPMA_STARTUP_CLEAR UINT32
#define TPMA_STARTUP_CLEAR_TO_UINT32(a) (*((UINT32 *)&(a)))
#define UINT32_TO_TPMA_STARTUP_CLEAR(a) (*((TPMA_STARTUP_CLEAR *)&(a)))
#define TPMA_STARTUP_CLEAR_TO_BYTE_ARRAY(i, a) \
UINT32_TO_BYTE_ARRAY((TPMA_STARTUP_CLEAR_TO_UINT32(i)), (a))
#define BYTE_ARRAY_TO_TPMA_STARTUP_CLEAR(i, a) \
{UINT32 x = BYTE_ARRAY_TO_UINT32(a):i = UINT32_TO_TPMA_STARTUP_CLEAR(x):}
#if USE_BIT_FIELD_STRUCTURES
typedef struct TPMA_STARTUP_CLEAR { // Table 2:35
unsigned phEnable : 1;
unsigned shEnable : 1;
unsigned ehEnable : 1;
unsigned phEnableNV : 1;
unsigned Reserved_bits_at_4 : 27;
unsigned orderly : 1;
} TPMA_STARTUP_CLEAR; /* Bits */
// This is the initializer for a TPMA_STARTUP_CLEAR structure
#define TPMA_STARTUP_CLEAR_INITIALIZER( \
phenable, shenable, ehenable, phenablenv, bits_at_4, orderly) \
{phenable, shenable, ehenable, phenablenv, bits_at_4, orderly}
#else // USE_BIT_FIELD_STRUCTURES
// This implements Table 2:35 TPMA_STARTUP_CLEAR using bit masking
typedef UINT32 TPMA_STARTUP_CLEAR;
#define TYPE_OF_TPMA_STARTUP_CLEAR UINT32
#define TPMA_STARTUP_CLEAR_phEnable ((TPMA_STARTUP_CLEAR)1 << 0)
#define TPMA_STARTUP_CLEAR_shEnable ((TPMA_STARTUP_CLEAR)1 << 1)
#define TPMA_STARTUP_CLEAR_ehEnable ((TPMA_STARTUP_CLEAR)1 << 2)
#define TPMA_STARTUP_CLEAR_phEnableNV ((TPMA_STARTUP_CLEAR)1 << 3)
#define TPMA_STARTUP_CLEAR_orderly ((TPMA_STARTUP_CLEAR)1 << 31)
// This is the initializer for a TPMA_STARTUP_CLEAR bit array.
#define TPMA_STARTUP_CLEAR_INITIALIZER( \
phenable, shenable, ehenable, phenablenv, bits_at_4, orderly) \
((phenable << 0) + (shenable << 1) + (ehenable << 2) + \
(phenablenv << 3) + (orderly << 31))
#endif // USE_BIT_FIELD_STRUCTURES
#define TYPE_OF_TPMA_MEMORY UINT32
#define TPMA_MEMORY_TO_UINT32(a) (*((UINT32 *)&(a)))
#define UINT32_TO_TPMA_MEMORY(a) (*((TPMA_MEMORY *)&(a)))
#define TPMA_MEMORY_TO_BYTE_ARRAY(i, a) \
UINT32_TO_BYTE_ARRAY((TPMA_MEMORY_TO_UINT32(i)), (a))
#define BYTE_ARRAY_TO_TPMA_MEMORY(i, a) \
{ UINT32 x = BYTE_ARRAY_TO_UINT32(a); i = UINT32_TO_TPMA_MEMORY(x); }
#if USE_BIT_FIELD_STRUCTURES
typedef struct TPMA_MEMORY { // Table 2:36
unsigned sharedRAM : 1;
unsigned sharedNV : 1;
unsigned objectCopiedToRam : 1;
unsigned Reserved_bits_at_3 : 29;
} TPMA_MEMORY; /* Bits */
// This is the initializer for a TPMA_MEMORY structure
#define TPMA_MEMORY_INITIALIZER( \
sharedram, sharednv, objectcopiedtoram, bits_at_3) \
{sharedram, sharednv, objectcopiedtoram, bits_at_3}
#else // USE_BIT_FIELD_STRUCTURES
// This implements Table 2:36 TPMA_MEMORY using bit masking
typedef UINT32 TPMA_MEMORY;
#define TYPE_OF_TPMA_MEMORY UINT32
#define TPMA_MEMORY_sharedRAM ((TPMA_MEMORY)1 << 0)
#define TPMA_MEMORY_sharedNV ((TPMA_MEMORY)1 << 1)
#define TPMA_MEMORY_objectCopiedToRam ((TPMA_MEMORY)1 << 2)
// This is the initializer for a TPMA_MEMORY bit array.
#define TPMA_MEMORY_INITIALIZER( \
sharedram, sharednv, objectcopiedtoram, bits_at_3) \
((sharedram << 0) + (sharednv << 1) + (objectcopiedtoram << 2))
#endif // USE_BIT_FIELD_STRUCTURES
#define TYPE_OF_TPMA_CC UINT32
#define TPMA_CC_TO_UINT32(a) (*((UINT32 *)&(a)))
#define UINT32_TO_TPMA_CC(a) (*((TPMA_CC *)&(a)))
#define TPMA_CC_TO_BYTE_ARRAY(i, a) \
UINT32_TO_BYTE_ARRAY((TPMA_CC_TO_UINT32(i)), (a))
#define BYTE_ARRAY_TO_TPMA_CC(i, a) \
{ UINT32 x = BYTE_ARRAY_TO_UINT32(a); i = UINT32_TO_TPMA_CC(x); }
#if USE_BIT_FIELD_STRUCTURES
typedef struct TPMA_CC { // Table 2:37
unsigned commandIndex : 16;
unsigned Reserved_bits_at_16 : 6;
unsigned nv : 1;
unsigned extensive : 1;
unsigned flushed : 1;
unsigned cHandles : 3;
unsigned rHandle : 1;
unsigned V : 1;
unsigned Reserved_bits_at_30 : 2;
} TPMA_CC; /* Bits */
// This is the initializer for a TPMA_CC structure
#define TPMA_CC_INITIALIZER( \
commandindex, bits_at_16, nv, extensive, flushed, \
chandles, rhandle, v, bits_at_30) \
{commandindex, bits_at_16, nv, extensive, flushed, \
chandles, rhandle, v, bits_at_30}
#else // USE_BIT_FIELD_STRUCTURES
// This implements Table 2:37 TPMA_CC using bit masking
typedef UINT32 TPMA_CC;
#define TYPE_OF_TPMA_CC UINT32
#define TPMA_CC_commandIndex_SHIFT 0
#define TPMA_CC_commandIndex ((TPMA_CC)0xffff << 0)
#define TPMA_CC_nv ((TPMA_CC)1 << 22)
#define TPMA_CC_extensive ((TPMA_CC)1 << 23)
#define TPMA_CC_flushed ((TPMA_CC)1 << 24)
#define TPMA_CC_cHandles_SHIFT 25
#define TPMA_CC_cHandles ((TPMA_CC)0x7 << 25)
#define TPMA_CC_rHandle ((TPMA_CC)1 << 28)
#define TPMA_CC_V ((TPMA_CC)1 << 29)
// This is the initializer for a TPMA_CC bit array.
#define TPMA_CC_INITIALIZER( \
commandindex, bits_at_16, nv, extensive, flushed, \
chandles, rhandle, v, bits_at_30) \
((commandindex << 0) + (nv << 22) + (extensive << 23) + \
(flushed << 24) + (chandles << 25) + (rhandle << 28) + \
(v << 29))
#endif // USE_BIT_FIELD_STRUCTURES
#define TYPE_OF_TPMA_MODES UINT32
#define TPMA_MODES_TO_UINT32(a) (*((UINT32 *)&(a)))
#define UINT32_TO_TPMA_MODES(a) (*((TPMA_MODES *)&(a)))
#define TPMA_MODES_TO_BYTE_ARRAY(i, a) \
UINT32_TO_BYTE_ARRAY((TPMA_MODES_TO_UINT32(i)), (a))
#define BYTE_ARRAY_TO_TPMA_MODES(i, a) \
{ UINT32 x = BYTE_ARRAY_TO_UINT32(a); i = UINT32_TO_TPMA_MODES(x); }
#if USE_BIT_FIELD_STRUCTURES
typedef struct TPMA_MODES { // Table 2:38
unsigned FIPS_140_2 : 1;
unsigned Reserved_bits_at_1 : 31;
} TPMA_MODES; /* Bits */
// This is the initializer for a TPMA_MODES structure
#define TPMA_MODES_INITIALIZER(fips_140_2, bits_at_1) {fips_140_2, bits_at_1}
#else // USE_BIT_FIELD_STRUCTURES
// This implements Table 2:38 TPMA_MODES using bit masking
typedef UINT32 TPMA_MODES;
#define TYPE_OF_TPMA_MODES UINT32
#define TPMA_MODES_FIPS_140_2 ((TPMA_MODES)1 << 0)
// This is the initializer for a TPMA_MODES bit array.
#define TPMA_MODES_INITIALIZER(fips_140_2, bits_at_1) ((fips_140_2 << 0))
#endif // USE_BIT_FIELD_STRUCTURES
#define TYPE_OF_TPMA_X509_KEY_USAGE UINT32
#define TPMA_X509_KEY_USAGE_TO_UINT32(a) (*((UINT32 *)&(a)))
#define UINT32_TO_TPMA_X509_KEY_USAGE(a) (*((TPMA_X509_KEY_USAGE *)&(a)))
#define TPMA_X509_KEY_USAGE_TO_BYTE_ARRAY(i, a) \
UINT32_TO_BYTE_ARRAY((TPMA_X509_KEY_USAGE_TO_UINT32(i)), (a))
#define BYTE_ARRAY_TO_TPMA_X509_KEY_USAGE(i, a) \
{UINT32 x = BYTE_ARRAY_TO_UINT32(a):i = UINT32_TO_TPMA_X509_KEY_USAGE(x):}
#if USE_BIT_FIELD_STRUCTURES
typedef struct TPMA_X509_KEY_USAGE { // Table 2:39
unsigned digitalSignature : 1;
unsigned nonrepudiation : 1;
unsigned keyEncipherment : 1;
unsigned dataEncipherment : 1;
unsigned keyAgreement : 1;
unsigned keyCertSign : 1;
unsigned crlSign : 1;
unsigned encipherOnly : 1;
unsigned decipherOnly : 1;
unsigned Reserved_bits_at_9 : 23;
} TPMA_X509_KEY_USAGE; /* Bits */
// This is the initializer for a TPMA_X509_KEY_USAGE structure
#define TPMA_X509_KEY_USAGE_INITIALIZER( \
digitalsignature, nonrepudiation, keyencipherment, \
dataencipherment, keyagreement, keycertsign, \
crlsign, encipheronly, decipheronly, \
bits_at_9) \
{digitalsignature, nonrepudiation, keyencipherment, \
dataencipherment, keyagreement, keycertsign, \
crlsign, encipheronly, decipheronly, \
bits_at_9}
#else // USE_BIT_FIELD_STRUCTURES
// This implements Table 2:39 TPMA_X509_KEY_USAGE using bit masking
typedef UINT32 TPMA_X509_KEY_USAGE;
#define TYPE_OF_TPMA_X509_KEY_USAGE UINT32
#define TPMA_X509_KEY_USAGE_digitalSignature ((TPMA_X509_KEY_USAGE)1 << 0)
#define TPMA_X509_KEY_USAGE_nonrepudiation ((TPMA_X509_KEY_USAGE)1 << 1)
#define TPMA_X509_KEY_USAGE_keyEncipherment ((TPMA_X509_KEY_USAGE)1 << 2)
#define TPMA_X509_KEY_USAGE_dataEncipherment ((TPMA_X509_KEY_USAGE)1 << 3)
#define TPMA_X509_KEY_USAGE_keyAgreement ((TPMA_X509_KEY_USAGE)1 << 4)
#define TPMA_X509_KEY_USAGE_keyCertSign ((TPMA_X509_KEY_USAGE)1 << 5)
#define TPMA_X509_KEY_USAGE_crlSign ((TPMA_X509_KEY_USAGE)1 << 6)
#define TPMA_X509_KEY_USAGE_encipherOnly ((TPMA_X509_KEY_USAGE)1 << 7)
#define TPMA_X509_KEY_USAGE_decipherOnly ((TPMA_X509_KEY_USAGE)1 << 8)
// This is the initializer for a TPMA_X509_KEY_USAGE bit array.
#define TPMA_X509_KEY_USAGE_INITIALIZER( \
digitalsignature, nonrepudiation, keyencipherment, \
dataencipherment, keyagreement, keycertsign, \
crlsign, encipheronly, decipheronly, \
bits_at_9) \
((digitalsignature << 0) + (nonrepudiation << 1) + \
(keyencipherment << 2) + (dataencipherment << 3) + \
(keyagreement << 4) + (keycertsign << 5) + \
(crlsign << 6) + (encipheronly << 7) + \
(decipheronly << 8))
#endif // USE_BIT_FIELD_STRUCTURES
typedef BYTE TPMI_YES_NO; // Table 2:40 /* Interface */
typedef TPM_HANDLE TPMI_DH_OBJECT; // Table 2:41 /* Interface */
typedef TPM_HANDLE TPMI_DH_PARENT; // Table 2:42 /* Interface */
typedef TPM_HANDLE TPMI_DH_PERSISTENT; // Table 2:43 /* Interface */
typedef TPM_HANDLE TPMI_DH_ENTITY; // Table 2:44 /* Interface */
typedef TPM_HANDLE TPMI_DH_PCR; // Table 2:45 /* Interface */
typedef TPM_HANDLE TPMI_SH_AUTH_SESSION; // Table 2:46 /* Interface */
typedef TPM_HANDLE TPMI_SH_HMAC; // Table 2:47 /* Interface */
typedef TPM_HANDLE TPMI_SH_POLICY; // Table 2:48 /* Interface */
typedef TPM_HANDLE TPMI_DH_CONTEXT; // Table 2:49 /* Interface */
typedef TPM_HANDLE TPMI_DH_SAVED; // Table 2:50 /* Interface */
typedef TPM_HANDLE TPMI_RH_HIERARCHY; // Table 2:51 /* Interface */
typedef TPM_HANDLE TPMI_RH_ENABLES; // Table 2:52 /* Interface */
typedef TPM_HANDLE TPMI_RH_HIERARCHY_AUTH; // Table 2:53 /* Interface */
typedef TPM_HANDLE TPMI_RH_PLATFORM; // Table 2:54 /* Interface */
typedef TPM_HANDLE TPMI_RH_OWNER; // Table 2:55 /* Interface */
typedef TPM_HANDLE TPMI_RH_ENDORSEMENT; // Table 2:56 /* Interface */
typedef TPM_HANDLE TPMI_RH_PROVISION; // Table 2:57 /* Interface */
typedef TPM_HANDLE TPMI_RH_CLEAR; // Table 2:58 /* Interface */
typedef TPM_HANDLE TPMI_RH_NV_AUTH; // Table 2:59 /* Interface */
typedef TPM_HANDLE TPMI_RH_LOCKOUT; // Table 2:60 /* Interface */
typedef TPM_HANDLE TPMI_RH_NV_INDEX; // Table 2:61 /* Interface */
typedef TPM_HANDLE TPMI_RH_AC; // Table 2:62 /* Interface */
typedef TPM_ALG_ID TPMI_ALG_HASH; // Table 2:63 /* Interface */
typedef TPM_ALG_ID TPMI_ALG_ASYM; // Table 2:64 /* Interface */
typedef TPM_ALG_ID TPMI_ALG_SYM; // Table 2:65 /* Interface */
typedef TPM_ALG_ID TPMI_ALG_SYM_OBJECT; // Table 2:66 /* Interface */
typedef TPM_ALG_ID TPMI_ALG_SYM_MODE; // Table 2:67 /* Interface */