This repository has been archived by the owner on Nov 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
tpm2_types.i
1397 lines (1376 loc) · 54.5 KB
/
tpm2_types.i
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
/* SPDX-License-Identifier: BSD-2-Clause */
/*******************************************************************************
* Copyright (c) 2019, Intel Corporation
* All rights reserved.
*******************************************************************************/
#define TSS2_API_VERSION_1_2_1_108
%include "tss2/tss2_common.h"
%include "tss2/tss2_tpm2_types.h"
%{
#include <tss2/tss2_rc.h>
%}
extern const char *Tss2_RC_Decode(TSS2_RC rc);
%include "cmalloc.i"
%include "cpointer.i"
%include "carrays.i"
/* TODO For some reason this doesn't work if we name it TPMI_YES_NO */
%pointer_functions(TPMI_YES_NO, TPMI_YES_NO_PTR);
/* Gernate the following with:
* $ grep -E '} .*;' "$(pkg-config --cflags-only-I tss2-esys | sed -e 's/-I//g' -e 's/ //g')/tss2/tss2_tpm2_types.h" | sed -e 's/} //g' -e 's/;//g' | sed -e 's#.*#%sizeof(&);\n%array_class(&, &_ARRAY);\n%pointer_functions(&, &_PTR);\n%pointer_functions(& *, &_PTR_PTR);#g' > tpm2_pytss/swig/tpm2_structures.i
*/
/* BEGIN GENERATED POINTER_CLASSES */
%include "tpm2_structures.i"
/* END GENERATED POINTER_CLASSES */
%include "stdint.i"
typedef uint8_t UINT8;
typedef uint8_t BYTE;
typedef int8_t INT8;
typedef int BOOL;
typedef uint16_t UINT16;
typedef int16_t INT16;
typedef uint32_t UINT32;
typedef int32_t INT32;
typedef uint64_t UINT64;
typedef int64_t INT64;
%pointer_functions(void *, VOID_PTR_PTR);
%pointer_functions(size_t, SIZE_T_PTR);
%pointer_functions(size_t *, SIZE_T_PTR_PTR);
%pointer_functions(char, CHAR_PTR);
%pointer_functions(char *, CHAR_PTR_PTR);
%pointer_functions(UINT8, UINT8_PTR);
%pointer_functions(UINT8 *, UINT8_PTR_PTR);
%array_class(UINT8, UINT8_ARRAY);
%array_class(UINT32, UINT32_ARRAY);
%pointer_class(uint32_t, uint32_t_PTR);
%pointer_functions(uint32_t_PTR, uint32_t_PTR_PTR);
%pointer_class(UINT32, UINT32_PTR);
%pointer_functions(UINT32_PTR, UINT32_PTR_PTR);
%pointer_class(uint16_t, uint16_t_PTR);
%pointer_functions(uint16_t_PTR, uint16_t_PTR_PTR);
%pointer_class(UINT16, UINT16_PTR);
%pointer_functions(UINT16_PTR, UINT16_PTR_PTR);
%array_class(UINT16, UINT16_ARRAY);
%array_class(BYTE, ByteArray);
#define TSS2_TCTI_TIMEOUT_BLOCK -1
#define TSS2_TCTI_TIMEOUT_NONE 0
%sizeof(TPMU_HA);
#define ESYS_TR_NONE 0xfffU
#define ESYS_TR_PASSWORD 0x0ffU
#define ESYS_TR_PCR0 0U
#define ESYS_TR_PCR1 1U
#define ESYS_TR_PCR2 2U
#define ESYS_TR_PCR3 3U
#define ESYS_TR_PCR4 4U
#define ESYS_TR_PCR5 5U
#define ESYS_TR_PCR6 6U
#define ESYS_TR_PCR7 7U
#define ESYS_TR_PCR8 8U
#define ESYS_TR_PCR9 9U
#define ESYS_TR_PCR10 10U
#define ESYS_TR_PCR11 11U
#define ESYS_TR_PCR12 12U
#define ESYS_TR_PCR13 13U
#define ESYS_TR_PCR14 14U
#define ESYS_TR_PCR15 15U
#define ESYS_TR_PCR16 16U
#define ESYS_TR_PCR17 17U
#define ESYS_TR_PCR18 18U
#define ESYS_TR_PCR19 19U
#define ESYS_TR_PCR20 20U
#define ESYS_TR_PCR21 21U
#define ESYS_TR_PCR22 22U
#define ESYS_TR_PCR23 23U
#define ESYS_TR_PCR24 24U
#define ESYS_TR_PCR25 25U
#define ESYS_TR_PCR26 26U
#define ESYS_TR_PCR27 27U
#define ESYS_TR_PCR28 28U
#define ESYS_TR_PCR29 29U
#define ESYS_TR_PCR30 30U
#define ESYS_TR_PCR31 31U
#define ESYS_TR_RH_OWNER 0x101U
#define ESYS_TR_RH_NULL 0x107U
#define ESYS_TR_RH_LOCKOUT 0x10AU
#define ESYS_TR_RH_ENDORSEMENT 0x10BU
#define ESYS_TR_RH_PLATFORM 0x10CU
#define ESYS_TR_RH_PLATFORM_NV 0x10DU
#define ESYS_TR_RH_AUTH_FIRST 0x110U
#define ESYS_TR_RH_AUTH(x) (ESYS_TR_RH_AUTH_FIRST + (ESYS_TR)(x))
#define ESYS_TR_MIN_OBJECT 0x1000U
#define ESYS_TR unsigned int
%inline %{
typedef ByteArray BYTE_ARRAY;
typedef TPM2B_DIGEST TPM2B_NONCE;
typedef TPM2B_DIGEST TPM2B_AUTH;
typedef TPM2B_DIGEST TPM2B_OPERAND;
typedef TPM2B_DIGEST TPM2B_TIMEOUT;
typedef UINT16 TPM2_ALG_ID;
typedef UINT16 TPM2_ECC_CURVE;
typedef UINT32 TPM2_CC;
typedef UINT32 TPM2_ALGORITHM_ID;
typedef UINT32 TPM2_MODIFIER_INDICATOR;
typedef UINT32 TPM2_AUTHORIZATION_SIZE;
typedef UINT32 TPM2_PARAMETER_SIZE;
typedef UINT16 TPM2_KEY_SIZE;
typedef UINT16 TPM2_KEY_BITS;
typedef UINT32 TPM2_SPEC;
typedef UINT32 TPM2_GENERATED;
typedef UINT32 TPM2_RC;
typedef INT8 TPM2_CLOCK_ADJUST;
typedef UINT16 TPM2_EO;
typedef UINT16 TPM2_ST;
typedef UINT16 TPM2_SU;
typedef UINT8 TPM2_SE;
typedef UINT32 TPM2_CAP;
typedef UINT32 TPM2_PT;
typedef UINT32 TPM2_PT_PCR;
typedef UINT32 TPM2_PS;
typedef UINT32 TPM2_HANDLE;
typedef UINT8 TPM2_HT;
typedef TPM2_HANDLE TPM2_RH;
typedef TPM2_HANDLE TPM2_HC;
typedef uint32_t TPMA_ALGORITHM;
typedef uint32_t TPMA_OBJECT;
typedef UINT8 TPMA_SESSION;
typedef UINT8 TPMA_LOCALITY;
typedef uint32_t TPMA_PERMANENT;
typedef uint32_t TPMA_STARTUP_CLEAR;
typedef uint32_t TPMA_MEMORY;
typedef uint32_t TPMA_CC;
typedef uint32_t TPMA_MODES;
typedef BYTE TPMI_YES_NO;
typedef TPM2_HANDLE TPMI_DH_OBJECT;
typedef TPM2_HANDLE TPMI_DH_PERSISTENT;
typedef TPM2_HANDLE TPMI_DH_ENTITY;
typedef TPM2_HANDLE TPMI_DH_PCR;
typedef TPM2_HANDLE TPMI_SH_AUTH_SESSION;
typedef TPM2_HANDLE TPMI_SH_HMAC;
typedef TPM2_HANDLE TPMI_SH_POLICY;
typedef TPM2_HANDLE TPMI_DH_CONTEXT;
typedef TPM2_HANDLE TPMI_RH_HIERARCHY;
typedef TPM2_HANDLE TPMI_RH_ENABLES;
typedef TPM2_HANDLE TPMI_RH_HIERARCHY_AUTH;
typedef TPM2_HANDLE TPMI_RH_PLATFORM;
typedef TPM2_HANDLE TPMI_RH_OWNER;
typedef TPM2_HANDLE TPMI_RH_ENDORSEMENT;
typedef TPM2_HANDLE TPMI_RH_PROVISION;
typedef TPM2_HANDLE TPMI_RH_CLEAR;
typedef TPM2_HANDLE TPMI_RH_NV_AUTH;
typedef TPM2_HANDLE TPMI_RH_LOCKOUT;
typedef TPM2_HANDLE TPMI_RH_NV_INDEX;
typedef TPM2_ALG_ID TPMI_ALG_HASH;
typedef TPM2_ALG_ID TPMI_ALG_ASYM;
typedef TPM2_ALG_ID TPMI_ALG_SYM;
typedef TPM2_ALG_ID TPMI_ALG_SYM_OBJECT;
typedef TPM2_ALG_ID TPMI_ALG_SYM_MODE;
typedef TPM2_ALG_ID TPMI_ALG_KDF;
typedef TPM2_ALG_ID TPMI_ALG_SIG_SCHEME;
typedef TPM2_ALG_ID TPMI_ECC_KEY_EXCHANGE;
typedef TPM2_ST TPMI_ST_COMMAND_TAG;
typedef TPM2_ST TPMI_ST_ATTEST;
typedef TPM2_KEY_BITS TPMI_AES_KEY_BITS;
typedef TPM2_KEY_BITS TPMI_SM4_KEY_BITS;
typedef TPM2_KEY_BITS TPMI_TPM2_CAMELLIA_KEY_BITS;
typedef TPM2_ALG_ID TPMI_ALG_KEYEDHASH_SCHEME;
typedef TPMS_SCHEME_HASH TPMS_SCHEME_HMAC;
typedef TPMS_SCHEME_HASH TPMS_SIG_SCHEME_RSASSA;
typedef TPMS_SCHEME_HASH TPMS_SIG_SCHEME_RSAPSS;
typedef TPMS_SCHEME_HASH TPMS_SIG_SCHEME_ECDSA;
typedef TPMS_SCHEME_HASH TPMS_SIG_SCHEME_SM2;
typedef TPMS_SCHEME_HASH TPMS_SIG_SCHEME_ECSCHNORR;
typedef TPMS_SCHEME_ECDAA TPMS_SIG_SCHEME_ECDAA;
typedef TPMS_SCHEME_HASH TPMS_ENC_SCHEME_OAEP;
typedef TPMS_EMPTY TPMS_ENC_SCHEME_RSAES;
typedef TPMS_SCHEME_HASH TPMS_KEY_SCHEME_ECDH;
typedef TPMS_SCHEME_HASH TPMS_KEY_SCHEME_ECMQV;
typedef TPMS_SCHEME_HASH TPMS_SCHEME_MGF1;
typedef TPMS_SCHEME_HASH TPMS_SCHEME_KDF1_SP800_56A;
typedef TPMS_SCHEME_HASH TPMS_SCHEME_KDF2;
typedef TPMS_SCHEME_HASH TPMS_SCHEME_KDF1_SP800_108;
typedef TPM2_ALG_ID TPMI_ALG_ASYM_SCHEME;
typedef TPM2_ALG_ID TPMI_ALG_RSA_SCHEME;
typedef TPM2_ALG_ID TPMI_ALG_RSA_DECRYPT;
typedef TPM2_KEY_BITS TPMI_RSA_KEY_BITS;
typedef TPM2_ALG_ID TPMI_ALG_ECC_SCHEME;
typedef TPM2_ECC_CURVE TPMI_ECC_CURVE;
typedef TPMS_SIGNATURE_RSA TPMS_SIGNATURE_RSASSA;
typedef TPMS_SIGNATURE_RSA TPMS_SIGNATURE_RSAPSS;
typedef TPMS_SIGNATURE_ECC TPMS_SIGNATURE_ECDSA;
typedef TPMS_SIGNATURE_ECC TPMS_SIGNATURE_ECDAA;
typedef TPMS_SIGNATURE_ECC TPMS_SIGNATURE_SM2;
typedef TPMS_SIGNATURE_ECC TPMS_SIGNATURE_ECSCHNORR;
typedef TPM2_ALG_ID TPMI_ALG_PUBLIC;
typedef uint32_t TPM2_NV_INDEX;
typedef UINT8 TPM2_NT;
typedef uint32_t TPMA_NV;
typedef UINT32 TPM_AT;
typedef UINT32 TPM_EA;
typedef TPM2_HANDLE TPMI_RH_AC;
%}
/* SWIG doesn't propagate #defines defined in include files to
* generated wrapper code therefore these need to be redefined
* manually here */
#define TPM2_MAX_COMMAND_SIZE 4096
#define TPM2_MAX_RESPONSE_SIZE 4096
#define TPM2_NUM_PCR_BANKS 16
#define TPM2_MAX_DIGEST_BUFFER 1024
#define TPM2_MAX_NV_BUFFER_SIZE 2048
#define TPM2_MAX_PCRS 32
#define TPM2_MAX_ALG_LIST_SIZE 128
#define TPM2_MAX_CAP_CC 256
#define TPM2_MAX_CAP_BUFFER 1024
#define TPM2_MAX_CONTEXT_SIZE 5120
#define TPM2_SHA_DIGEST_SIZE 20
#define TPM2_SHA1_DIGEST_SIZE 20
#define TPM2_SHA256_DIGEST_SIZE 32
#define TPM2_SHA384_DIGEST_SIZE 48
#define TPM2_SHA512_DIGEST_SIZE 64
#define TPM2_SM3_256_DIGEST_SIZE 32
#define TPM2_MAX_SYM_BLOCK_SIZE 16
#define TPM2_MAX_SYM_DATA 256
#define TPM2_MAX_ECC_KEY_BYTES 128
#define TPM2_MAX_SYM_KEY_BYTES 32
#define TPM2_MAX_RSA_KEY_BYTES 512
#define TPM2_LABEL_MAX_BUFFER 32
#undef TPM2_PCR_SELECT_MAX
#define TPM2_PCR_SELECT_MAX ((TPM2_MAX_PCRS + 7) / 8)
#undef TPM2_MAX_CAP_HANDLES
#define TPM2_MAX_CAP_HANDLES ((TPM2_MAX_CAP_BUFFER - 8) / 4)
#undef TPM2_MAX_CAP_ALGS
#define TPM2_MAX_CAP_ALGS ((TPM2_MAX_CAP_BUFFER - 8) / 8)
#undef TPM2_MAX_TPM_PROPERTIES
#define TPM2_MAX_TPM_PROPERTIES ((TPM2_MAX_CAP_BUFFER - 8) / 8)
#undef TPM2_MAX_PCR_PROPERTIES
#define TPM2_MAX_PCR_PROPERTIES ((TPM2_MAX_CAP_BUFFER - 8) / 12)
#undef TPM2_MAX_ECC_CURVES
#define TPM2_MAX_ECC_CURVES ((TPM2_MAX_CAP_BUFFER - 8) / 2)
#undef TPM2_MAX_TAGGED_POLICIES
#define TPM2_MAX_TAGGED_POLICIES ((TPM2_MAX_CAP_BUFFER - 8) / 72)
#undef TPM2_PRIVATE_VENDOR_SPECIFIC_BYTES
#define TPM2_PRIVATE_VENDOR_SPECIFIC_BYTES ((TPM2_MAX_RSA_KEY_BYTES / 2) * (3 + 2))
#undef TPM2_MAX_PTT_PROPERTIES
#define TPM2_MAX_PTT_PROPERTIES (TPM2_MAX_CAP_BUFFER / 4)
#undef TPM2_MAX_AC_CAPABILITIES
#define TPM2_MAX_AC_CAPABILITIES (TPM2_MAX_CAP_BUFFER / 8)
#undef TPM2_ALG_ERROR
#define TPM2_ALG_ERROR 0x0000
#undef TPM2_ALG_RSA
#define TPM2_ALG_RSA 0x0001
#undef TPM2_ALG_SHA
#define TPM2_ALG_SHA 0x0004
#undef TPM2_ALG_SHA1
#define TPM2_ALG_SHA1 0x0004
#undef TPM2_ALG_HMAC
#define TPM2_ALG_HMAC 0x0005
#undef TPM2_ALG_AES
#define TPM2_ALG_AES 0x0006
#undef TPM2_ALG_MGF1
#define TPM2_ALG_MGF1 0x0007
#undef TPM2_ALG_KEYEDHASH
#define TPM2_ALG_KEYEDHASH 0x0008
#undef TPM2_ALG_XOR
#define TPM2_ALG_XOR 0x000A
#undef TPM2_ALG_SHA256
#define TPM2_ALG_SHA256 0x000B
#undef TPM2_ALG_SHA384
#define TPM2_ALG_SHA384 0x000C
#undef TPM2_ALG_SHA512
#define TPM2_ALG_SHA512 0x000D
#undef TPM2_ALG_NULL
#define TPM2_ALG_NULL 0x0010
#undef TPM2_ALG_SM3_256
#define TPM2_ALG_SM3_256 0x0012
#undef TPM2_ALG_SM4
#define TPM2_ALG_SM4 0x0013
#undef TPM2_ALG_RSASSA
#define TPM2_ALG_RSASSA 0x0014
#undef TPM2_ALG_RSAES
#define TPM2_ALG_RSAES 0x0015
#undef TPM2_ALG_RSAPSS
#define TPM2_ALG_RSAPSS 0x0016
#undef TPM2_ALG_OAEP
#define TPM2_ALG_OAEP 0x0017
#undef TPM2_ALG_ECDSA
#define TPM2_ALG_ECDSA 0x0018
#undef TPM2_ALG_ECDH
#define TPM2_ALG_ECDH 0x0019
#undef TPM2_ALG_ECDAA
#define TPM2_ALG_ECDAA 0x001A
#undef TPM2_ALG_SM2
#define TPM2_ALG_SM2 0x001B
#undef TPM2_ALG_ECSCHNORR
#define TPM2_ALG_ECSCHNORR 0x001C
#undef TPM2_ALG_ECMQV
#define TPM2_ALG_ECMQV 0x001D
#undef TPM2_ALG_KDF1_SP800_56A
#define TPM2_ALG_KDF1_SP800_56A 0x0020
#undef TPM2_ALG_KDF2
#define TPM2_ALG_KDF2 0x0021
#undef TPM2_ALG_KDF1_SP800_108
#define TPM2_ALG_KDF1_SP800_108 0x0022
#undef TPM2_ALG_ECC
#define TPM2_ALG_ECC 0x0023
#undef TPM2_ALG_SYMCIPHER
#define TPM2_ALG_SYMCIPHER 0x0025
#undef TPM2_ALG_CAMELLIA
#define TPM2_ALG_CAMELLIA 0x0026
#undef TPM2_ALG_CMAC
#define TPM2_ALG_CMAC 0x003F
#undef TPM2_ALG_CTR
#define TPM2_ALG_CTR 0x0040
#undef TPM2_ALG_SHA3_256
#define TPM2_ALG_SHA3_256 0x0027
#undef TPM2_ALG_SHA3_384
#define TPM2_ALG_SHA3_384 0x0028
#undef TPM2_ALG_SHA3_512
#define TPM2_ALG_SHA3_512 0x0029
#undef TPM2_ALG_OFB
#define TPM2_ALG_OFB 0x0041
#undef TPM2_ALG_CBC
#define TPM2_ALG_CBC 0x0042
#undef TPM2_ALG_CFB
#define TPM2_ALG_CFB 0x0043
#undef TPM2_ALG_ECB
#define TPM2_ALG_ECB 0x0044
#undef TPM2_ALG_FIRST
#define TPM2_ALG_FIRST 0x0001
#undef TPM2_ALG_LAST
#define TPM2_ALG_LAST 0x0044
#undef TPM2_ECC_NONE
#define TPM2_ECC_NONE 0x0000
#undef TPM2_ECC_NIST_P192
#define TPM2_ECC_NIST_P192 0x0001
#undef TPM2_ECC_NIST_P224
#define TPM2_ECC_NIST_P224 0x0002
#undef TPM2_ECC_NIST_P256
#define TPM2_ECC_NIST_P256 0x0003
#undef TPM2_ECC_NIST_P384
#define TPM2_ECC_NIST_P384 0x0004
#undef TPM2_ECC_NIST_P521
#define TPM2_ECC_NIST_P521 0x0005
#undef TPM2_ECC_BN_P256
#define TPM2_ECC_BN_P256 0x0010
#undef TPM2_ECC_BN_P638
#define TPM2_ECC_BN_P638 0x0011
#undef TPM2_ECC_SM2_P256
#define TPM2_ECC_SM2_P256 0x0020
#undef TPM2_SPEC_FAMILY
#define TPM2_SPEC_FAMILY 0x322E3000
#undef TPM2_SPEC_LEVEL
#define TPM2_SPEC_LEVEL 00
#undef TPM2_SPEC_VERSION
#define TPM2_SPEC_VERSION 126
#undef TPM2_SPEC_YEAR
#define TPM2_SPEC_YEAR 2015
#undef TPM2_SPEC_DAY_OF_YEAR
#define TPM2_SPEC_DAY_OF_YEAR 233
#undef TPM2_GENERATED_VALUE
#define TPM2_GENERATED_VALUE 0xff544347
#undef TPM2_RC_SUCCESS
#define TPM2_RC_SUCCESS 0x000
#undef TPM2_RC_BAD_TAG
#define TPM2_RC_BAD_TAG 0x01E
#undef TPM2_RC_VER1
#define TPM2_RC_VER1 0x100
#undef TPM2_RC_INITIALIZE
#define TPM2_RC_INITIALIZE (TPM2_RC_VER1 + 0x000)
#undef TPM2_RC_FAILURE
#define TPM2_RC_FAILURE (TPM2_RC_VER1 + 0x001)
#undef TPM2_RC_SEQUENCE
#define TPM2_RC_SEQUENCE (TPM2_RC_VER1 + 0x003)
#undef TPM2_RC_PRIVATE
#define TPM2_RC_PRIVATE (TPM2_RC_VER1 + 0x00B)
#undef TPM2_RC_HMAC
#define TPM2_RC_HMAC (TPM2_RC_VER1 + 0x019)
#undef TPM2_RC_DISABLED
#define TPM2_RC_DISABLED (TPM2_RC_VER1 + 0x020)
#undef TPM2_RC_EXCLUSIVE
#define TPM2_RC_EXCLUSIVE (TPM2_RC_VER1 + 0x021)
#undef TPM2_RC_AUTH_TYPE
#define TPM2_RC_AUTH_TYPE (TPM2_RC_VER1 + 0x024)
#undef TPM2_RC_AUTH_MISSING
#define TPM2_RC_AUTH_MISSING (TPM2_RC_VER1 + 0x025)
#undef TPM2_RC_POLICY
#define TPM2_RC_POLICY (TPM2_RC_VER1 + 0x026)
#undef TPM2_RC_PCR
#define TPM2_RC_PCR (TPM2_RC_VER1 + 0x027)
#undef TPM2_RC_PCR_CHANGED
#define TPM2_RC_PCR_CHANGED (TPM2_RC_VER1 + 0x028)
#undef TPM2_RC_UPGRADE
#define TPM2_RC_UPGRADE (TPM2_RC_VER1 + 0x02D)
#undef TPM2_RC_TOO_MANY_CONTEXTS
#define TPM2_RC_TOO_MANY_CONTEXTS (TPM2_RC_VER1 + 0x02E)
#undef TPM2_RC_AUTH_UNAVAILABLE
#define TPM2_RC_AUTH_UNAVAILABLE (TPM2_RC_VER1 + 0x02F)
#undef TPM2_RC_REBOOT
#define TPM2_RC_REBOOT (TPM2_RC_VER1 + 0x030)
#undef TPM2_RC_UNBALANCED
#define TPM2_RC_UNBALANCED (TPM2_RC_VER1 + 0x031)
#undef TPM2_RC_COMMAND_SIZE
#define TPM2_RC_COMMAND_SIZE (TPM2_RC_VER1 + 0x042)
#undef TPM2_RC_COMMAND_CODE
#define TPM2_RC_COMMAND_CODE (TPM2_RC_VER1 + 0x043)
#undef TPM2_RC_AUTHSIZE
#define TPM2_RC_AUTHSIZE (TPM2_RC_VER1 + 0x044)
#undef TPM2_RC_AUTH_CONTEXT
#define TPM2_RC_AUTH_CONTEXT (TPM2_RC_VER1 + 0x045)
#undef TPM2_RC_NV_RANGE
#define TPM2_RC_NV_RANGE (TPM2_RC_VER1 + 0x046)
#undef TPM2_RC_NV_SIZE
#define TPM2_RC_NV_SIZE (TPM2_RC_VER1 + 0x047)
#undef TPM2_RC_NV_LOCKED
#define TPM2_RC_NV_LOCKED (TPM2_RC_VER1 + 0x048)
#undef TPM2_RC_NV_AUTHORIZATION
#define TPM2_RC_NV_AUTHORIZATION (TPM2_RC_VER1 + 0x049)
#undef TPM2_RC_NV_UNINITIALIZED
#define TPM2_RC_NV_UNINITIALIZED (TPM2_RC_VER1 + 0x04A)
#undef TPM2_RC_NV_SPACE
#define TPM2_RC_NV_SPACE (TPM2_RC_VER1 + 0x04B)
#undef TPM2_RC_NV_DEFINED
#define TPM2_RC_NV_DEFINED (TPM2_RC_VER1 + 0x04C)
#undef TPM2_RC_BAD_CONTEXT
#define TPM2_RC_BAD_CONTEXT (TPM2_RC_VER1 + 0x050)
#undef TPM2_RC_CPHASH
#define TPM2_RC_CPHASH (TPM2_RC_VER1 + 0x051)
#undef TPM2_RC_PARENT
#define TPM2_RC_PARENT (TPM2_RC_VER1 + 0x052)
#undef TPM2_RC_NEEDS_TEST
#define TPM2_RC_NEEDS_TEST (TPM2_RC_VER1 + 0x053)
#undef TPM2_RC_NO_RESULT
#define TPM2_RC_NO_RESULT (TPM2_RC_VER1 + 0x054)
#undef TPM2_RC_SENSITIVE
#define TPM2_RC_SENSITIVE (TPM2_RC_VER1 + 0x055)
#undef TPM2_RC_MAX_FM0
#define TPM2_RC_MAX_FM0 (TPM2_RC_VER1 + 0x07F)
#undef TPM2_RC_FMT1
#define TPM2_RC_FMT1 0x080
#undef TPM2_RC_ASYMMETRIC
#define TPM2_RC_ASYMMETRIC (TPM2_RC_FMT1 + 0x001)
#undef TPM2_RC_ATTRIBUTES
#define TPM2_RC_ATTRIBUTES (TPM2_RC_FMT1 + 0x002)
#undef TPM2_RC_HASH
#define TPM2_RC_HASH (TPM2_RC_FMT1 + 0x003)
#undef TPM2_RC_VALUE
#define TPM2_RC_VALUE (TPM2_RC_FMT1 + 0x004)
#undef TPM2_RC_HIERARCHY
#define TPM2_RC_HIERARCHY (TPM2_RC_FMT1 + 0x005)
#undef TPM2_RC_KEY_SIZE
#define TPM2_RC_KEY_SIZE (TPM2_RC_FMT1 + 0x007)
#undef TPM2_RC_MGF
#define TPM2_RC_MGF (TPM2_RC_FMT1 + 0x008)
#undef TPM2_RC_MODE
#define TPM2_RC_MODE (TPM2_RC_FMT1 + 0x009)
#undef TPM2_RC_TYPE
#define TPM2_RC_TYPE (TPM2_RC_FMT1 + 0x00A)
#undef TPM2_RC_HANDLE
#define TPM2_RC_HANDLE (TPM2_RC_FMT1 + 0x00B)
#undef TPM2_RC_KDF
#define TPM2_RC_KDF (TPM2_RC_FMT1 + 0x00C)
#undef TPM2_RC_RANGE
#define TPM2_RC_RANGE (TPM2_RC_FMT1 + 0x00D)
#undef TPM2_RC_AUTH_FAIL
#define TPM2_RC_AUTH_FAIL (TPM2_RC_FMT1 + 0x00E)
#undef TPM2_RC_NONCE
#define TPM2_RC_NONCE (TPM2_RC_FMT1 + 0x00F)
#undef TPM2_RC_PP
#define TPM2_RC_PP (TPM2_RC_FMT1 + 0x010)
#undef TPM2_RC_SCHEME
#define TPM2_RC_SCHEME (TPM2_RC_FMT1 + 0x012)
#undef TPM2_RC_SIZE
#define TPM2_RC_SIZE (TPM2_RC_FMT1 + 0x015)
#undef TPM2_RC_SYMMETRIC
#define TPM2_RC_SYMMETRIC (TPM2_RC_FMT1 + 0x016)
#undef TPM2_RC_TAG
#define TPM2_RC_TAG (TPM2_RC_FMT1 + 0x017)
#undef TPM2_RC_SELECTOR
#define TPM2_RC_SELECTOR (TPM2_RC_FMT1 + 0x018)
#undef TPM2_RC_INSUFFICIENT
#define TPM2_RC_INSUFFICIENT (TPM2_RC_FMT1 + 0x01A)
#undef TPM2_RC_SIGNATURE
#define TPM2_RC_SIGNATURE (TPM2_RC_FMT1 + 0x01B)
#undef TPM2_RC_KEY
#define TPM2_RC_KEY (TPM2_RC_FMT1 + 0x01C)
#undef TPM2_RC_POLICY_FAIL
#define TPM2_RC_POLICY_FAIL (TPM2_RC_FMT1 + 0x01D)
#undef TPM2_RC_INTEGRITY
#define TPM2_RC_INTEGRITY (TPM2_RC_FMT1 + 0x01F)
#undef TPM2_RC_TICKET
#define TPM2_RC_TICKET (TPM2_RC_FMT1 + 0x020)
#undef TPM2_RC_RESERVED_BITS
#define TPM2_RC_RESERVED_BITS (TPM2_RC_FMT1 + 0x021)
#undef TPM2_RC_BAD_AUTH
#define TPM2_RC_BAD_AUTH (TPM2_RC_FMT1 + 0x022)
#undef TPM2_RC_EXPIRED
#define TPM2_RC_EXPIRED (TPM2_RC_FMT1 + 0x023)
#undef TPM2_RC_POLICY_CC
#define TPM2_RC_POLICY_CC (TPM2_RC_FMT1 + 0x024)
#undef TPM2_RC_BINDING
#define TPM2_RC_BINDING (TPM2_RC_FMT1 + 0x025)
#undef TPM2_RC_CURVE
#define TPM2_RC_CURVE (TPM2_RC_FMT1 + 0x026)
#undef TPM2_RC_ECC_POINT
#define TPM2_RC_ECC_POINT (TPM2_RC_FMT1 + 0x027)
#undef TPM2_RC_WARN
#define TPM2_RC_WARN 0x900
#undef TPM2_RC_CONTEXT_GAP
#define TPM2_RC_CONTEXT_GAP (TPM2_RC_WARN + 0x001)
#undef TPM2_RC_OBJECT_MEMORY
#define TPM2_RC_OBJECT_MEMORY (TPM2_RC_WARN + 0x002)
#undef TPM2_RC_SESSION_MEMORY
#define TPM2_RC_SESSION_MEMORY (TPM2_RC_WARN + 0x003)
#undef TPM2_RC_MEMORY
#define TPM2_RC_MEMORY (TPM2_RC_WARN + 0x004)
#undef TPM2_RC_SESSION_HANDLES
#define TPM2_RC_SESSION_HANDLES (TPM2_RC_WARN + 0x005)
#undef TPM2_RC_OBJECT_HANDLES
#define TPM2_RC_OBJECT_HANDLES (TPM2_RC_WARN + 0x006)
#undef TPM2_RC_LOCALITY
#define TPM2_RC_LOCALITY (TPM2_RC_WARN + 0x007)
#undef TPM2_RC_YIELDED
#define TPM2_RC_YIELDED (TPM2_RC_WARN + 0x008)
#undef TPM2_RC_CANCELED
#define TPM2_RC_CANCELED (TPM2_RC_WARN + 0x009)
#undef TPM2_RC_TESTING
#define TPM2_RC_TESTING (TPM2_RC_WARN + 0x00A)
#undef TPM2_RC_REFERENCE_H0
#define TPM2_RC_REFERENCE_H0 (TPM2_RC_WARN + 0x010)
#undef TPM2_RC_REFERENCE_H1
#define TPM2_RC_REFERENCE_H1 (TPM2_RC_WARN + 0x011)
#undef TPM2_RC_REFERENCE_H2
#define TPM2_RC_REFERENCE_H2 (TPM2_RC_WARN + 0x012)
#undef TPM2_RC_REFERENCE_H3
#define TPM2_RC_REFERENCE_H3 (TPM2_RC_WARN + 0x013)
#undef TPM2_RC_REFERENCE_H4
#define TPM2_RC_REFERENCE_H4 (TPM2_RC_WARN + 0x014)
#undef TPM2_RC_REFERENCE_H5
#define TPM2_RC_REFERENCE_H5 (TPM2_RC_WARN + 0x015)
#undef TPM2_RC_REFERENCE_H6
#define TPM2_RC_REFERENCE_H6 (TPM2_RC_WARN + 0x016)
#undef TPM2_RC_REFERENCE_S0
#define TPM2_RC_REFERENCE_S0 (TPM2_RC_WARN + 0x018)
#undef TPM2_RC_REFERENCE_S1
#define TPM2_RC_REFERENCE_S1 (TPM2_RC_WARN + 0x019)
#undef TPM2_RC_REFERENCE_S2
#define TPM2_RC_REFERENCE_S2 (TPM2_RC_WARN + 0x01A)
#undef TPM2_RC_REFERENCE_S3
#define TPM2_RC_REFERENCE_S3 (TPM2_RC_WARN + 0x01B)
#undef TPM2_RC_REFERENCE_S4
#define TPM2_RC_REFERENCE_S4 (TPM2_RC_WARN + 0x01C)
#undef TPM2_RC_REFERENCE_S5
#define TPM2_RC_REFERENCE_S5 (TPM2_RC_WARN + 0x01D)
#undef TPM2_RC_REFERENCE_S6
#define TPM2_RC_REFERENCE_S6 (TPM2_RC_WARN + 0x01E)
#undef TPM2_RC_NV_RATE
#define TPM2_RC_NV_RATE (TPM2_RC_WARN + 0x020)
#undef TPM2_RC_LOCKOUT
#define TPM2_RC_LOCKOUT (TPM2_RC_WARN + 0x021)
#undef TPM2_RC_RETRY
#define TPM2_RC_RETRY (TPM2_RC_WARN + 0x022)
#undef TPM2_RC_NV_UNAVAILABLE
#define TPM2_RC_NV_UNAVAILABLE (TPM2_RC_WARN + 0x023)
#undef TPM2_RC_NOT_USED
#define TPM2_RC_NOT_USED (TPM2_RC_WARN + 0x07F)
#undef TPM2_RC_H
#define TPM2_RC_H 0x000
#undef TPM2_RC_P
#define TPM2_RC_P 0x040
#undef TPM2_RC_S
#define TPM2_RC_S 0x800
#undef TPM2_RC_1
#define TPM2_RC_1 0x100
#undef TPM2_RC_2
#define TPM2_RC_2 0x200
#undef TPM2_RC_3
#define TPM2_RC_3 0x300
#undef TPM2_RC_4
#define TPM2_RC_4 0x400
#undef TPM2_RC_5
#define TPM2_RC_5 0x500
#undef TPM2_RC_6
#define TPM2_RC_6 0x600
#undef TPM2_RC_7
#define TPM2_RC_7 0x700
#undef TPM2_RC_8
#define TPM2_RC_8 0x800
#undef TPM2_RC_9
#define TPM2_RC_9 0x900
#undef TPM2_RC_A
#define TPM2_RC_A 0xA00
#undef TPM2_RC_B
#define TPM2_RC_B 0xB00
#undef TPM2_RC_C
#define TPM2_RC_C 0xC00
#undef TPM2_RC_D
#define TPM2_RC_D 0xD00
#undef TPM2_RC_E
#define TPM2_RC_E 0xE00
#undef TPM2_RC_F
#define TPM2_RC_F 0xF00
#undef TPM2_RC_N_MASK
#define TPM2_RC_N_MASK 0xF00
#undef TPM2_CLOCK_COARSE_SLOWER
#define TPM2_CLOCK_COARSE_SLOWER -3
#undef TPM2_CLOCK_MEDIUM_SLOWER
#define TPM2_CLOCK_MEDIUM_SLOWER -2
#undef TPM2_CLOCK_FINE_SLOWER
#define TPM2_CLOCK_FINE_SLOWER -1
#undef TPM2_CLOCK_NO_CHANGE
#define TPM2_CLOCK_NO_CHANGE 0
#undef TPM2_CLOCK_FINE_FASTER
#define TPM2_CLOCK_FINE_FASTER 1
#undef TPM2_CLOCK_MEDIUM_FASTER
#define TPM2_CLOCK_MEDIUM_FASTER 2
#undef TPM2_CLOCK_COARSE_FASTER
#define TPM2_CLOCK_COARSE_FASTER 3
#undef TPM2_EO_EQ
#define TPM2_EO_EQ 0x0000
#undef TPM2_EO_NEQ
#define TPM2_EO_NEQ 0x0001
#undef TPM2_EO_SIGNED_GT
#define TPM2_EO_SIGNED_GT 0x0002
#undef TPM2_EO_UNSIGNED_GT
#define TPM2_EO_UNSIGNED_GT 0x0003
#undef TPM2_EO_SIGNED_LT
#define TPM2_EO_SIGNED_LT 0x0004
#undef TPM2_EO_UNSIGNED_LT
#define TPM2_EO_UNSIGNED_LT 0x0005
#undef TPM2_EO_SIGNED_GE
#define TPM2_EO_SIGNED_GE 0x0006
#undef TPM2_EO_UNSIGNED_GE
#define TPM2_EO_UNSIGNED_GE 0x0007
#undef TPM2_EO_SIGNED_LE
#define TPM2_EO_SIGNED_LE 0x0008
#undef TPM2_EO_UNSIGNED_LE
#define TPM2_EO_UNSIGNED_LE 0x0009
#undef TPM2_EO_BITSET
#define TPM2_EO_BITSET 0x000A
#undef TPM2_EO_BITCLEAR
#define TPM2_EO_BITCLEAR 0x000B
#undef TPM2_ST_RSP_COMMAND
#define TPM2_ST_RSP_COMMAND 0x00C4
#undef TPM2_ST_NULL
#define TPM2_ST_NULL 0X8000
#undef TPM2_ST_NO_SESSIONS
#define TPM2_ST_NO_SESSIONS 0x8001
#undef TPM2_ST_SESSIONS
#define TPM2_ST_SESSIONS 0x8002
#undef TPM2_ST_RESERVED1
#define TPM2_ST_RESERVED1 0x8003
#undef TPM2_ST_RESERVED2
#define TPM2_ST_RESERVED2 0x8004
#undef TPM2_ST_ATTEST_NV
#define TPM2_ST_ATTEST_NV 0x8014
#undef TPM2_ST_ATTEST_COMMAND_AUDIT
#define TPM2_ST_ATTEST_COMMAND_AUDIT 0x8015
#undef TPM2_ST_ATTEST_SESSION_AUDIT
#define TPM2_ST_ATTEST_SESSION_AUDIT 0x8016
#undef TPM2_ST_ATTEST_CERTIFY
#define TPM2_ST_ATTEST_CERTIFY 0x8017
#undef TPM2_ST_ATTEST_QUOTE
#define TPM2_ST_ATTEST_QUOTE 0x8018
#undef TPM2_ST_ATTEST_TIME
#define TPM2_ST_ATTEST_TIME 0x8019
#undef TPM2_ST_ATTEST_CREATION
#define TPM2_ST_ATTEST_CREATION 0x801A
#undef TPM2_ST_RESERVED3
#define TPM2_ST_RESERVED3 0x801B
#undef TPM2_ST_CREATION
#define TPM2_ST_CREATION 0x8021
#undef TPM2_ST_VERIFIED
#define TPM2_ST_VERIFIED 0x8022
#undef TPM2_ST_AUTH_SECRET
#define TPM2_ST_AUTH_SECRET 0x8023
#undef TPM2_ST_HASHCHECK
#define TPM2_ST_HASHCHECK 0x8024
#undef TPM2_ST_AUTH_SIGNED
#define TPM2_ST_AUTH_SIGNED 0x8025
#undef TPM2_ST_FU_MANIFEST
#define TPM2_ST_FU_MANIFEST 0x8029
#undef TPM2_SU_CLEAR
#define TPM2_SU_CLEAR 0x0000
#undef TPM2_SU_STATE
#define TPM2_SU_STATE 0x0001
#undef TPM2_SE_HMAC
#define TPM2_SE_HMAC 0x00
#undef TPM2_SE_POLICY
#define TPM2_SE_POLICY 0x01
#undef TPM2_SE_TRIAL
#define TPM2_SE_TRIAL 0x03
#undef TPM2_CAP_FIRST
#define TPM2_CAP_FIRST 0x00000000
#undef TPM2_CAP_ALGS
#define TPM2_CAP_ALGS 0x00000000
#undef TPM2_CAP_HANDLES
#define TPM2_CAP_HANDLES 0x00000001
#undef TPM2_CAP_COMMANDS
#define TPM2_CAP_COMMANDS 0x00000002
#undef TPM2_CAP_PP_COMMANDS
#define TPM2_CAP_PP_COMMANDS 0x00000003
#undef TPM2_CAP_AUDIT_COMMANDS
#define TPM2_CAP_AUDIT_COMMANDS 0x00000004
#undef TPM2_CAP_PCRS
#define TPM2_CAP_PCRS 0x00000005
#undef TPM2_CAP_TPM_PROPERTIES
#define TPM2_CAP_TPM_PROPERTIES 0x00000006
#undef TPM2_CAP_PCR_PROPERTIES
#define TPM2_CAP_PCR_PROPERTIES 0x00000007
#undef TPM2_CAP_ECC_CURVES
#define TPM2_CAP_ECC_CURVES 0x00000008
#undef TPM2_CAP_LAST
#define TPM2_CAP_LAST 0x00000008
#undef TPM2_CAP_VENDOR_PROPERTY
#define TPM2_CAP_VENDOR_PROPERTY 0x00000100
#undef TPM2_PT_NONE
#define TPM2_PT_NONE 0x00000000
#undef TPM2_PT_GROUP
#define TPM2_PT_GROUP 0x00000100
#undef TPM2_PT_FIXED
#define TPM2_PT_FIXED (TPM2_PT_GROUP * 1)
#undef TPM2_PT_FAMILY_INDICATOR
#define TPM2_PT_FAMILY_INDICATOR (TPM2_PT_FIXED + 0)
#undef TPM2_PT_LEVEL
#define TPM2_PT_LEVEL (TPM2_PT_FIXED + 1)
#undef TPM2_PT_REVISION
#define TPM2_PT_REVISION (TPM2_PT_FIXED + 2)
#undef TPM2_PT_DAY_OF_YEAR
#define TPM2_PT_DAY_OF_YEAR (TPM2_PT_FIXED + 3)
#undef TPM2_PT_YEAR
#define TPM2_PT_YEAR (TPM2_PT_FIXED + 4)
#undef TPM2_PT_MANUFACTURER
#define TPM2_PT_MANUFACTURER (TPM2_PT_FIXED + 5)
#undef TPM2_PT_VENDOR_STRING_1
#define TPM2_PT_VENDOR_STRING_1 (TPM2_PT_FIXED + 6)
#undef TPM2_PT_VENDOR_STRING_2
#define TPM2_PT_VENDOR_STRING_2 (TPM2_PT_FIXED + 7)
#undef TPM2_PT_VENDOR_STRING_3
#define TPM2_PT_VENDOR_STRING_3 (TPM2_PT_FIXED + 8)
#undef TPM2_PT_VENDOR_STRING_4
#define TPM2_PT_VENDOR_STRING_4 (TPM2_PT_FIXED + 9)
#undef TPM2_PT_VENDOR_TPM_TYPE
#define TPM2_PT_VENDOR_TPM_TYPE (TPM2_PT_FIXED + 10)
#undef TPM2_PT_FIRMWARE_VERSION_1
#define TPM2_PT_FIRMWARE_VERSION_1 (TPM2_PT_FIXED + 11)
#undef TPM2_PT_FIRMWARE_VERSION_2
#define TPM2_PT_FIRMWARE_VERSION_2 (TPM2_PT_FIXED + 12)
#undef TPM2_PT_INPUT_BUFFER
#define TPM2_PT_INPUT_BUFFER (TPM2_PT_FIXED + 13)
#undef TPM2_PT_TPM2_HR_TRANSIENT_MIN
#define TPM2_PT_TPM2_HR_TRANSIENT_MIN (TPM2_PT_FIXED + 14)
#undef TPM2_PT_TPM2_HR_PERSISTENT_MIN
#define TPM2_PT_TPM2_HR_PERSISTENT_MIN (TPM2_PT_FIXED + 15)
#undef TPM2_PT_HR_LOADED_MIN
#define TPM2_PT_HR_LOADED_MIN (TPM2_PT_FIXED + 16)
#undef TPM2_PT_ACTIVE_SESSIONS_MAX
#define TPM2_PT_ACTIVE_SESSIONS_MAX (TPM2_PT_FIXED + 17)
#undef TPM2_PT_PCR_COUNT
#define TPM2_PT_PCR_COUNT (TPM2_PT_FIXED + 18)
#undef TPM2_PT_PCR_SELECT_MIN
#define TPM2_PT_PCR_SELECT_MIN (TPM2_PT_FIXED + 19)
#undef TPM2_PT_CONTEXT_GAP_MAX
#define TPM2_PT_CONTEXT_GAP_MAX (TPM2_PT_FIXED + 20)
#undef TPM2_PT_NV_COUNTERS_MAX
#define TPM2_PT_NV_COUNTERS_MAX (TPM2_PT_FIXED + 22)
#undef TPM2_PT_NV_INDEX_MAX
#define TPM2_PT_NV_INDEX_MAX (TPM2_PT_FIXED + 23)
#undef TPM2_PT_MEMORY
#define TPM2_PT_MEMORY (TPM2_PT_FIXED + 24)
#undef TPM2_PT_CLOCK_UPDATE
#define TPM2_PT_CLOCK_UPDATE (TPM2_PT_FIXED + 25)
#undef TPM2_PT_CONTEXT_HASH
#define TPM2_PT_CONTEXT_HASH (TPM2_PT_FIXED + 26)
#undef TPM2_PT_CONTEXT_SYM
#define TPM2_PT_CONTEXT_SYM (TPM2_PT_FIXED + 27)
#undef TPM2_PT_CONTEXT_SYM_SIZE
#define TPM2_PT_CONTEXT_SYM_SIZE (TPM2_PT_FIXED + 28)
#undef TPM2_PT_ORDERLY_COUNT
#define TPM2_PT_ORDERLY_COUNT (TPM2_PT_FIXED + 29)
#undef TPM2_PT_MAX_COMMAND_SIZE
#define TPM2_PT_MAX_COMMAND_SIZE (TPM2_PT_FIXED + 30)
#undef TPM2_PT_MAX_RESPONSE_SIZE
#define TPM2_PT_MAX_RESPONSE_SIZE (TPM2_PT_FIXED + 31)
#undef TPM2_PT_MAX_DIGEST
#define TPM2_PT_MAX_DIGEST (TPM2_PT_FIXED + 32)
#undef TPM2_PT_MAX_OBJECT_CONTEXT
#define TPM2_PT_MAX_OBJECT_CONTEXT (TPM2_PT_FIXED + 33)
#undef TPM2_PT_MAX_SESSION_CONTEXT
#define TPM2_PT_MAX_SESSION_CONTEXT (TPM2_PT_FIXED + 34)
#undef TPM2_PT_PS_FAMILY_INDICATOR
#define TPM2_PT_PS_FAMILY_INDICATOR (TPM2_PT_FIXED + 35)
#undef TPM2_PT_PS_LEVEL
#define TPM2_PT_PS_LEVEL (TPM2_PT_FIXED + 36)
#undef TPM2_PT_PS_REVISION
#define TPM2_PT_PS_REVISION (TPM2_PT_FIXED + 37)
#undef TPM2_PT_PS_DAY_OF_YEAR
#define TPM2_PT_PS_DAY_OF_YEAR (TPM2_PT_FIXED + 38)
#undef TPM2_PT_PS_YEAR
#define TPM2_PT_PS_YEAR (TPM2_PT_FIXED + 39)
#undef TPM2_PT_SPLIT_MAX
#define TPM2_PT_SPLIT_MAX (TPM2_PT_FIXED + 40)
#undef TPM2_PT_TOTAL_COMMANDS
#define TPM2_PT_TOTAL_COMMANDS (TPM2_PT_FIXED + 41)
#undef TPM2_PT_LIBRARY_COMMANDS
#define TPM2_PT_LIBRARY_COMMANDS (TPM2_PT_FIXED + 42)
#undef TPM2_PT_VENDOR_COMMANDS
#define TPM2_PT_VENDOR_COMMANDS (TPM2_PT_FIXED + 43)
#undef TPM2_PT_NV_BUFFER_MAX
#define TPM2_PT_NV_BUFFER_MAX (TPM2_PT_FIXED + 44)
#undef TPM2_PT_MODES
#define TPM2_PT_MODES (TPM2_PT_FIXED + 45)
#undef TPM2_PT_VAR
#define TPM2_PT_VAR (TPM2_PT_GROUP * 2)
#undef TPM2_PT_PERMANENT
#define TPM2_PT_PERMANENT (TPM2_PT_VAR + 0)
#undef TPM2_PT_STARTUP_CLEAR
#define TPM2_PT_STARTUP_CLEAR (TPM2_PT_VAR + 1)
#undef TPM2_PT_TPM2_HR_NV_INDEX
#define TPM2_PT_TPM2_HR_NV_INDEX (TPM2_PT_VAR + 2)
#undef TPM2_PT_HR_LOADED
#define TPM2_PT_HR_LOADED (TPM2_PT_VAR + 3)
#undef TPM2_PT_HR_LOADED_AVAIL
#define TPM2_PT_HR_LOADED_AVAIL (TPM2_PT_VAR + 4)
#undef TPM2_PT_HR_ACTIVE
#define TPM2_PT_HR_ACTIVE (TPM2_PT_VAR + 5)
#undef TPM2_PT_HR_ACTIVE_AVAIL
#define TPM2_PT_HR_ACTIVE_AVAIL (TPM2_PT_VAR + 6)
#undef TPM2_PT_TPM2_HR_TRANSIENT_AVAIL
#define TPM2_PT_TPM2_HR_TRANSIENT_AVAIL (TPM2_PT_VAR + 7)
#undef TPM2_PT_TPM2_HR_PERSISTENT
#define TPM2_PT_TPM2_HR_PERSISTENT (TPM2_PT_VAR + 8)
#undef TPM2_PT_TPM2_HR_PERSISTENT_AVAIL
#define TPM2_PT_TPM2_HR_PERSISTENT_AVAIL (TPM2_PT_VAR + 9)
#undef TPM2_PT_NV_COUNTERS
#define TPM2_PT_NV_COUNTERS (TPM2_PT_VAR + 10)
#undef TPM2_PT_NV_COUNTERS_AVAIL
#define TPM2_PT_NV_COUNTERS_AVAIL (TPM2_PT_VAR + 11)
#undef TPM2_PT_ALGORITHM_SET
#define TPM2_PT_ALGORITHM_SET (TPM2_PT_VAR + 12)
#undef TPM2_PT_LOADED_CURVES
#define TPM2_PT_LOADED_CURVES (TPM2_PT_VAR + 13)
#undef TPM2_PT_LOCKOUT_COUNTER
#define TPM2_PT_LOCKOUT_COUNTER (TPM2_PT_VAR + 14)
#undef TPM2_PT_MAX_AUTH_FAIL
#define TPM2_PT_MAX_AUTH_FAIL (TPM2_PT_VAR + 15)
#undef TPM2_PT_LOCKOUT_INTERVAL
#define TPM2_PT_LOCKOUT_INTERVAL (TPM2_PT_VAR + 16)
#undef TPM2_PT_LOCKOUT_RECOVERY
#define TPM2_PT_LOCKOUT_RECOVERY (TPM2_PT_VAR + 17)
#undef TPM2_PT_NV_WRITE_RECOVERY
#define TPM2_PT_NV_WRITE_RECOVERY (TPM2_PT_VAR + 18)
#undef TPM2_PT_AUDIT_COUNTER_0
#define TPM2_PT_AUDIT_COUNTER_0 (TPM2_PT_VAR + 19)
#undef TPM2_PT_AUDIT_COUNTER_1
#define TPM2_PT_AUDIT_COUNTER_1 (TPM2_PT_VAR + 20)
#undef TPM2_PT_TPM2_PCR_FIRST
#define TPM2_PT_TPM2_PCR_FIRST 0x00000000
#undef TPM2_PT_PCR_SAVE
#define TPM2_PT_PCR_SAVE 0x00000000
#undef TPM2_PT_PCR_EXTEND_L0
#define TPM2_PT_PCR_EXTEND_L0 0x00000001
#undef TPM2_PT_PCR_RESET_L0
#define TPM2_PT_PCR_RESET_L0 0x00000002
#undef TPM2_PT_PCR_EXTEND_L1
#define TPM2_PT_PCR_EXTEND_L1 0x00000003
#undef TPM2_PT_PCR_RESET_L1
#define TPM2_PT_PCR_RESET_L1 0x00000004
#undef TPM2_PT_PCR_EXTEND_L2
#define TPM2_PT_PCR_EXTEND_L2 0x00000005
#undef TPM2_PT_PCR_RESET_L2
#define TPM2_PT_PCR_RESET_L2 0x00000006
#undef TPM2_PT_PCR_EXTEND_L3
#define TPM2_PT_PCR_EXTEND_L3 0x00000007
#undef TPM2_PT_PCR_RESET_L3
#define TPM2_PT_PCR_RESET_L3 0x00000008
#undef TPM2_PT_PCR_EXTEND_L4
#define TPM2_PT_PCR_EXTEND_L4 0x00000009
#undef TPM2_PT_PCR_RESET_L4
#define TPM2_PT_PCR_RESET_L4 0x0000000A
#undef TPM2_PT_PCR_NO_INCREMENT
#define TPM2_PT_PCR_NO_INCREMENT 0x00000011
#undef TPM2_PT_PCR_DRTM_RESET
#define TPM2_PT_PCR_DRTM_RESET 0x00000012
#undef TPM2_PT_PCR_POLICY
#define TPM2_PT_PCR_POLICY 0x00000013
#undef TPM2_PT_PCR_AUTH
#define TPM2_PT_PCR_AUTH 0x00000014
#undef TPM2_PT_TPM2_PCR_LAST
#define TPM2_PT_TPM2_PCR_LAST 0x00000014
#undef TPM2_PS_MAIN
#define TPM2_PS_MAIN 0x00000000
#undef TPM2_PS_PC
#define TPM2_PS_PC 0x00000001
#undef TPM2_PS_PDA
#define TPM2_PS_PDA 0x00000002
#undef TPM2_PS_CELL_PHONE
#define TPM2_PS_CELL_PHONE 0x00000003
#undef TPM2_PS_SERVER
#define TPM2_PS_SERVER 0x00000004
#undef TPM2_PS_PERIPHERAL
#define TPM2_PS_PERIPHERAL 0x00000005
#undef TPM2_PS_TSS
#define TPM2_PS_TSS 0x00000006
#undef TPM2_PS_STORAGE
#define TPM2_PS_STORAGE 0x00000007
#undef TPM2_PS_AUTHENTICATION
#define TPM2_PS_AUTHENTICATION 0x00000008
#undef TPM2_PS_EMBEDDED
#define TPM2_PS_EMBEDDED 0x00000009
#undef TPM2_PS_HARDCOPY
#define TPM2_PS_HARDCOPY 0x0000000A
#undef TPM2_PS_INFRASTRUCTURE
#define TPM2_PS_INFRASTRUCTURE 0x0000000B
#undef TPM2_PS_VIRTUALIZATION
#define TPM2_PS_VIRTUALIZATION 0x0000000C
#undef TPM2_PS_TNC
#define TPM2_PS_TNC 0x0000000D
#undef TPM2_PS_MULTI_TENANT
#define TPM2_PS_MULTI_TENANT 0x0000000E
#undef TPM2_PS_TC
#define TPM2_PS_TC 0x0000000F
#undef TPM2_HT_PCR
#define TPM2_HT_PCR 0x00
#undef TPM2_HT_NV_INDEX
#define TPM2_HT_NV_INDEX 0x01
#undef TPM2_HT_HMAC_SESSION
#define TPM2_HT_HMAC_SESSION 0x02
#undef TPM2_HT_LOADED_SESSION
#define TPM2_HT_LOADED_SESSION 0x02
#undef TPM2_HT_POLICY_SESSION
#define TPM2_HT_POLICY_SESSION 0x03
#undef TPM2_HT_SAVED_SESSION
#define TPM2_HT_SAVED_SESSION 0x03
#undef TPM2_HT_PERMANENT
#define TPM2_HT_PERMANENT 0x40
#undef TPM2_HT_TRANSIENT
#define TPM2_HT_TRANSIENT 0x80
#undef TPM2_HT_PERSISTENT
#define TPM2_HT_PERSISTENT 0x81
#undef TPM2_RH_FIRST
#define TPM2_RH_FIRST 0x40000000
#undef TPM2_RH_SRK
#define TPM2_RH_SRK 0x40000000
#undef TPM2_RH_OWNER
#define TPM2_RH_OWNER 0x40000001
#undef TPM2_RH_REVOKE
#define TPM2_RH_REVOKE 0x40000002
#undef TPM2_RH_TRANSPORT
#define TPM2_RH_TRANSPORT 0x40000003
#undef TPM2_RH_OPERATOR
#define TPM2_RH_OPERATOR 0x40000004
#undef TPM2_RH_ADMIN
#define TPM2_RH_ADMIN 0x40000005
#undef TPM2_RH_EK
#define TPM2_RH_EK 0x40000006
#undef TPM2_RH_NULL
#define TPM2_RH_NULL 0x40000007
#undef TPM2_RH_UNASSIGNED
#define TPM2_RH_UNASSIGNED 0x40000008
#undef TPM2_RS_PW
#define TPM2_RS_PW 0x40000009
#undef TPM2_RH_LOCKOUT
#define TPM2_RH_LOCKOUT 0x4000000A
#undef TPM2_RH_ENDORSEMENT
#define TPM2_RH_ENDORSEMENT 0x4000000B
#undef TPM2_RH_PLATFORM
#define TPM2_RH_PLATFORM 0x4000000C
#undef TPM2_RH_PLATFORM_NV
#define TPM2_RH_PLATFORM_NV 0x4000000D
#undef TPM2_RH_AUTH_00
#define TPM2_RH_AUTH_00 0x40000010
#undef TPM2_RH_AUTH_FF
#define TPM2_RH_AUTH_FF 0x4000010F
#undef TPM2_RH_LAST
#define TPM2_RH_LAST 0x4000010F