1Trusted Platform Module Library
2Part 2: Structures
3Family “2.0”
4Level 00 Revision 00.99
5October 31, 2013
6
7Contact: admin@trustedcomputinggroup.org
8
9Published
10Copyright © TCG 2006-2013
11
12TCG
13
14Part 2: Structures
15
16Trusted Platform Module Library
17
18Licenses and Notices
191. Copyright Licenses:
2021
22Trusted Computing Group (TCG) grants to the user of the source code in this specification (the
23“Source Code”) a worldwide, irrevocable, nonexclusive, royalty free, copyright license to
24reproduce, create derivative works, distribute, display and perform the Source Code and
25derivative works thereof, and to grant others the rights granted herein.
26
2728
29The TCG grants to the user of the other parts of the specification (other than the Source Code)
30the rights to reproduce, distribute, display, and perform the specification solely for the purpose of
31developing products based on such documents.
32
332. Source Code Distribution Conditions:
3435
36Redistributions of Source Code must retain the above copyright licenses, this list of conditions
37and the following disclaimers.
38
3940
41Redistributions in binary form must reproduce the above copyright licenses, this list of conditions
42and the following disclaimers in the documentation and/or other materials provided with the
43distribution.
44
453. Disclaimers:
4647
48THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF
49LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH
50RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES)
51THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE.
52Contact TCG Administration (admin@trustedcomputinggroup.org) for information on specification
53licensing rights available through TCG membership agreements.
54
5556
57THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED WARRANTIES
58WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A
59PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR NONINFRINGEMENT OF
60INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY OTHERWISE ARISING OUT OF
61ANY PROPOSAL, SPECIFICATION OR SAMPLE.
62
6364
65Without limitation, TCG and its members and licensors disclaim all liability, including liability for
66infringement of any proprietary rights, relating to use of information in this specification and to the
67implementation of this specification, and TCG disclaims all liability for cost of procurement of
68substitute goods or services, lost profits, loss of use, loss of data or any incidental, consequential,
69direct, indirect, or special damages, whether under contract, tort, warranty or otherwise, arising in
70any way out of use or reliance upon this specification or any information herein.
71
72Any marks and brands contained herein are the property of their respective owners.
73
74Page ii
75October 31, 2013
76
77Published
78Copyright © TCG 2006-2013
79
80Family “2.0”
81Level 00 Revision 00.99
82
83Trusted Platform Module Library
84
85Part 2: Structures
86
87CONTENTS
881
89
90Scope .................................................................................................................................................... 1
91
922
93
94Terms and definitions ............................................................................................................................ 1
95
963
97
98Symbols and abbreviated terms ............................................................................................................ 1
99
1004
101
102Notation ................................................................................................................................................. 1
1034.1
104Introduction ................................................................................................................................ 1
1054.2
106Named Constants ...................................................................................................................... 2
1074.3
108Data Type Aliases (typedefs) .................................................................................................... 3
1094.4
110Enumerations............................................................................................................................. 3
1114.5
112Interface Type ............................................................................................................................ 4
1134.6
114Arrays ........................................................................................................................................ 5
1154.7
116Structure Definitions .................................................................................................................. 6
1174.8
118Conditional Types ...................................................................................................................... 7
1194.9
120Unions........................................................................................................................................ 8
1214.9.1
122Introduction...................................................................................................................... 8
1234.9.2
124Union Definition ............................................................................................................... 8
1254.9.3
126Union Instance ................................................................................................................ 9
1274.9.4
128Union Selector Definition ............................................................................................... 10
1294.10 Bit Field Definitions .................................................................................................................. 11
1304.11 Parameter Limits ..................................................................................................................... 11
1314.12 Enumeration Macro ................................................................................................................. 13
1324.13 Size Checking .......................................................................................................................... 13
1334.14 Data Direction .......................................................................................................................... 14
1344.15 Structure Validations ............................................................................................................... 14
1354.16 Name Prefix Convention .......................................................................................................... 14
1364.17 Data Alignment ........................................................................................................................ 15
1374.18 Parameter Unmarshaling Errors .............................................................................................. 15
138
1395
140
141Base Types ......................................................................................................................................... 17
1425.1
143Primitive Types ........................................................................................................................ 17
1445.2
145Miscellaneous Types ............................................................................................................... 17
146
1476
148
149Constants ............................................................................................................................................ 18
1506.1
151TPM_SPEC (Specification Version Values) ............................................................................ 18
1526.2
153TPM_GENERATED ................................................................................................................. 18
1546.3
155TPM_ALG_ID .......................................................................................................................... 19
1566.4
157TPM_ECC_CURVE ................................................................................................................. 22
1586.5
159TPM_CC (Command Codes) .................................................................................................. 22
1606.5.1
161Format ........................................................................................................................... 22
1626.5.2
163Description .................................................................................................................... 23
1646.5.3
165TPM_CC Listing ............................................................................................................ 24
1666.6
167TPM_RC (Response Codes) ................................................................................................... 28
1686.6.1
169Description .................................................................................................................... 28
1706.6.2
171Response Code Formats .............................................................................................. 29
1726.6.3
173TPM_RC Values ........................................................................................................... 32
1746.7
175TPM_CLOCK_ADJUST ........................................................................................................... 37
1766.8
177TPM_EO (EA Arithmetic Operands) ........................................................................................ 37
1786.9
179TPM_ST (Structure Tags) ....................................................................................................... 38
1806.10 TPM_SU (Startup Type) .......................................................................................................... 40
1816.11 TPM_SE (Session Type) ......................................................................................................... 40
1826.12 TPM_CAP (Capabilities) .......................................................................................................... 41
1836.13 TPM_PT (Property Tag) .......................................................................................................... 41
1846.14 TPM_PT_PCR (PCR Property Tag) ........................................................................................ 47
1856.15 TPM_PS (Platform Specific) .................................................................................................... 49
186
187Family “2.0”
188Level 00 Revision 00.99
189
190Published
191Copyright © TCG 2006-2013
192
193Page iii
194October 31, 2013
195
196Part 2: Structures
197
198Trusted Platform Module Library
199
2007
201
202Handles ............................................................................................................................................... 50
2037.1
204Introduction .............................................................................................................................. 50
2057.2
206TPM_HT (Handle Types) ......................................................................................................... 50
2077.3
208Persistent Handle Sub-ranges................................................................................................. 51
2097.4
210TPM_RH (Permanent Handles)............................................................................................... 52
2117.5
212TPM_HC (Handle Value Constants) ....................................................................................... 53
213
2148
215
216Attribute Structures .............................................................................................................................. 55
2178.1
218Description ............................................................................................................................... 55
2198.2
220TPMA_ALGORITHM ............................................................................................................... 55
2218.3
222TPMA_OBJECT (Object Attributes) ........................................................................................ 55
2238.3.1
224Introduction.................................................................................................................... 55
2258.3.2
226Structure Definition ........................................................................................................ 56
2278.3.3
228Attribute Descriptions .................................................................................................... 57
2298.3.3.1
230Introduction ............................................................................................................ 57
2318.3.3.2
232Bit[1] – fixedTPM ................................................................................................... 57
2338.3.3.3
234Bit[2] – stClear ....................................................................................................... 58
2358.3.3.4
236Bit[4] – fixedParent ................................................................................................ 58
2378.3.3.5
238Bit[5] – sensitiveDataOrigin ................................................................................... 58
2398.3.3.6
240Bit[6] – userWithAuth............................................................................................. 59
2418.3.3.7
242Bit[7] – adminWithPolicy........................................................................................ 59
2438.3.3.8
244Bit[10] – noDA ....................................................................................................... 59
2458.3.3.9
246Bit[11] – encryptedDuplication .............................................................................. 60
2478.3.3.10
248Bit[16] – restricted ................................................................................................. 60
2498.3.3.11
250Bit[17] – decrypt .................................................................................................... 61
2518.3.3.12
252Bit[18] – sign .......................................................................................................... 61
2538.4
254TPMA_SESSION (Session Attributes) .................................................................................... 62
2558.5
256TPMA_LOCALITY (Locality Attribute) ..................................................................................... 63
2578.6
258TPMA_PERMANENT .............................................................................................................. 64
2598.7
260TPMA_STARTUP_CLEAR ...................................................................................................... 65
2618.8
262TPMA_MEMORY .................................................................................................................... 66
2638.9
264TPMA_CC (Command Code Attributes) ................................................................................. 67
2658.9.1
266Introduction.................................................................................................................... 67
2678.9.2
268Structure Definition ........................................................................................................ 67
2698.9.3
270Field Descriptions .......................................................................................................... 67
2718.9.3.1
272Bits[15:0] – commandIndex ................................................................................... 67
2738.9.3.2
274Bit[22] – nv ............................................................................................................ 67
2758.9.3.3
276Bit[23] – extensive ................................................................................................. 67
2778.9.3.4
278Bit[24] – flushed ..................................................................................................... 68
2798.9.3.5
280Bits[27:25] – cHandles .......................................................................................... 68
2818.9.3.6
282Bit[28] – rHandle .................................................................................................... 68
2838.9.3.7
284Bit[29] – V .............................................................................................................. 69
2858.9.3.8
286Bits[31:30] – Res ................................................................................................... 69
287
2889
289
290Interface Types .................................................................................................................................... 70
2919.1
292Introduction .............................................................................................................................. 70
2939.2
294TPMI_YES_NO ....................................................................................................................... 70
2959.3
296TPMI_DH_OBJECT ................................................................................................................. 70
2979.4
298TPMI_DH_PERSISTENT ........................................................................................................ 71
2999.5
300TPMI_DH_ENTITY .................................................................................................................. 71
3019.6
302TPMI_DH_PCR ....................................................................................................................... 72
3039.7
304TPMI_SH_AUTH_SESSION ................................................................................................... 72
3059.8
306TPMI_SH_HMAC .................................................................................................................... 72
3079.9
308TPMI_SH_POLICY .................................................................................................................. 72
3099.10 TPMI_DH_CONTEXT .............................................................................................................. 73
3109.11 TPMI_RH_HIERARCHY .......................................................................................................... 73
3119.12 TPMI_RH_ENABLES .............................................................................................................. 73
312
313Page iv
314October 31, 2013
315
316Published
317Copyright © TCG 2006-2013
318
319Family “2.0”
320Level 00 Revision 00.99
321
322Trusted Platform Module Library
3239.13
3249.14
3259.15
3269.16
3279.17
3289.18
3299.19
3309.20
3319.21
3329.22
3339.23
3349.24
3359.25
3369.26
3379.27
3389.28
3399.29
3409.30
34110
342
343Part 2: Structures
344
345TPMI_RH_HIERARCHY_AUTH .............................................................................................. 74
346TPMI_RH_PLATFORM ........................................................................................................... 74
347TPMI_RH_OWNER ................................................................................................................. 74
348TPMI_RH_ENDORSEMENT ................................................................................................... 75
349TPMI_RH_PROVISION ........................................................................................................... 75
350TPMI_RH_CLEAR ................................................................................................................... 75
351TPMI_RH_NV_AUTH .............................................................................................................. 76
352TPMI_RH_LOCKOUT ............................................................................................................. 76
353TPMI_RH_NV_INDEX ............................................................................................................. 76
354TPMI_ALG_HASH ................................................................................................................... 77
355TPMI_ALG_ASYM (Asymmetric Algorithms) .......................................................................... 77
356TPMI_ALG_SYM (Symmetric Algorithms) .............................................................................. 78
357TPMI_ALG_SYM_OBJECT ..................................................................................................... 78
358TPMI_ALG_SYM_MODE ........................................................................................................ 79
359TPMI_ALG_KDF (Key and Mask Generation Functions) ........................................................ 79
360TPMI_ALG_SIG_SCHEME ..................................................................................................... 80
361TPMI_ECC_KEY_EXCHANGE ............................................................................................... 80
362TPMI_ST_COMMAND_TAG ................................................................................................... 80
363
364Structure Definitions ............................................................................................................................ 81
36510.1 TPMS_ALGORITHM_DESCRIPTION .................................................................................... 81
36610.2 Hash/Digest Structures ............................................................................................................ 81
36710.2.1
368TPMU_HA (Hash) ......................................................................................................... 81
36910.2.2
370TPMT_HA...................................................................................................................... 82
37110.3 Sized Buffers ........................................................................................................................... 82
37210.3.1
373Introduction.................................................................................................................... 82
37410.3.2
375TPM2B_DIGEST ........................................................................................................... 83
37610.3.3
377TPM2B_DATA ............................................................................................................... 83
37810.3.4
379TPM2B_NONCE ........................................................................................................... 83
38010.3.5
381TPM2B_AUTH .............................................................................................................. 83
38210.3.6
383TPM2B_OPERAND ...................................................................................................... 84
38410.3.7
385TPM2B_EVENT ............................................................................................................ 84
38610.3.8
387TPM2B_MAX_BUFFER ................................................................................................ 84
38810.3.9
389TPM2B_MAX_NV_BUFFER ......................................................................................... 84
39010.3.10 TPM2B_TIMEOUT ........................................................................................................ 85
39110.3.11 TPM2B_IV ..................................................................................................................... 85
39210.4 Names ..................................................................................................................................... 85
39310.4.1
394Introduction.................................................................................................................... 85
39510.4.2
396TPMU_NAME ................................................................................................................ 85
39710.4.3
398TPM2B_NAME .............................................................................................................. 86
39910.5 PCR Structures ........................................................................................................................ 86
40010.5.1
401TPMS_PCR_SELECT ................................................................................................... 86
40210.5.2
403TPMS_PCR_SELECTION ............................................................................................ 87
40410.6 Tickets ..................................................................................................................................... 87
40510.6.1
406Introduction.................................................................................................................... 87
40710.6.2
408A NULL Ticket ............................................................................................................... 88
40910.6.3
410TPMT_TK_CREATION ................................................................................................. 89
41110.6.4
412TPMT_TK_VERIFIED ................................................................................................... 90
41310.6.5
414TPMT_TK_AUTH .......................................................................................................... 91
41510.6.6
416TPMT_TK_HASHCHECK ............................................................................................. 92
41710.7 Property Structures .................................................................................................................. 92
41810.7.1
419TPMS_ALG_PROPERTY ............................................................................................. 92
42010.7.2
421TPMS_TAGGED_PROPERTY ..................................................................................... 92
42210.7.3
423TPMS_TAGGED_PCR_SELECT ................................................................................. 93
42410.8 Lists ......................................................................................................................................... 93
425
426Family “2.0”
427Level 00 Revision 00.99
428
429Published
430Copyright © TCG 2006-2013
431
432Page v
433October 31, 2013
434
435Part 2: Structures
436
437Trusted Platform Module Library
438
43910.8.1
440TPML_CC...................................................................................................................... 93
44110.8.2
442TPML_CCA ................................................................................................................... 94
44310.8.3
444TPML_ALG.................................................................................................................... 94
44510.8.4
446TPML_HANDLE ............................................................................................................ 94
44710.8.5
448TPML_DIGEST ............................................................................................................. 95
44910.8.6
450TPML_DIGEST_VALUES ............................................................................................. 95
45110.8.7
452TPM2B_DIGEST_VALUES........................................................................................... 95
45310.8.8
454TPML_PCR_SELECTION............................................................................................. 96
45510.8.9
456TPML_ALG_PROPERTY.............................................................................................. 96
45710.8.10 TPML_TAGGED_TPM_PROPERTY ............................................................................ 96
45810.8.11 TPML_TAGGED_PCR_PROPERTY ............................................................................ 97
45910.8.12 TPML_ECC_CURVE .................................................................................................... 97
46010.9 Capabilities Structures ............................................................................................................. 97
46110.9.1
462TPMU_CAPABILITIES .................................................................................................. 97
46310.9.2
464TPMS_CAPABILITY_DATA .......................................................................................... 98
46510.10 Clock/Counter Structures ........................................................................................................ 98
46610.10.1 TPMS_CLOCK_INFO ................................................................................................... 98
46710.10.2 Clock ............................................................................................................................. 98
46810.10.3 ResetCount ................................................................................................................... 98
46910.10.4 RestartCount ................................................................................................................. 99
47010.10.5 Safe ............................................................................................................................... 99
47110.10.6 TPMS_TIME_INFO ....................................................................................................... 99
47210.11 TPM Attestation Structures .................................................................................................... 100
47310.11.1 Introduction.................................................................................................................. 100
47410.11.2 TPMS_TIME_ATTEST_INFO ..................................................................................... 100
47510.11.3 TPMS_CERTIFY_INFO .............................................................................................. 100
47610.11.1 TPMS_QUOTE_INFO ................................................................................................. 100
47710.11.2 TPMS_COMMAND_AUDIT_INFO .............................................................................. 101
47810.11.3 TPMS_SESSION_AUDIT_INFO ................................................................................. 101
47910.11.4 TPMS_CREATION_INFO ........................................................................................... 101
48010.11.5 TPMS_NV_CERTIFY_INFO ....................................................................................... 101
48110.11.6 TPMI_ST_ATTEST ..................................................................................................... 102
48210.11.7 TPMU_ATTEST .......................................................................................................... 102
48310.11.8 TPMS_ATTEST .......................................................................................................... 103
48410.11.9 TPM2B_ATTEST ........................................................................................................ 103
48510.12 Authorization Structures ........................................................................................................ 104
48610.12.1 TPMS_AUTH_COMMAND ......................................................................................... 104
48710.12.2 TPMS_AUTH_RESPONSE ........................................................................................ 104
48811
489
490Algorithm Parameters and Structures ............................................................................................... 105
49111.1 Symmetric .............................................................................................................................. 105
49211.1.1
493Introduction.................................................................................................................. 105
49411.1.2
495TPMI_AES_KEY_BITS ............................................................................................... 105
49611.1.3
497TPMI_SM4_KEY_BITS ............................................................................................... 105
49811.1.4
499TPMU_SYM_KEY_BITS ............................................................................................. 106
50011.1.5
501TPMU_SYM_MODE ................................................................................................... 106
50211.1.6
503TPMU_SYM_DETAILS ............................................................................................... 107
50411.1.7
505TPMT_SYM_DEF ....................................................................................................... 107
50611.1.8
507TPMT_SYM_DEF_OBJECT ....................................................................................... 107
50811.1.9
509TPM2B_SYM_KEY ..................................................................................................... 108
51011.1.10 TPMS_SYMCIPHER_PARMS .................................................................................... 108
51111.1.11 TPM2B_SENSITIVE_DATA ........................................................................................ 108
51211.1.12 TPMS_SENSITIVE_CREATE ..................................................................................... 109
51311.1.13 TPM2B_SENSITIVE_CREATE ................................................................................... 110
51411.1.14 TPMS_SCHEME_SIGHASH....................................................................................... 110
51511.1.15 TPMI_ALG_HASH_SCHEME ..................................................................................... 110
516
517Page vi
518October 31, 2013
519
520Published
521Copyright © TCG 2006-2013
522
523Family “2.0”
524Level 00 Revision 00.99
525
526Trusted Platform Module Library
527
528Part 2: Structures
529
53011.1.16 HMAC_SIG_SCHEME ................................................................................................ 110
53111.1.17 TPMS_SCHEME_XOR ............................................................................................... 111
53211.1.18 TPMU_SCHEME_HMAC ............................................................................................ 111
53311.1.19 TPMT_KEYEDHASH_SCHEME ................................................................................. 111
53411.2 Asymmetric ............................................................................................................................ 112
53511.2.1
536Signing Schemes ........................................................................................................ 112
53711.2.1.1
538Introduction .......................................................................................................... 112
53911.2.1.2
540RSA_SIG_SCHEMES ......................................................................................... 112
54111.2.1.3
542ECC_SIG_SCHEMES ......................................................................................... 112
54311.2.1.4
544TPMS_SCHEME_ECDAA................................................................................... 112
54511.2.1.5
546TPMU_SIG_SCHEME......................................................................................... 113
54711.2.1.6
548TPMT_SIG_SCHEME ......................................................................................... 113
54911.2.2
550Encryption Schemes ................................................................................................... 114
55111.2.2.1
552Introduction .......................................................................................................... 114
55311.2.2.2
554TPMS_SCHEME_OAEP ..................................................................................... 114
55511.2.2.3
556TPMS_SCHEME_ECDH ..................................................................................... 114
55711.2.3
558Key Derivation Schemes ............................................................................................. 114
55911.2.3.1
560Introduction .......................................................................................................... 114
56111.2.3.2
562TPMS_SCHEME_MGF1 ..................................................................................... 114
56311.2.3.3
564TPMS_SCHEME_KDF1_SP800_56a ................................................................. 114
56511.2.3.4
566TPMS_SCHEME_KDF2 ...................................................................................... 115
56711.2.3.5
568TPMS_SCHEME_KDF1_SP800_108 ................................................................. 115
56911.2.3.6
570TPMU_KDF_SCHEME........................................................................................ 115
57111.2.3.7
572TPMT_KDF_SCHEME ........................................................................................ 115
57311.2.3.8
574TPMI_ALG_ASYM_SCHEME ............................................................................. 116
57511.2.3.9
576TPMU_ASYM_SCHEME..................................................................................... 116
57711.2.3.10 TPMT_ASYM_SCHEME ..................................................................................... 117
57811.2.4
579RSA ............................................................................................................................. 117
58011.2.4.1
581TPMI_ALG_RSA_SCHEME ................................................................................ 117
58211.2.4.2
583TPMT_RSA_SCHEME ........................................................................................ 117
58411.2.4.3
585TPMI_ALG_RSA_DECRYPT .............................................................................. 118
58611.2.4.4
587TPMT_RSA_DECRYPT ...................................................................................... 118
58811.2.4.5
589TPM2B_PUBLIC_KEY_RSA ............................................................................... 118
59011.2.4.6
591TPMI_RSA_KEY_BITS ....................................................................................... 118
59211.2.4.7
593TPM2B_PRIVATE_KEY_RSA ............................................................................ 119
59411.2.5
595ECC ............................................................................................................................. 120
59611.2.5.1
597TPM2B_ECC_PARAMETER .............................................................................. 120
59811.2.5.2
599TPMS_ECC_POINT ............................................................................................ 120
60011.2.5.3
601TPM2B_ECC_POINT .......................................................................................... 120
60211.2.5.4
603TPMI_ALG_ECC_SCHEME ............................................................................... 121
60411.2.5.5
605TPMI_ECC_CURVE ............................................................................................ 121
60611.2.5.6
607TPMT_ECC_SCHEME........................................................................................ 121
60811.2.5.7
609TPMS_ALGORITHM_DETAIL_ECC ................................................................... 122
61011.3 Signatures.............................................................................................................................. 122
61111.3.1
612TPMS_SIGNATURE_RSASSA .................................................................................. 122
61311.3.2
614TPMS_SIGNATURE_RSAPSS .................................................................................. 122
61511.3.3
616TPMS_SIGNATURE_ECDSA ..................................................................................... 123
61711.3.4
618TPMU_SIGNATURE ................................................................................................... 123
61911.3.5
620TPMT_SIGNATURE ................................................................................................... 124
62111.4 Key/Secret Exchange ............................................................................................................ 124
62211.4.1
623Introduction.................................................................................................................. 124
62411.4.2
625TPMU_ENCRYPTED_SECRET ................................................................................. 124
62611.4.3
627TPM2B_ENCRYPTED_SECRET ............................................................................... 125
62812
629
630Key/Object Complex.......................................................................................................................... 126
631
632Family “2.0”
633Level 00 Revision 00.99
634
635Published
636Copyright © TCG 2006-2013
637
638Page vii
639October 31, 2013
640
641Part 2: Structures
642
643Trusted Platform Module Library
644
64512.1 Introduction ............................................................................................................................ 126
64612.2 Public Area Structures ........................................................................................................... 126
64712.2.1
648Description .................................................................................................................. 126
64912.2.2
650TPMI_ALG_PUBLIC ................................................................................................... 126
65112.2.3
652Type-Specific Parameters ........................................................................................... 126
65312.2.3.1
654Description .......................................................................................................... 126
65512.2.3.2
656TPMU_PUBLIC_ID .............................................................................................. 127
65712.2.3.3
658TPMS_KEYEDHASH_PARMS ........................................................................... 127
65912.2.3.4
660TPMS_ASYM_PARMS ....................................................................................... 127
66112.2.3.5
662TPMS_RSA_PARMS .......................................................................................... 128
66312.2.3.6
664TPMS_ECC_PARMS .......................................................................................... 129
66512.2.3.7
666TPMU_PUBLIC_PARMS .................................................................................... 129
66712.2.3.8
668TPMT_PUBLIC_PARMS ..................................................................................... 130
66912.2.4
670TPMT_PUBLIC ........................................................................................................... 130
67112.2.5
672TPM2B_PUBLIC ......................................................................................................... 131
67312.3 Private Area Structures ......................................................................................................... 131
67412.3.1
675Introduction.................................................................................................................. 131
67612.3.2
677Sensitive Data Structures ............................................................................................ 131
67812.3.2.1
679Introduction .......................................................................................................... 131
68012.3.2.2
681TPM2B_PRIVATE_VENDOR_SPECIFIC ........................................................... 131
68212.3.2.3
683TPMU_SENSITIVE_COMPOSITE ...................................................................... 132
68412.3.2.4
685TPMT_SENSITIVE .............................................................................................. 132
68612.3.3
687TPM2B_SENSITIVE ................................................................................................... 132
68812.3.4
689Encryption ................................................................................................................... 133
69012.3.5
691Integrity........................................................................................................................ 133
69212.3.6
693_PRIVATE ................................................................................................................... 133
69412.3.7
695TPM2B_PRIVATE ....................................................................................................... 133
69612.4 Identity Object ........................................................................................................................ 134
69712.4.1
698Description .................................................................................................................. 134
69912.4.2
700_ID_OBJECT .............................................................................................................. 134
70112.4.3
702TPM2B_ID_OBJECT .................................................................................................. 134
70313
704
705NV Storage Structures ...................................................................................................................... 135
70613.1 TPM_NV_INDEX ................................................................................................................... 135
70713.2 TPMA_NV (NV Index Attributes) ........................................................................................... 136
70813.3 TPMS_NV_PUBLIC ............................................................................................................... 139
70913.4 TPM2B_NV_PUBLIC ............................................................................................................. 139
710
71114
712
713Context Data ..................................................................................................................................... 140
71414.1 Introduction ............................................................................................................................ 140
71514.2 TPM2B_CONTEXT_SENSITIVE........................................................................................... 140
71614.3 TPMS_CONTEXT_DATA ...................................................................................................... 140
71714.4 TPM2B_CONTEXT_DATA .................................................................................................... 140
71814.5 TPMS_CONTEXT ................................................................................................................. 141
71914.6 Parameters of TPMS_CONTEXT .......................................................................................... 142
72014.6.1
721sequence ..................................................................................................................... 142
72214.6.2
723savedHandle ............................................................................................................... 142
72414.6.3
725hierarchy...................................................................................................................... 143
72614.7 Context Protection ................................................................................................................. 143
72714.7.1
728Context Integrity .......................................................................................................... 143
72914.7.2
730Context Confidentiality ................................................................................................ 143
731
73215
733
734Creation Data .................................................................................................................................... 144
73515.1 TPMS_CREATION_DATA .................................................................................................... 144
73615.2 TPM2B_CREATION_DATA .................................................................................................. 144
737
738Page viii
739October 31, 2013
740
741Published
742Copyright © TCG 2006-2013
743
744Family “2.0”
745Level 00 Revision 00.99
746
747Trusted Platform Module Library
748
749Part 2: Structures
750
751Annex A (informative) Algorithm Constants ............................................................................................. 145
752A.1
753Introduction ............................................................................................................................ 145
754A.2
755Allowed Hash Algorithms....................................................................................................... 145
756A.2.1
757SHA1 ........................................................................................................................... 145
758A.2.2
759SHA256 ....................................................................................................................... 145
760A.2.3
761SHA384 ....................................................................................................................... 145
762A.2.4
763SHA512 ....................................................................................................................... 146
764A.2.5
765SM3_256 ..................................................................................................................... 146
766A.3
767Architectural Limits ................................................................................................................ 146
768Annex B (informative) Implementation Definitions ................................................................................... 147
769B.1
770Introduction ............................................................................................................................ 147
771B.2
772Logic Values .......................................................................................................................... 147
773B.3
774Processor Values .................................................................................................................. 147
775B.4
776Implemented Algorithms ........................................................................................................ 148
777B.5
778Implemented Commands ...................................................................................................... 148
779B.6
780Algorithm Constants .............................................................................................................. 151
781B.6.1
782RSA ............................................................................................................................. 152
783B.6.2
784ECC ............................................................................................................................. 152
785B.6.3
786AES ............................................................................................................................. 152
787B.6.4
788SM4 ............................................................................................................................. 152
789B.6.5
790Symmetric ................................................................................................................... 153
791B.7
792Implementation Specific Values ............................................................................................ 154
793
794Family “2.0”
795Level 00 Revision 00.99
796
797Published
798Copyright © TCG 2006-2013
799
800Page ix
801October 31, 2013
802
803Part 2: Structures
804
805Trusted Platform Module Library
806
807Tables
808Table 1 — Name Prefix Convention ........................................................................................................... 15
809Table 2 — Unmarshaling Errors ................................................................................................................. 16
810Table 3 — Definition of Base Types ........................................................................................................... 17
811Table 4 — Definition of Types for Documentation Clarity ........................................................................... 17
812Table 5 — Definition of (UINT32) TPM_SPEC Constants <> ..................................................................... 18
813Table 6 — Definition of (UINT32) TPM_GENERATED Constants <O> ..................................................... 18
814Table 7 — Definition of (UINT16) TPM_ALG_ID Constants <IN/OUT, S> ................................................. 19
815Table 8 — Definition of (UINT16) {ECC} TPM_ECC_CURVE Constants <IN/OUT, S> ............................ 22
816Table 9 — TPM Command Format Fields Description ............................................................................... 22
817Table 10 — Legend for Command Code Tables ........................................................................................ 23
818Table 11 — Definition of (UINT32) TPM_CC Constants (Numeric Order) <IN/OUT, S> ........................... 24
819Table 12 — Format-Zero Response Codes ................................................................................................ 30
820Table 13 — Format-One Response Codes ................................................................................................ 31
821Table 14 — Response Code Groupings ..................................................................................................... 31
822Table 15 — Definition of (UINT32) TPM_RC Constants (Actions) <OUT> ................................................ 32
823Table 16 — Definition of (INT8) TPM_CLOCK_ADJUST Constants <IN> ................................................. 37
824Table 17 — Definition of (UINT16) TPM_EO Constants <IN/OUT> ........................................................... 37
825Table 18 — Definition of (UINT16) TPM_ST Constants <IN/OUT, S> ....................................................... 38
826Table 19 — Definition of (UINT16) TPM_SU Constants <IN> .................................................................... 40
827Table 20 — Definition of (UINT8) TPM_SE Constants <IN> ...................................................................... 40
828Table 21 — Definition of (UINT32) TPM_CAP Constants .......................................................................... 41
829Table 22 — Definition of (UINT32) TPM_PT Constants <IN/OUT, S> ....................................................... 41
830Table 23 — Definition of (UINT32) TPM_PT_PCR Constants <IN/OUT, S> ............................................. 47
831Table 24 — Definition of (UINT32) TPM_PS Constants <OUT> ................................................................ 49
832Table 25 — Definition of Types for Handles ............................................................................................... 50
833Table 26 — Definition of (UINT8) TPM_HT Constants <S> ....................................................................... 50
834Table 27 — Definition of (UINT32) TPM_RH Constants <IN, S> ............................................................... 52
835Table 28 — Definition of (TPM_HANDLE) TPM_HC Constants <IN, S> ................................................... 54
836Table 29 — Definition of (UINT32) TPMA_ALGORITHM Bits .................................................................... 55
837Table 30 — Definition of (UINT32) TPMA_OBJECT Bits ........................................................................... 56
838Table 31 — Definition of (UINT8) TPMA_SESSION Bits <IN/OUT> .......................................................... 62
839Table 32 — Definition of (UINT8) TPMA_LOCALITY Bits <IN/OUT> ........................................................ 64
840Table 33 — Definition of (UINT32) TPMA_PERMANENT Bits <OUT> ...................................................... 64
841Table 34 — Definition of (UINT32) TPMA_STARTUP_CLEAR Bits <OUT> .............................................. 65
842Table 35 — Definition of (UINT32) TPMA_MEMORY Bits <Out> .............................................................. 66
843Table 36 — Definition of (TPM_CC) TPMA_CC Bits <OUT> ..................................................................... 67
844Table 37 — Definition of (BYTE) TPMI_YES_NO Type ............................................................................. 70
845
846Page x
847October 31, 2013
848
849Published
850Copyright © TCG 2006-2013
851
852Family “2.0”
853Level 00 Revision 00.99
854
855Trusted Platform Module Library
856
857Part 2: Structures
858
859Table 38 — Definition of (TPM_HANDLE) TPMI_DH_OBJECT Type........................................................ 70
860Table 39 — Definition of (TPM_HANDLE) TPMI_DH_PERSISTENT Type ............................................... 71
861Table 40 — Definition of (TPM_HANDLE) TPMI_DH_ENTITY Type <IN> ................................................ 71
862Table 41 — Definition of (TPM_HANDLE) TPMI_DH_PCR Type <IN> ..................................................... 72
863Table 42 — Definition of (TPM_HANDLE) TPMI_SH_AUTH_SESSION Type <IN/OUT> ........................ 72
864Table 43 — Definition of (TPM_HANDLE) TPMI_SH_HMAC Type <IN/OUT> .......................................... 72
865Table 44 — Definition of (TPM_HANDLE) TPMI_SH_POLICY Type <IN/OUT> ....................................... 72
866Table 45 — Definition of (TPM_HANDLE) TPMI_DH_CONTEXT Type .................................................... 73
867Table 46 — Definition of (TPM_HANDLE) TPMI_RH_HIERARCHY Type ................................................ 73
868Table 47 — Definition of (TPM_HANDLE) TPMI_RH_ENABLES Type ..................................................... 73
869Table 48 — Definition of (TPM_HANDLE) TPMI_RH_HIERARCHY_AUTH Type <IN> ............................ 74
870Table 49 — Definition of (TPM_HANDLE) TPMI_RH_PLATFORM Type <IN> ......................................... 74
871Table 50 — Definition of (TPM_HANDLE) TPMI_RH_OWNER Type <IN> ............................................... 74
872Table 51 — Definition of (TPM_HANDLE) TPMI_RH_ENDORSEMENT Type <IN> ................................. 75
873Table 52 — Definition of (TPM_HANDLE) TPMI_RH_PROVISION Type <IN> ......................................... 75
874Table 53 — Definition of (TPM_HANDLE) TPMI_RH_CLEAR Type <IN> ................................................. 75
875Table 54 — Definition of (TPM_HANDLE) TPMI_RH_NV_AUTH Type <IN> ............................................ 76
876Table 55 — Definition of (TPM_HANDLE) TPMI_RH_LOCKOUT Type <IN> ........................................... 76
877Table 56 — Definition of (TPM_HANDLE) TPMI_RH_NV_INDEX Type <IN/OUT> .................................. 76
878Table 57 — Definition of (TPM_ALG_ID) TPMI_ALG_HASH Type............................................................ 77
879Table 58 — Definition of (TPM_ALG_ID) TPMI_ALG_ASYM Type ........................................................... 77
880Table 59 — Definition of (TPM_ALG_ID) TPMI_ALG_SYM Type .............................................................. 78
881Table 60 — Definition of (TPM_ALG_ID) TPMI_ALG_SYM_OBJECT Type ............................................. 78
882Table 61 — Definition of (TPM_ALG_ID) TPMI_ALG_SYM_MODE Type ................................................. 79
883Table 62 — Definition of (TPM_ALG_ID) TPMI_ALG_KDF Type .............................................................. 79
884Table 63 — Definition of (TPM_ALG_ID) TPMI_ALG_SIG_SCHEME Type .............................................. 80
885Table 64 — Definition of (TPM_ALG_ID) TPMI_ECC_KEY_EXCHANGE Type ........................................ 80
886Table 65 — Definition of (TPM_ST) TPMI_ST_COMMAND_TAG Type .................................................... 80
887Table 66 — Definition of TPMS_ALGORITHM_DESCRIPTION Structure <OUT> .................................... 81
888Table 67 — Definition of TPMU_HA Union <IN/OUT, S> ........................................................................... 81
889Table 68 — Definition of TPMT_HA Structure <IN/OUT> .......................................................................... 82
890Table 69 — Definition of TPM2B_DIGEST Structure ................................................................................. 83
891Table 70 — Definition of TPM2B_DATA Structure ..................................................................................... 83
892Table 71 — Definition of Types for TPM2B_NONCE ................................................................................. 83
893Table 72 — Definition of Types for TPM2B_AUTH .................................................................................... 83
894Table 73 — Definition of Types for TPM2B_OPERAND ............................................................................ 84
895Table 74 — Definition of TPM2B_EVENT Structure ................................................................................... 84
896Table 75 — Definition of TPM2B_MAX_BUFFER Structure ...................................................................... 84
897
898Family “2.0”
899Level 00 Revision 00.99
900
901Published
902Copyright © TCG 2006-2013
903
904Page xi
905October 31, 2013
906
907Part 2: Structures
908
909Trusted Platform Module Library
910
911Table 76 — Definition of TPM2B_MAX_NV_BUFFER Structure ............................................................... 84
912Table 77 — Definition of TPM2B_TIMEOUT Structure <IN/OUT> ............................................................. 85
913Table 78 — Definition of TPM2B_IV Structure <IN/OUT> .......................................................................... 85
914Table 79 — Definition of TPMU_NAME Union <> ...................................................................................... 85
915Table 80 — Definition of TPM2B_NAME Structure .................................................................................... 86
916Table 81 — Definition of TPMS_PCR_SELECT Structure ......................................................................... 87
917Table 82 — Definition of TPMS_PCR_SELECTION Structure ................................................................... 87
918Table 83 — Values for proof Used in Tickets ............................................................................................. 88
919Table 84 — General Format of a Ticket ...................................................................................................... 88
920Table 85 — Definition of TPMT_TK_CREATION Structure ........................................................................ 89
921Table 86 — Definition of TPMT_TK_VERIFIED Structure .......................................................................... 90
922Table 87 — Definition of TPMT_TK_AUTH Structure ................................................................................ 91
923Table 88 — Definition of TPMT_TK_HASHCHECK Structure .................................................................... 92
924Table 89 — Definition of TPMS_ALG_PROPERTY Structure <OUT> ....................................................... 92
925Table 90 — Definition of TPMS_TAGGED_PROPERTY Structure <OUT> ............................................... 92
926Table 91 — Definition of TPMS_TAGGED_PCR_SELECT Structure <OUT> ........................................... 93
927Table 92 — Definition of TPML_CC Structure ............................................................................................ 93
928Table 93 — Definition of TPML_CCA Structure <OUT> ............................................................................. 94
929Table 94 — Definition of TPML_ALG Structure .......................................................................................... 94
930Table 95 — Definition of TPML_HANDLE Structure <OUT>...................................................................... 94
931Table 96 — Definition of TPML_DIGEST Structure .................................................................................... 95
932Table 97 — Definition of TPML_DIGEST_VALUES Structure ................................................................... 95
933Table 98 — Definition of TPM2B_DIGEST_VALUES Structure ................................................................. 95
934Table 99 — Definition of TPML_PCR_SELECTION Structure ................................................................... 96
935Table 100 — Definition of TPML_ALG_PROPERTY Structure <OUT> ..................................................... 96
936Table 101 — Definition of TPML_TAGGED_TPM_PROPERTY Structure <OUT> ................................... 96
937Table 102 — Definition of TPML_TAGGED_PCR_PROPERTY Structure <OUT> ................................... 97
938Table 103 — Definition of {ECC} TPML_ECC_CURVE Structure <OUT> ................................................. 97
939Table 104 — Definition of TPMU_CAPABILITIES Union <OUT>............................................................... 97
940Table 105 — Definition of TPMS_CAPABILITY_DATA Structure <OUT> ................................................. 98
941Table 106 — Definition of TPMS_CLOCK_INFO Structure ........................................................................ 98
942Table 107 — Definition of TPMS_TIME_INFO Structure ........................................................................... 99
943Table 108 — Definition of TPMS_TIME_ATTEST_INFO Structure <OUT> ............................................. 100
944Table 109 — Definition of TPMS_CERTIFY_INFO Structure <OUT> ...................................................... 100
945Table 110 — Definition of TPMS_QUOTE_INFO Structure <OUT> ........................................................ 100
946Table 111 — Definition of TPMS_COMMAND_AUDIT_INFO Structure <OUT> ..................................... 101
947Table 112 — Definition of TPMS_SESSION_AUDIT_INFO Structure <OUT> ........................................ 101
948Table 113 — Definition of TPMS_CREATION_INFO Structure <OUT> .................................................. 101
949Table 114 — Definition of TPMS_NV_CERTIFY_INFO Structure <OUT> ............................................... 101
950Page xii
951October 31, 2013
952
953Published
954Copyright © TCG 2006-2013
955
956Family “2.0”
957Level 00 Revision 00.99
958
959Trusted Platform Module Library
960
961Part 2: Structures
962
963Table 115 — Definition of (TPM_ST) TPMI_ST_ATTEST Type <OUT> .................................................. 102
964Table 116 — Definition of TPMU_ATTEST Union <OUT> ....................................................................... 102
965Table 117 — Definition of TPMS_ATTEST Structure <OUT> .................................................................. 103
966Table 118 — Definition of TPM2B_ATTEST Structure <OUT> ................................................................ 103
967Table 119 — Definition of TPMS_AUTH_COMMAND Structure <IN> ..................................................... 104
968Table 120 — Definition of TPMS_AUTH_RESPONSE Structure <OUT> ................................................ 104
969Table 121 — Definition of {AES} (TPM_KEY_BITS) TPMI_AES_KEY_BITS Type ................................. 105
970Table 122 — Definition of {SM4} (TPM_KEY_BITS) TPMI_SM4_KEY_BITS Type ................................. 105
971Table 123 — Definition of TPMU_SYM_KEY_BITS Union ....................................................................... 106
972Table 124 — Definition of TPMU_SYM_MODE Union ............................................................................. 106
973Table 125 — xDefinition of TPMU_SYM_DETAILS Union ....................................................................... 107
974Table 126 — Definition of TPMT_SYM_DEF Structure ............................................................................ 107
975Table 127 — Definition of TPMT_SYM_DEF_OBJECT Structure ............................................................ 107
976Table 128 — Definition of TPM2B_SYM_KEY Structure .......................................................................... 108
977Table 129 — Definition of TPMS_SYMCIPHER_PARMS Structure ........................................................ 108
978Table 130 — Definition of TPM2B_SENSITIVE_DATA Structure ............................................................ 108
979Table 131 — Definition of TPMS_SENSITIVE_CREATE Structure <IN> ................................................ 109
980Table 132 — Definition of TPM2B_SENSITIVE_CREATE Structure <IN, S> .......................................... 110
981Table 133 — Definition of TPMS_SCHEME_SIGHASH Structure ........................................................... 110
982Table 134 — Definition of (TPM_ALG_ID) TPMI_ALG_KEYEDHASH_SCHEME Type .......................... 110
983Table 135 — Definition of Types for HMAC_SIG_SCHEME .................................................................... 110
984Table 136 — Definition of TPMS_SCHEME_XOR Structure ................................................................... 111
985Table 137 — Definition of TPMU_SCHEME_KEYEDHASH Union <IN/OUT, S> .................................... 111
986Table 138 — Definition of TPMT_KEYEDHASH_SCHEME Structure ..................................................... 111
987Table 139 — Definition of {RSA} Types for RSA_SIG_SCHEMES .......................................................... 112
988Table 140 — Definition of {ECC} Types for ECC_SIG_SCHEMES.......................................................... 112
989Table 141 — Definition of {ECC} TPMS_SCHEME_ECDAA Structure .................................................... 112
990Table 142 — Definition of TPMU_SIG_SCHEME Union <IN/OUT, S> .................................................... 113
991Table 143 — Definition of TPMT_SIG_SCHEME Structure ..................................................................... 113
992Table 144 — Definition of {RSA} TPMS_SCHEME_OAEP Structure ...................................................... 114
993Table 145 — Definition of {ECC} TPMS_SCHEME_ECDH Structure ...................................................... 114
994Table 146 — Definition of TPMS_SCHEME_MGF1 Structure ................................................................. 114
995Table 147 — Definition of {ECC} TPMS_SCHEME_KDF1_SP800_56a Structure .................................. 114
996Table 148 — Definition of TPMS_SCHEME_KDF2 Structure .................................................................. 115
997Table 149 — Definition of TPMS_SCHEME_KDF1_SP800_108 Structure ............................................. 115
998Table 150 — Definition of TPMU_KDF_SCHEME Union <IN/OUT, S> ................................................... 115
999Table 151 — Definition of TPMT_KDF_SCHEME Structure .................................................................... 115
1000Table 152 — Definition of (TPM_ALG_ID) TPMI_ALG_ASYM_SCHEME Type <> ................................. 116
1001
1002Family “2.0”
1003Level 00 Revision 00.99
1004
1005Published
1006Copyright © TCG 2006-2013
1007
1008Page xiii
1009October 31, 2013
1010
1011Part 2: Structures
1012
1013Trusted Platform Module Library
1014
1015Table 153 — Definition of TPMU_ASYM_SCHEME Union ...................................................................... 116
1016Table 154 — Definition of TPMT_ASYM_SCHEME Structure <> ............................................................ 117
1017Table 155 — Definition of (TPM_ALG_ID) {RSA} TPMI_ALG_RSA_SCHEME Type .............................. 117
1018Table 156 — Definition of {RSA} TPMT_RSA_SCHEME Structure ......................................................... 117
1019Table 157 — Definition of (TPM_ALG_ID) {RSA} TPMI_ALG_RSA_DECRYPT Type ............................ 118
1020Table 158 — Definition of {RSA} TPMT_RSA_DECRYPT Structure ....................................................... 118
1021Table 159 — Definition of {RSA} TPM2B_PUBLIC_KEY_RSA Structure ................................................ 118
1022Table 160 — Definition of {RSA} (TPM_KEY_BITS) TPMI_RSA_KEY_BITS Type ................................. 119
1023Table 161 — Definition of {RSA} TPM2B_PRIVATE_KEY_RSA Structure .............................................. 119
1024Table 162 — Definition of {ECC} TPM2B_ECC_PARAMETER Structure ............................................... 120
1025Table 163 — Definition of {ECC} TPMS_ECC_POINT Structure ............................................................. 120
1026Table 164 — Definition of {ECC} TPM2B_ECC_POINT Structure ........................................................... 120
1027Table 165 — Definition of (TPM_ALG_ID) {ECC} TPMI_ALG_ECC_SCHEME Type ............................. 121
1028Table 166 — Definition of {ECC} (TPM_ECC_CURVE) TPMI_ECC_CURVE Type ................................ 121
1029Table 167 — Definition of (TPMT_SIG_SCHEME) {ECC} TPMT_ECC_SCHEME Structure .................. 121
1030Table 168 — Definition of {ECC} TPMS_ALGORITHM_DETAIL_ECC Structure <OUT> ....................... 122
1031Table 169 — Definition of {RSA} TPMS_SIGNATURE_RSASSA Structure ............................................ 122
1032Table 170 — Definition of {RSA} TPMS_SIGNATURE_RSAPSS Structure ............................................ 123
1033Table 171 — Definition of {ECC} TPMS_SIGNATURE_ECDSA Structure .............................................. 123
1034Table 172 — Definition of TPMU_SIGNATURE Union <IN/OUT, S> ....................................................... 123
1035Table 173 — Definition of TPMT_SIGNATURE Structure ........................................................................ 124
1036Table 174 — Definition of TPMU_ENCRYPTED_SECRET Union <S> ................................................... 124
1037Table 175 — Definition of TPM2B_ENCRYPTED_SECRET Structure .................................................... 125
1038Table 176 — Definition of (TPM_ALG_ID) TPMI_ALG_PUBLIC Type .................................................... 126
1039Table 177 — Definition of TPMU_PUBLIC_ID Union <IN/OUT, S> ......................................................... 127
1040Table 178 — Definition of TPMS_KEYEDHASH_PARMS Structure........................................................ 127
1041Table 179 — Definition of TPMS_ASYM_PARMS Structure <> .............................................................. 128
1042Table 180 — Definition of {RSA} TPMS_RSA_PARMS Structure ............................................................ 128
1043Table 181 — Definition of {ECC} TPMS_ECC_PARMS Structure ........................................................... 129
1044Table 182 — Definition of TPMU_PUBLIC_PARMS Union <IN/OUT, S> ................................................ 129
1045Table 183 — Definition of TPMT_PUBLIC_PARMS Structure ................................................................. 130
1046Table 184 — Definition of TPMT_PUBLIC Structure ................................................................................ 130
1047Table 185 — Definition of TPM2B_PUBLIC Structure .............................................................................. 131
1048Table 186 — Definition of {RSA} TPM2B_PRIVATE_VENDOR_SPECIFIC Structure<> ........................ 131
1049Table 187 — Definition of TPMU_SENSITIVE_COMPOSITE Union <IN/OUT, S> ................................. 132
1050Table 188 — Definition of TPMT_SENSITIVE Structure .......................................................................... 132
1051Table 189 — Definition of TPM2B_SENSITIVE Structure <IN/OUT> ...................................................... 132
1052Table 190 — Definition of _PRIVATE Structure <> .................................................................................. 133
1053Table 191 — Definition of TPM2B_PRIVATE Structure <IN/OUT, S> ..................................................... 133
1054Page xiv
1055October 31, 2013
1056
1057Published
1058Copyright © TCG 2006-2013
1059
1060Family “2.0”
1061Level 00 Revision 00.99
1062
1063Trusted Platform Module Library
1064
1065Part 2: Structures
1066
1067Table 192 — Definition of _ID_OBJECT Structure <> .............................................................................. 134
1068Table 193 — Definition of TPM2B_ID_OBJECT Structure <IN/OUT> ..................................................... 134
1069Table 194 — Definition of (UINT32) TPM_NV_INDEX Bits <> ................................................................. 135
1070Table 195 — Options for space Field of TPM_NV_INDEX ....................................................................... 136
1071Table 196 — Definition of (UINT32) TPMA_NV Bits ................................................................................ 137
1072Table 197 — Definition of TPMS_NV_PUBLIC Structure ......................................................................... 139
1073Table 198 — Definition of TPM2B_NV_PUBLIC Structure ....................................................................... 139
1074Table 199 — Definition of TPM2B_CONTEXT_SENSITIVE Structure <IN/OUT> ................................... 140
1075Table 200 — Definition of TPMS_CONTEXT_DATA Structure <IN/OUT, S> .......................................... 140
1076Table 201 — Definition of TPM2B_CONTEXT_DATA Structure <IN/OUT> ............................................ 140
1077Table 202 — Definition of TPMS_CONTEXT Structure ........................................................................... 141
1078Table 203 — Context Handle Values ........................................................................................................ 142
1079Table 204 — Definition of TPMS_CREATION_DATA Structure <OUT> ................................................. 144
1080Table 205 — Definition of TPM2B_CREATION_DATA Structure <OUT> ............................................... 144
1081Table 206 — Defines for SHA1 Hash Values ........................................................................................... 145
1082Table 207 — Defines for SHA256 Hash Values ....................................................................................... 145
1083Table 208 — Defines for SHA384 Hash Values ....................................................................................... 145
1084Table 209 — Defines for SHA512 Hash Values ....................................................................................... 146
1085Table 210 — Defines for SM3_256 Hash Values ..................................................................................... 146
1086Table 211 — Defines for Architectural Limits Values ............................................................................... 146
1087Table 212 — Defines for Logic Values ..................................................................................................... 147
1088Table 213 — Defines for Processor Values .............................................................................................. 147
1089Table 214 — Defines for Implemented Algorithms ................................................................................... 148
1090Table 215 — Defines for Implemented Commands .................................................................................. 149
1091Table 216 — Defines for RSA Algorithm Constants ................................................................................. 152
1092Table 217 — Defines for ECC Algorithm Constants ................................................................................. 152
1093Table 218 — Defines for AES Algorithm Constants ................................................................................. 152
1094Table 219 — Defines for SM4 Algorithm Constants ................................................................................. 152
1095Table 220 — Defines for Symmetric Algorithm Constants ....................................................................... 153
1096Table 221 — Defines for Implementation Values ..................................................................................... 154
1097
1098Family “2.0”
1099Level 00 Revision 00.99
1100
1101Published
1102Copyright © TCG 2006-2013
1103
1104Page xv
1105October 31, 2013
1106
1107Part 2: Structures
1108
1109Trusted Platform Module Library
1110
1111Figures
1112Figure 1 — Command Format .................................................................................................................... 22
1113Figure 2 — Format-Zero Response Codes ................................................................................................. 29
1114Figure 3 — Format-One Response Codes ................................................................................................. 30
1115Figure 4 — TPM 1.2 TPM_NV_INDEX ..................................................................................................... 135
1116Figure 5 — TPM 2.0 TPM_NV_INDEX ..................................................................................................... 135
1117
1118Page xvi
1119October 31, 2013
1120
1121Published
1122Copyright © TCG 2006-2013
1123
1124Family “2.0”
1125Level 00 Revision 00.99
1126
1127Trusted Platform Module Library
1128
1129Part 2: Structures
1130
1131Trusted Platform Module Library
1132Part 2: Structures
11331
1134
1135Scope
1136
1137This part of the Trusted Platform Module Library specification contains the definitions of the constants,
1138flags, structure, and union definitions used to communicate with the TPM. Values defined in this
1139document are used by the TPM commands defined in part 3: Commands and by the functions in part 4:
1140Supporting Routines.
1141NOTE
1142
11432
1144
1145The structures in this document are the canonical form of the structures on the interface. All structures
1146are "packed" with no octets of padding between structure elements. The TPM-internal form of the
1147structures is dependent on the processor and compiler for the TPM implementation.
1148
1149Terms and definitions
1150
1151For the purposes of this document, the terms and definitions given in part 1 of this specification apply.
11523
1153
1154Symbols and abbreviated terms
1155
1156For the purposes of this document, the symbols and abbreviated terms given in part 1 apply.
11574
11584.1
1159
1160Notation
1161Introduction
1162
1163The information in this document is formatted so that it may be converted to standard computer-language
1164formats by an automated process. The purpose of this automated process is to minimize the transcription
1165errors that often occur during the conversion process.
1166For the purposes of this document, the conventions given in Part 1 apply.
1167In addition, the conventions and notations in this clause describe the representation of various data so
1168that it is both human readable and amenable to automated processing.
1169When a table row contains the keyword “reserved” (all lower case) in columns 1 or 2, the tools will not
1170produce any values for the row in the table.
1171NOTE 1
1172
1173In the examples in this clause 4, the unmarshaling routines are shown as returning bool. In the code of
1174the reference implementation, the return value is a TPM_RC. A bool is used in the examples, because
1175the meaning of a TPM_RC is not yet defined.
1176
1177NOTE 2
1178
1179The unmarshaling code examples are the actual code that would be produced by the automatic code
1180generator used in the construction of the reference code. The actual code contains additional parameter
1181checking that is omitted for clarity of the principle being illustrated. Actual examples of the code are found
1182in Part 4.
1183
1184Family “2.0”
1185Level 00 Revision 00.99
1186
1187Published
1188Copyright © TCG 2006-2013
1189
1190Page 1
1191October 31, 2013
1192
1193Part 2: Structures
11944.2
1195
1196Trusted Platform Module Library
1197
1198Named Constants
1199
1200A named constant is a numeric value to which a name has been assigned. In the C language, this is done
1201with a #define statement. In this specification, a named constant is defined in a table that has a title that
1202starts with “Definition” and ends with “Constants.”
1203The table title will indicate the name of the class of constants that are being defined in the table. The title
1204will include the data type of the constants in parentheses.
1205The table in Example 1 names a collection of 16-bit constants and Example 2 shows the C code that
1206might be produced from that table by an automated process.
1207NOTE
1208
1209A named constant (#define) has no data type in C and an enumeration would be a better choice for
1210many of the defined constants. However, the C language does not allow an enumerated type to have a
1211storage type other than int so the method of using a combination of typedef and #define is used.
1212
1213EXAMPLE 1
1214
1215Table xx — Definition of (UINT16) COUNTING Constants
1216Parameter
1217
1218Value
1219
1220Description
1221
1222first
1223
12241
1225
1226decimal value is implicitly the size of the
1227
1228second
1229
12300x0002
1231
1232hex value will match the number of bits in the constant
1233
1234third
1235
12363
1237
1238fourth
1239
12400x0004
1241
1242EXAMPLE 2
1243/* The C language equivalent of the constants from the table above */
1244typedef
1245UINT16
1246COUNTING;
1247#define
1248first
12491
1250#define
1251second
12520x0002
1253#define
1254third
12553
1256#define
1257fourth
12580x0004
1259
1260Page 2
1261October 31, 2013
1262
1263Published
1264Copyright © TCG 2006-2013
1265
1266Family “2.0”
1267Level 00 Revision 00.99
1268
1269Trusted Platform Module Library
12704.3
1271
1272Part 2: Structures
1273
1274Data Type Aliases (typedefs)
1275
1276When a group of named items is assigned a type, it is placed in a table that has a title starting with
1277“Definition of Types.” In this specification, defined types have names that use all upper-case characters.
1278The table in Example 1 shows how typedefs would be defined in this specification and Example 2 shows
1279the C-compatible code that might be produced from that table by an automated process.
1280EXAMPLE 1
1281
1282Table xx — Definition of Types for Some Purpose
1283Type
1284
1285Name
1286
1287Description
1288
1289unsigned short
1290
1291UINT16
1292
1293UINT16
1294
1295SOME_TYPE
1296
1297unsigned long
1298
1299UINT32
1300
1301UINT32
1302
1303LAST_TYPE
1304
1305EXAMPLE 2
1306/* C language equivalent of the typedefs from the table above */
1307typedef unsigned short
1308UINT16;
1309typedef UINT16
1310SOME_TYPE;
1311typedef unsigned long
1312UINT32;
1313typedef UINT32
1314LAST_TYPE;
1315
13164.4
1317
1318Enumerations
1319
1320A table that defines an enumerated data type will start with the word “Definition” and end with “Values.”
1321A value in parenthesis will denote the intrinsic data size of the value and may have the values "INT8",
1322"UINT8", "INT16", “UINT16”, "INT32", and “UINT32.” If this value is not present, “UINT16” is assumed.
1323Most C compilers set the type of an enumerated value to be an integer on the machine – often 16 bits –
1324but this is not always consistent. To ensure interoperability, the enumeration values may not exceed
132532,384.
1326The table in Example 1 shows how an enumeration would be defined in this specification. Example 2
1327shows the C code that might be produced from that table by an automated process.
1328EXAMPLE 1
1329
1330Table xx — Definition of (UINT16) CARD_SUIT Values
1331Suit Names
1332
1333Value
1334
1335CLUBS
1336
13370x0000
1338
1339DIAMONDS
1340
13410x000D
1342
1343HEARTS
1344
13450x001A
1346
1347SPADES
1348
1349Description
1350
13510x0027
1352
1353EXAMPLE 2
1354/* C language equivalent of the structure defined in the table above */
1355typedef enum {
1356CLUBS
1357=
13580x0000,
1359DIAMONDS
1360=
13610x000D,
1362HEARTS
1363=
13640x001A,
1365SPADES
1366=
13670x0027
1368} CARD_SUIT;
1369
1370Family “2.0”
1371Level 00 Revision 00.99
1372
1373Published
1374Copyright © TCG 2006-2013
1375
1376Page 3
1377October 31, 2013
1378
1379Part 2: Structures
13804.5
1381
1382Trusted Platform Module Library
1383
1384Interface Type
1385
1386An interface type is used for an enumeration that is checked by the unmarshaling code. This type is
1387defined for purposes of automatic generation of the code that will validate the type. The title will start with
1388the keyword “Definition” and end with the keyword “Type.” A value in parenthesis indicates the base type
1389of the interface. The table may contain an entry that is prefixed with the “#” character to indicate the
1390response code if the validation code determines that the input parameter is the wrong type.
1391EXAMPLE 1
1392
1393Table xx — Definition of (CARD_SUIT) RED_SUIT Type
1394Values
1395
1396Comments
1397
1398HEARTS
1399DIAMONDS
1400#TPM_RC_SUIT
1401
1402response code returned when the unmarshaling of this type fails
1403NOTE
1404
1405TPM_RC_SUIT is an example and no such response
1406code is actually defined in this specification.
1407
1408EXAMPLE 2
1409/* Validation code that might be automatically generated from table above */
1410if((*target != HEARTS) && (*target != DIAMONDS))
1411return TPM_RC_SUIT;
1412
1413In some cases, the allowed values are numeric values with no associated mnemonic. In such a case, the
1414list of numeric values may be given a name. Then, when used in an interface definition, the name would
1415have a "$" prefix to indicate that a named list of values should be substituted.
1416To illustrate, assume that the implementation only supports two sizes (1024 and 2048 bits) for keys
1417associated with some algorithm (MY algorithm). In the implementation section (Annex B a named list
1418would be created.
1419EXAMPLE 3
1420
1421Table xx — Defines for MY Algorithm Constants
1422Name
1423
1424Value
1425
1426Comments
1427
1428MY_KEY_SIZES_BITS
1429
1430{1024, 2048}
1431
1432braces because this is a list value
1433
1434Page 4
1435October 31, 2013
1436
1437Published
1438Copyright © TCG 2006-2013
1439
1440Family “2.0”
1441Level 00 Revision 00.99
1442
1443Trusted Platform Module Library
1444
1445Part 2: Structures
1446
1447Then, whenever an input value would need to be a valid MY key size for the implementation, the value
1448$MY_KEY_SIZES_BITS could be used. Given the definition for MY_KEY_SIZES_BITS in example 3
1449above, the tables in example 4 and 5 below, are equivalent.
1450EXAMPLE 4
1451
1452Table xx — Definition of (UINT16) MY_KEY_BITS Type
1453Parameter
1454
1455Description
1456
1457{1024, 2048}
1458
1459the number of bits in the supported key
1460
1461EXAMPLE 5
1462
1463Table xx — Definition of (UINT16) MY_KEY_BITS Type
1464Parameter
1465$MY_KEY_SIZES_BITS
1466
14674.6
1468
1469Description
1470the number of bits in the supported key
1471
1472Arrays
1473
1474Arrays are denoted by a value in square brackets (“[ ]”) following a parameter name. The value in the
1475brackets may be either an integer value such as “[20]” or the name of a component of the same structure
1476that contains the array.
1477The table in Example 1 shows how a structure containing fixed and variable-length arrays would be
1478defined in this specification. Example 2 shows the C code that might be produced from that table by an
1479automated process.
1480EXAMPLE 1
1481
1482Table xx — Definition of A_STRUCT Structure
1483Parameter
1484
1485Type
1486
1487Description
1488
1489array1[20]
1490
1491UINT16
1492
1493an array of 20 UINT16s
1494
1495a_size
1496
1497UINT16
1498
1499array2[a_size]
1500
1501UINT32
1502
1503an array of UINT32 values that has a
1504number of elements determined by a_size
1505above
1506
1507EXAMPLE 2
1508/* C language equivalent of the typedefs from the table above */
1509typedef struct {
1510UINT16
1511array1[20];
1512UINT16
1513a_size;
1514UINT32
1515array2[];
1516} A_STRUCT;
1517
1518Family “2.0”
1519Level 00 Revision 00.99
1520
1521Published
1522Copyright © TCG 2006-2013
1523
1524Page 5
1525October 31, 2013
1526
1527Part 2: Structures
1528
15294.7
1530
1531Trusted Platform Module Library
1532
1533Structure Definitions
1534
1535The tables used to define structures have a title that starts with the word “Definition” and ends with
1536“Structure.” The first column of the table will denote the reference names for the structure members; the
1537second column the data type of the member; and the third column a synopsis of the use of the element.
1538The table in Example 1 shows an example of how a structure would be defined in this specification and
1539Example 2 shows the C code that might be produced from the table by an automated process. Example 3
1540illustrates the type of unmarshaling code that could be generated using the information available in the
1541table.
1542EXAMPLE 1
1543
1544Table xx — Definition of SIMPLE_STRUCTURE Structure
1545Parameter
1546
1547Type
1548
1549Description
1550
1551tag
1552
1553TPM_ST
1554
1555value1
1556
1557INT32
1558
1559value2
1560
1561INT32
1562
1563EXAMPLE 2
1564/* C language equivalent of the structure defined in the table above */
1565typedef struct {
1566TPM_ST
1567tag;
1568INT32
1569value1
1570INT32
1571value2;
1572} SIMPLE_STRUCTURE;
1573EXAMPLE 3
1574bool SIMPLE_STRUCTURE_Unmarshal(SIMPLE_STRUCTURE *target, BYTE **buffer, INT32 *size)
1575{
1576// If unmarshal of tag succeeds
1577if(TPM_ST_Unmarshal((TPM_ST *)&(target->tag), buffer, size))
1578// then umarshal value1, and if that succeeds...
1579if(INT32_Unmarshal((INT32 *)&(target->value1, buffer, size))
1580// then return the results of unmarshaling values
1581return(INT32_Unmarshal((INT32 *)&(target->value2, buffer, size))
1582// if unmarshal of tag or value failed, return failure
1583return FALSE;
1584}
1585
1586Page 6
1587October 31, 2013
1588
1589Published
1590Copyright © TCG 2006-2013
1591
1592Family “2.0”
1593Level 00 Revision 00.99
1594
1595Trusted Platform Module Library
15964.8
1597
1598Part 2: Structures
1599
1600Conditional Types
1601
1602An enumeration may contain an extended value indicated by “+” preceding the name in the "Value"
1603column. This “+” indicates that this is a conditional value that may be allowed in certain situations.
1604NOTE
1605
1606In many cases, the input values are algorithm IDs. When two collections of algorithm IDs differ only
1607because one collection allows TPM_ALG_NULL and the other does not, it is preferred that the re not be
1608two completely different enumerations because this leads to many casts. To avoid this, the “+” can be
1609added to a TPM_ALG_NULL value in the table defining the type. When the use of that type allows
1610TPM_ALG_NULL to be in the set, the use would append a “+” to the instance.
1611
1612EXAMPLE
1613
1614Table xx — Definition of (CARD_SUIT) TPMI_CARD_SUIT Type
1615Values
1616
1617Comments
1618
1619SPADES
1620HEARTS
1621DIAMONDS
1622CLUBS
1623+JOKER
1624
1625an optional value that may be allowed
1626
1627#TPM_RC_SUIT
1628
1629response code returned when the input value is not one of the
1630values above
1631
1632When an interface type is used, a “+” will be appended to the type specification for the parameter when
1633the conditional value is allowed. If no “+” is present, then the conditional value is not allowed.
1634EXAMPLE 1
1635
1636Table xx — Definition of POKER_CARD Structure
1637Parameter
1638
1639Type
1640
1641Description
1642
1643suit
1644
1645TPMI_CARD_SUIT+
1646
1647allows joker
1648
1649number
1650
1651UINT8
1652
1653the card value
1654
1655EXAMPLE 2
1656
1657Table xx — Definition of BRIDGE_CARD Structure
1658Parameter
1659
1660Type
1661
1662Description
1663
1664suit
1665
1666TPMI_CARD_SUIT
1667
1668does not allow joker
1669
1670number
1671
1672UINT8
1673
1674the card value
1675
1676Family “2.0”
1677Level 00 Revision 00.99
1678
1679Published
1680Copyright © TCG 2006-2013
1681
1682Page 7
1683October 31, 2013
1684
1685Part 2: Structures
16864.9
1687
1688Trusted Platform Module Library
1689
1690Unions
1691
16924.9.1
1693
1694Introduction
1695
1696A union allows a structure to contain a variety of structures or types. The union has members, only one of
1697which is present at a time. Three different tables are required to fully characterize a union so that it may
1698be communicated on the TPM interface and used by the TPM:
16991) union definition;
17002) union instance; and
17013) union selector definition.
17024.9.2
1703
1704Union Definition
1705
1706The table in Example 1 illustrates a union definition. The title of a union definition table starts with
1707“Definition” and ends with “Union.” The “Parameter” column of a union definition lists the different names
1708that are used when referring a specific type. The “Type” column identifies the data type of the member.
1709The “Selector” column identifies the value that is used by the marshaling and unmarshaling code to
1710determine which case of the union is present.
1711If a parameter is the keyword “null,” then this denotes a selector with no contents. The table in Example 1
1712illustrates a union in which a conditional null selector is allowed to indicate an empty union member.
1713Example 2 shows how the table would be converted into C-compatible code.
1714The expectation is that the unmarshaling code for the union will validate that the selector for the union is
1715one of values in the selector list.
1716EXAMPLE 1
1717
1718Table xx — Definition of NUMBER_UNION Union
1719Parameter
1720
1721Type
1722
1723Selector
1724
1725a_byte
1726
1727BYTE
1728
1729BYTE_SELECT
1730
1731an_int
1732
1733int
1734
1735INT_SELECT
1736
1737a_float
1738
1739float
1740
1741FLOAT_SELECT
1742
1743+null
1744
1745NULL_SELECT
1746
1747Description
1748
1749the empty branch
1750
1751EXAMPLE 2
1752// C-compatible version of the union defined in the table above
1753typedef union {
1754BYTE
1755a_byte;
1756int
1757an_int;
1758float
1759a_float;
1760} NUMBER_UNION;
1761EXAMPLE 3
1762
1763Page 8
1764October 31, 2013
1765
1766Published
1767Copyright © TCG 2006-2013
1768
1769Family “2.0”
1770Level 00 Revision 00.99
1771
1772Trusted Platform Module Library
1773
1774Part 2: Structures
1775
1776// Possible auto-generated code to unmarshal a union in Example 2 based on the
1777// input value of selector
1778bool NUMBER_UNION_Unmarshal(NUMBER_UNION *target, BYTE **buffer,
1779INT32 *size, UINT32 selector)
1780{
1781switch (selector) {
1782case BYTE_SELECT:
1783return BYTE_Unmarshal((BYTE *)&(target->a_byte), buffer, size);
1784case INT_SELECT:
1785return INT_Unmarshal((int *)&(target->an_int), buffer, size);
1786case FLOAT_SELECT:
1787return FLOAT_Unmarshal((float *)&(target->a_float), buffer, size);
1788case NULL_SELECT:
1789return;
1790}
1791
1792A table may have a type with no selector. This is used when the first part of the structure for all union
1793members is identical. This type is a programming convenience, allowing code to reference the common
1794members without requiring a case statement to determine the specific structure. In object oriented
1795programming terms, this type is a superclass and the types with selectors are subclasses.
17964.9.3
1797
1798Union Instance
1799
1800When a union is used in a structure that is sent on the interface, the structure will minimally contain a
1801selector and a union. The selector value indicates which of the possible union members is present so that
1802the unmarshaling code can unmarshal the correct type. The selector may be any of the parameters that
1803occur in the structure before the union instance. To denote the structure parameter that is used as the
1804selector, its name is in brackets (“[ ]”) placed before the parameter name associated with the union.
1805The table in Example 1 shows the definition of a structure that contains a union and a selector. Example 2
1806shows how the table would be converted into C-compatible code and Example 3 shows how the
1807unmarshaling code would handle the selector.
1808EXAMPLE 1
1809
1810Table xx — Definition of STRUCTURE_WITH_UNION Structure
1811Parameter
1812
1813Type
1814
1815Description
1816
1817select
1818
1819NUMBER_SELECT
1820
1821a value indicating the type in number
1822
1823[select] number
1824
1825NUMBER_UNION
1826
1827a union as shown in 4.9.2
1828
1829EXAMPLE 2
1830// C-compatible version of the union structure in the table above
1831typedef struct {
1832NUMBER_SELECT
1833select;
1834NUMBER_UNION
1835number;
1836} STRUCT_WITH_UNION;
1837EXAMPLE 3
1838
1839Family “2.0”
1840Level 00 Revision 00.99
1841
1842Published
1843Copyright © TCG 2006-2013
1844
1845Page 9
1846October 31, 2013
1847
1848Part 2: Structures
1849
1850Trusted Platform Module Library
1851
1852// Possible unmarshaling code for the structure above
1853bool STRUCT_WITH_UNION_Unmarshal(STRUCT_WITH_UNION *target, BYTE **buffer, INT32 *size)
1854{
1855// Unmarshal the selector value
1856if(!NUMBER_SELECT_Unmarshal((NUMBER_SELECT *)&target->select, buffer, size))
1857return FALSE;
1858// Use the unmarshaled selector value to indicate to the union unmarshal
1859// function which unmarshaling branch to follow.
1860return(NUMBER_UNION_Unmarshal((NUMBER_UNION *)&(target->number),
1861buffer, size, (UINT32)target->select);
1862}
1863
18644.9.4
1865
1866Union Selector Definition
1867
1868The selector definition limits the values that are used in unmarshaling a union. Two different selector sets
1869applied to the same union define different types.
1870For the union in 4.9.2, a selector definition should be limited to no more than four values, one for each of
1871the union members. The selector definition could have fewer than four values.
1872In Example 1, the table defines a value for each of the union members.
1873EXAMPLE 1
1874
1875Table xx — Definition of (INT8) NUMBER_SELECT Values <IN>
1876Name
1877
1878Value
1879
1880BYTE_SELECT
1881
18823
1883
1884INT_SELECT
1885
18862
1887
1888FLOAT_SELECT
1889
18901
1891
1892NULL_SELECT
1893
1894Comments
1895
18960
1897
1898The unmarshaling code would limit the input values to the defined values. When the NUMBER_SELECT
1899is used in the union instance of 4.9.3, any of the allowed union members of NUMBER_UNION could be
1900present.
1901A different selection could be used to limit the values in a specific instance. To get the different selection,
1902a new structure is defined with a different selector. The table in example 2 illustrates a way to subset the
1903union. The base type of the selection is NUMBER_SELECT so a NUMBER_SELECT will be unmarshaled
1904before the checks are made to see if the value is in the correct range for JUST_INTEGERS types. If the
1905base type had been UINT8, then no checking would occur prior to checking that the value is in the
1906allowed list. In this particular case, the effect is the same in either case since the only values that will be
1907accepted by the unmarshaling code for JUST_INTEGER are BYTE_SELECT and INT_SELECT.
1908EXAMPLE 2
1909
1910Table xx — Definition of (NUMBER_SELECT) AN_INTEGER Type <IN>
1911Values
1912{BYTE_SELECT, INT_SELECT}
1913NOTE
1914
1915Comments
1916list of allowed values
1917
1918Since NULL_SELECT is not in the list of values accepted as a JUST_INTEGER, the “+” modifier will have
1919no effect if used for a JUST_INTEGERS type shown in Example 3.
1920
1921Page 10
1922October 31, 2013
1923
1924Published
1925Copyright © TCG 2006-2013
1926
1927Family “2.0”
1928Level 00 Revision 00.99
1929
1930Trusted Platform Module Library
1931
1932Part 2: Structures
1933
1934The selector in Example 2 can then be used in a subset union as shown in Example 3.
1935EXAMPLE 3
1936
1937Table xx — Definition of JUST_INTEGERS Structure
1938Parameter
1939
1940Type
1941
1942Description
1943
1944select
1945
1946AN_INTEGER
1947
1948a value indicating the type in number
1949
1950[select] number
1951
1952NUMBER_UNION
1953
1954a union as shown in 4.9.2
1955
19564.10 Bit Field Definitions
1957A table that defines a structure containing bit fields has a title that starts with “Definition” and ends with
1958“Bits.” A type identifier in parentheses in the title indicates the size of the datum that contains the bit
1959fields.
1960When the bit fields do not occupy consecutive locations, a spacer field is defined with a name of
1961“Reserved.” Bits in these spaces are reserved and shall be zero.
1962The table in Example 1 shows how a structure containing bit fields would be defined in this specification.
1963Example 2 shows the C code that might be produced from that table by an automated process.
1964When a field has more than one bit, the range is indicated by a pair of numbers separated by a colon (“:”).
1965The numbers will be in high:low order.
1966EXAMPLE1
1967
1968Table xx — Definition of (UINT32) SOME_ATTRIBUTE Bits
1969Bit
19700
1971
1972Name
1973
1974Action
1975
1976zeroth_bit
1977
1978SET (1): what to do if bit is 1
1979CLEAR (0): what to do if bit is 0
1980
19811
1982
1983first_bit
1984
1985SET (1): what to do if bit is 1
1986CLEAR (0): what to do if bit is 0
1987
19886:2 Reserved
1989
1990A placeholder that spans 5 bits
1991
19927
1993
1994third_bit
1995
1996SET (1): what to do if bit is 1
1997CLEAR (0): what to do if bit is 0
1998
199931:8 Reserved
2000
2001Placeholder to fill 32 bits
2002
2003EXAMPLE 2
2004/* C language equivalent of the attributes structure defined in the table above */
2005typedef struct {
2006int zeroth_bit : 1;
2007int first_bit : 1;
2008int Reserved3 : 5;
2009int third_bit : 1;
2010int Reserved7 : 24;
2011} SOME_ATTRIBUTE;
2012
20134.11 Parameter Limits
2014A parameter used in a structure may be given a set of values that can be checked by the unmarshaling
2015code. The allowed values for a parameter may be included in the definition of the parameter by
2016appending the values and delimiting them with braces (“{ }”). The values are comma-separated
2017expressions. A range of numbers may be indicated by separating two expressions with a colon (“:”). The
2018Family “2.0”
2019Level 00 Revision 00.99
2020
2021Published
2022Copyright © TCG 2006-2013
2023
2024Page 11
2025October 31, 2013
2026
2027Part 2: Structures
2028
2029Trusted Platform Module Library
2030
2031first number is an expression that represents the minimum allowed value and the second number
2032indicates the maximum. If the minimum or maximum value expression is omitted, then the range is openended.
2033Parameter limits expressed using braces apply only to inputs to the TPM. Any value returned by the
2034TPM is assumed to be valid.
2035The maximum size of an array may be indicated by putting a “{}” delimited expression following the
2036square brackets (“[ ]”) that indicate that the value is an array.
2037EXAMPLE
2038
2039Table xx — Definition of B_STRUCT Structure
2040Parameter
2041
2042Type
2043
2044Description
2045
2046value1 {20:25}
2047
2048UINT16
2049
2050a parameter that must have a value between 20
2051and 25
2052
2053value2 {20}
2054
2055UINT16
2056
2057a parameter that must have a value of 20
2058
2059value3 {:25}
2060
2061INT16
2062
2063a parameter that may be no larger than 25
2064Since the parameter is signed, the minimum value
2065is the largest negative integer that may be
2066expressed in 16 bits.
2067
2068value4 {20:}
2069
2070a parameter that must be at least 20
2071
2072value5 {1,2,3,5}
2073
2074UINT16
2075
2076a parameter that may only have one of the four
2077listed values
2078
2079value6 {1, 2, 10:(10+10)}
2080
2081UINT32
2082
2083a parameter that may have a value of 1, 2, or be
2084between 10 and 20
2085
2086array1[value1]
2087
2088BYTE
2089
2090Because the index refers to value1, which is a
2091value limited to be between 20 and 25 inclusive,
2092array1 is an array that may have between 20 and
209325 octets. This is not the preferred way to indicate
2094the upper limit for an array as it does not indicate
2095the upper bound of the size.
2096NOTE
2097
2098array2 [value4] {:25}
2099
2100BYTE
2101
2102This is a limitation of the current
2103parser. A different parser could
2104associate the range of value1 with this
2105value and compute the maximum size
2106of the array.
2107
2108an array that may have between 20 and 25 octets
2109This arrangement is used to allow the automatic
2110code generation to allocate 25 octets to store the
2111largest array2 that can be unmarshaled. The code
2112generation can determine from this expression that
2113value4 shall have a value of 25 or less. From the
2114definition of value4 above, it can determine that
2115value4 must have a value of at least 20.
2116
2117Page 12
2118October 31, 2013
2119
2120Published
2121Copyright © TCG 2006-2013
2122
2123Family “2.0”
2124Level 00 Revision 00.99
2125
2126Trusted Platform Module Library
2127
2128Part 2: Structures
2129
21304.12 Enumeration Macro
2131An enumeration can be a list of allowed numeric values. For example, the allowed sizes for an RSA key
2132might be expressed as:
2133
21344.13 Size Checking
2135In some structures, a size field is present to indicate the number of octets in some subsequent part of the
2136structure. In the B_STRUCT table in 4.11, value4 indicates how many octets to unmarshal for array2. This
2137semantic applies when the size field determines the number of octets to unmarshal. However, in some
2138cases, the subsequent structure is self-defining. If the size precedes a parameter that is not an octet
2139array, then the unmarshaled size of that parameter is determined by its data type. The table in Example 1
2140shows a structure where the size parameter would nominally indicate the number of octets in the
2141remainder of the structure.
2142EXAMPLE 1
2143
2144Table xx — Definition of C_STRUCT Structure
2145Parameter
2146
2147Type
2148
2149Comments
2150
2151size
2152
2153UINT16
2154
2155the expected size of the remainder of the structure
2156
2157anInteger
2158
2159UINT32
2160
2161a 4-octet value
2162
2163In this particular case, the value of size would be incorrect if it had any value other than 4. So that the
2164table parser is able to know that the purpose of the size parameter is to define the number of octets
2165expected in the remainder of the structure, an equal sign (“=”) is appended to the parameter name.
2166In the example below, the size= causes the parser to generate validation code that will check that the
2167unmarshaled size of someStructure and someData adds to the value unmarshaled for size. When the “=”
2168decoration is present, a value of zero is not allowed for the size.
2169EXAMPLE 2
2170
2171Table xx — Definition of D_STRUCT Structure
2172Parameter
2173
2174Type
2175
2176Comments
2177
2178size=
2179
2180UINT16
2181
2182the size of a structure
2183The “=” indicates that the TPM is required to
2184validate that the remainder of the D_STRUCT
2185structure is exactly the value in size. That is, the
2186number of bytes in the input buffer used to
2187successfully unmarshal someStructure must be the
2188same as size.
2189
2190someStructure
2191
2192A_STRUCT
2193
2194a structure to be unmarshaled
2195The size of the structure is computed when it is
2196unmarshaled. Because an “=” is present on the
2197definition of size, the TPM is required to validate
2198that the unmarshaled size exactly matches size.
2199
2200someData
2201
2202Family “2.0”
2203Level 00 Revision 00.99
2204
2205UINT32
2206
2207a value
2208
2209Published
2210Copyright © TCG 2006-2013
2211
2212Page 13
2213October 31, 2013
2214
2215Part 2: Structures
2216
2217Trusted Platform Module Library
2218
22194.14 Data Direction
2220A structure or union may be input (IN), output (OUT), or internal. An input structure is sent to the TPM and
2221is unmarshaled by the TPM. An output structure is sent from the TPM and is marshaled by the TPM. An
2222internal structure is not used outside of the TPM except that it may be included in a saved context.
2223By default, structures are assumed to be both IN and OUT and the code generation tool will generate
2224both marshaling and unmarshaling code for the structure. This default may be changed by using values
2225enclosed in angle brackets (“<>”) as part of the table title. If the angle brackets are empty, then the
2226structure is internal and neither marshaling nor unmarshaling code is generated. If the angle brackets
2227contain the letter “I” (such as in “IN” or “in” or “i”), then the structure is input and unmarshaling code will be
2228generated. If the angle brackets contain the letter “O” (such as in “OUT” or “out” or “o”), then the structure
2229is output and marshaling code will be generated.
2230EXAMPLE 1
2231
2232Both of the following table titles would indicate a structure that is used in both input and output
2233Table xx — Definition of TPMS_A Structure
2234Table xx — Definition of TPMS_A Structure <IN/OUT>
2235
2236EXAMPLE 2
2237
2238The following table title would indicate a structure that is used only for input
2239Table xx — Definition of TPMS_A Structure <IN>
2240
2241EXAMPLE 3
2242
2243The following table title would indicate a structure that is used only for output
2244Table xx — Definition of TPMS_A Structure <OUT>
2245
22464.15 Structure Validations
2247By default, when a structure is used for input to the TPM, the code generation tool will generate the
2248unmarshaling code for that structure. Auto-generation may be suppressed by adding an “S” within the
2249angle brackets.
2250EXAMPLE
2251
2252The following table titles indicate a structure for which the auto -generation of the validation code is to be
2253suppressed.
2254Table xx — Definition of TPMT_A Structure <S>
2255Table xx — Definition of TPMT_A Structure <IN, S>
2256Table xx — Definition of TPMT_A Structure <IN/OUT, S>
2257
22584.16 Name Prefix Convention
2259Parameters are constants, variables, structures, unions, and structure members. Structure members are
2260given a name that is indicative of its use, with no special prefix. The other parameter types are named
2261according to their type with their name starting with “TPMx_”, where “x” is an optional character to indicate
2262the data type.
2263In some cases, additional qualifying characters will follow the underscore. These are generally used when
2264dealing with an enumerated data type.
2265TPMA_ This is an attribute structure, where bits are associated with particular attributes
2266
2267Page 14
2268October 31, 2013
2269
2270Published
2271Copyright © TCG 2006-2013
2272
2273Family “2.0”
2274Level 00 Revision 00.99
2275
2276Trusted Platform Module Library
2277
2278Part 2: Structures
2279
2280Table 1 — Name Prefix Convention
2281Prefix
2282
2283Description
2284
2285_TPM_
2286
2287an indication/signal from the TPM’s system interface
2288
2289TPM_
2290
2291a constant or an enumerated type
2292
2293TPM2_
2294
2295a command defined by this specification
2296
2297TPM2B_
2298
2299a structure that is a sized buffer where the size of the buffer is contained in a 16-bit, unsigned
2300value
2301The first parameter is the size in octets of the second parameter. The second parameter may be
2302any type.
2303
2304TPMA_
2305
2306a structure where each of the fields defines an attribute and each field is usually a single bit
2307All the attributes in an attribute structure are packed with the overall size of the structure
2308indicated in the heading of the attribute description (UINT8, UINT16, or UINT32).
2309
2310TPM_ALG_
2311
2312an enumerated type that indicates an algorithm
2313A TPM_ALG_ is often used as a selector for a union.
2314
2315TPMI_
2316
2317an interface type
2318The value is specified for purposes of dynamic type checking when unmarshaled.
2319
2320TPML_
2321
2322a list length followed by the indicated number of entries of the indicated type
2323This is an array with a length field.
2324
2325TPMS_
2326
2327a structure that is not a size buffer or a tagged buffer or a list
2328
2329TPMT_
2330
2331a structure with the first parameter being a structure tag, indicating the type of the structure that
2332follows
2333A structure tag may be either a TPMT_ST_ or TPM_ALG_ depending on context.
2334
2335TPMU_
2336
2337a union of structures, lists, or unions
2338If a union exists, there will normally be a companion TPMT_ that is the expression of the union
2339in a tagged structure, where the tag is the selector indicating which member of the union is
2340present.
2341
2342TPM_xx_
2343
2344an enumeration value of a particular type
2345The value of “xx” will be indicative of the use of the enumerated type. A table of “TPM_xx”
2346constant definitions will exist to define each of the TPM_xx_ values.
2347EXAMPLE 1
2348
2349TPM_CC_ indicates that the type is used for a commandCode. The allowed enumeration
2350values will be found in the table defining the TPM_CC constants (Table 11).
2351
2352EXAMPLE 2
2353
2354TPM_RC_ indicates that the type is used for a responseCode. The allowed enumeration
2355values are in Table 15.
2356
23574.17 Data Alignment
2358The data structures in this Part 2 use octet alignment for all structures. When used in a table to indicate a
2359maximum size, the sizeof() function returns the octet-aligned size of the structure, with no padding.
23604.18
2361
2362Parameter Unmarshaling Errors
2363
2364The TPM commands are defined in Part 3. The command definition included C code that details the
2365actions performed by that command. The code is written assuming that the parameters of the command
2366have been unmarshaled.
2367NOTE 1
2368
2369An implementation is not required to process parameters in this manner or to separate the parameter
2370parsing from the command actions. This method was chosen for the specification so that the normative
2371behavior described by the detailed actions would be clear and unencumbered.
2372
2373Family “2.0”
2374Level 00 Revision 00.99
2375
2376Published
2377Copyright © TCG 2006-2013
2378
2379Page 15
2380October 31, 2013
2381
2382Part 2: Structures
2383
2384Trusted Platform Module Library
2385
2386Unmarshaling is the process of processing the parameters in the input buffer and preparing the
2387parameters for use by the command-specific action code. No data movement need take place but it is
2388required that the TPM validate that the parameters meet the requirements of the expected data type as
2389defined in this Part 2.
2390When an error is encountered while unmarshaling a command parameter, an error response code is
2391returned and no command processing occurs. A table defining a data type may have response codes
2392embedded in the table to indicate the error returned when the input value does not match the parameters
2393of the table.
2394EXAMPLE 1
2395
2396Table 11 has a listing of TPM command code values. The last row in the table contains
2397"#TPM_RC_COMMAND_CODE" indicating the response code that is returned if the TPM is unmarshaling
2398a value that it expects to be a TPM_CC and the input value is not in the table.
2399
2400NOTE 2
2401
2402In the reference implementation, a parameter number is added to the response code so that the offending
2403parameter can be isolated.
2404
2405In many cases, the table contains no specific response code value and the return code will be determined
2406as defined in Table 2.
2407Table 2 — Unmarshaling Errors
2408Response code
2409
2410Usage
2411
2412TPM_RC_INSUFFICIENT
2413
2414the input buffer did not contain enough octets to allow unmarshaling of the
2415expected data type;
2416
2417TPM_RC_RESERVED
2418
2419a non-zero value was found in a reserved field of an attribute structure (TPMA_)
2420
2421TPM_RC_SIZE
2422
2423the value of a size parameter is larger or smaller than allowed
2424
2425TPM_RC_VALUE
2426
2427A parameter does not have one of its allowed values
2428
2429TPM_RC_TAG
2430
2431A parameter that should be a structure tag has a value that is not supported by
2432the TPM
2433
2434In some commands, a parameter may not be used because of various options of that command.
2435However, the unmarshaling code is required to validate that all parameters have values that are allowed
2436by the Part 2 definition of the parameter type even if that parameter is not used in the command actions.
2437
2438Page 16
2439October 31, 2013
2440
2441Published
2442Copyright © TCG 2006-2013
2443
2444Family “2.0”
2445Level 00 Revision 00.99
2446
2447Trusted Platform Module Library
2448
24495
2450
2451Part 2: Structures
2452
2453Base Types
2454
24555.1
2456
2457Primitive Types
2458
2459The types listed in Table 3 are the primitive types on which all of the other types and structures are
2460based. The values in the “Type” column should be edited for the compiler and computer on which the
2461TPM is implemented. The values in the “Name” column should remain the same because these values
2462are used in the remainder of the specification.
2463NOTE
2464
2465The types are compatible with the C99 standard and should be defined in stdint.h that is provided with a
2466C99-compliant compiler;
2467
2468The parameters in the Name column should remain in the order shown.
2469Table 3 — Definition of Base Types
2470Type
2471
2472Name
2473
2474Description
2475
2476uint8_t
2477
2478UINT8
2479
2480unsigned, 8-bit integer
2481
2482uint8_t
2483
2484BYTE
2485
2486unsigned 8-bit integer
2487
2488int8_t
2489
2490INT8
2491
2492signed, 8-bit integer
2493
2494int
2495
2496BOOL
2497
2498a bit in an int
2499This is not used across the interface but is used in many places in the code. If
2500the type were sent on the interface, it would have to have a type with a specific
2501number of bytes.
2502
2503uint16_t
2504
2505UINT16
2506
2507unsigned, 16-bit integer
2508
2509int16_t
2510
2511INT16
2512
2513signed, 16-bit integer
2514
2515uint32_t
2516
2517UINT32
2518
2519unsigned, 32-bit integer
2520
2521int32_t
2522
2523INT32
2524
2525signed, 32-bit integer
2526
2527uint64_t
2528
2529UINT64
2530
2531unsigned, 64-bit integer
2532
2533int64_t
2534
2535INT64
2536
2537signed, 64-bit integer
2538
25395.2
2540
2541Miscellaneous Types
2542
2543These types are defined either for compatibility with previous versions of this specification or for clarity of
2544this specification.
2545Table 4 — Definition of Types for Documentation Clarity
2546Type
2547
2548Name
2549
2550Description
2551
2552UINT32
2553
2554TPM_ALGORITHM_ID
2555
2556this is the 1.2 compatible form of the TPM_ALG_ID
2557
2558UINT32
2559
2560TPM_MODIFIER_INDICATOR
2561
2562UINT32
2563
2564TPM_AUTHORIZATION_SIZE
2565
2566the authorizationSize parameter in a command
2567
2568UINT32
2569
2570TPM_PARAMETER_SIZE
2571
2572the parameterSizeset parameter in a command
2573
2574UINT16
2575
2576TPM_KEY_SIZE
2577
2578a key size in octets
2579
2580UINT16
2581
2582TPM_KEY_BITS
2583
2584a key size in bits
2585
25861.1.1.1.1
2587
2588Family “2.0”
2589Level 00 Revision 00.99
2590
2591Published
2592Copyright © TCG 2006-2013
2593
2594Page 17
2595October 31, 2013
2596
2597Part 2: Structures
2598
25996
2600
2601Trusted Platform Module Library
2602
2603Constants
2604
26056.1
2606
2607TPM_SPEC (Specification Version Values)
2608
2609These values are readable with TPM2_GetCapability().
2610NOTE
2611
2612This table will require editing when the specification is updated.
2613
2614Table 5 — Definition of (UINT32) TPM_SPEC Constants <>
2615Name
2616
2617Value
2618
2619Comments
2620ASCII “2.0” with null terminator
2621
2622TPM_SPEC_FAMILY
2623
26240x322E3000
2625
2626TPM_SPEC_LEVEL
2627
262800
2629
2630the level number for the specification
2631
2632TPM_SPEC_VERSION
2633
263499
2635
2636the version number of the spec (00.99 * 100)
2637
2638TPM_SPEC_YEAR
2639
26402013
2641
2642the year of the version
2643
2644TPM_SPEC_DAY_OF_YEAR
2645
2646304
2647
2648the day of the year (October 31, 2013)
2649
26506.2
2651
2652TPM_GENERATED
2653
2654This constant value differentiates TPM-generated structures from non-TPM structures.
2655Table 6 — Definition of (UINT32) TPM_GENERATED Constants <O>
2656Name
2657
2658Value
2659
2660Comments
2661
2662TPM_GENERATED_VALUE
2663
26640xff544347
2665
26660xFF ‘TCG’ (FF 54 43 4716)
2667
2668Page 18
2669October 31, 2013
2670
2671Published
2672Copyright © TCG 2006-2013
2673
2674Family “2.0”
2675Level 00 Revision 00.99
2676
2677Trusted Platform Module Library
26786.3
2679
2680Part 2: Structures
2681
2682TPM_ALG_ID
2683
2684The TCG maintains a registry of all algorithms that have an assigned algorithm ID. That registry is the
2685definitive list of algorithms that may be supported by a TPM.
2686NOTE
2687
2688Inclusion of an algorithm does NOT indicate that the necessary claims of the algorithm are av ailable
2689under RAND terms from a TCG member.
2690
2691Table 7 is a copy of the TPM_ALG_ID constants table in the TCG registry as of the date of publication of
2692this specification. Table 7 is provided for illustrative purposes only.
2693{{Note for TCG Admin: Table 7 and the text in the paragraph above should be updated to reflect the final
2694decisions by the TCG Board of Directors about inclusion of the table and the contents of the table. The
2695desired approach is to leave the text as is and, immediately before publication of this specification for
2696TCG admin to verify that Table 7 is the same as the algorithm registry table published by the TCG.}}
2697An algorithm ID is often used like a tag to determine the type of a structure in a context-sensitive way.
2698The values for TPM_ALG_ID shall be in the range of 00 0016 – 7F FF16. Other structure tags will be in the
2699range 80 0016 – FF FF16.
2700NOTE
2701
2702In TPM 1.2, these were defined as 32-bit constants. This specification limits the future size of the
2703algorithm ID to 16 bits. The TPM_ALGORITHM_ID data type will continue to be a 32-bit number.
2704
2705An algorithm shall not be assigned a value in the range 00 C116 – 00 C616 in order to prevent any overlap
2706with the command structure tags used in TPM 1.2.
2707The implementation of some algorithms is dependent on the presence of other algorithms. When there is
2708a dependency, the algorithm that is required is listed in column labeled "D" (dependent) in Table 7.
2709EXAMPLE
2710
2711Implementation of TPM_ALG_RSASSA requires that the RSA algorithm be implemented.
2712
2713TPM_ALG_KEYEDHASH and TPM_ALG_NULL are required of all TPM implementations.
2714Table 7 — Definition of (UINT16) TPM_ALG_ID Constants <IN/OUT, S>
2715Algorithm Name
2716
2717Value
2718
2719Type
2720
2721a
2722
2723D
2724
2725Comments
2726
2727TPM_ALG_ERROR
2728
27290x0000
2730
2731should not occur
2732
2733TPM_ALG_FIRST
2734
27350x0001
2736
2737TPM_ALG_RSA
2738
27390x0001
2740
2741AO
2742
2743the RSA algorithm
2744
2745TPM_ALG_SHA
2746
27470x0004
2748
2749H
2750
2751the SHA1 algorithm
2752
2753TPM_ALG_SHA1
2754
27550x0004
2756
2757H
2758
2759redefinition for documentation consistency
2760OID 30 21 30 09 06 05 2B 0E 03 02 1A 05 00 04 14 16
2761
2762TPM_ALG_HMAC
2763
27640x0005
2765
2766HX
2767
2768the RFC 2104 Hash Message Authentication Code
2769(HMAC) algorithm
2770
2771TPM_ALG_AES
2772
27730x0006
2774
2775S
2776
2777
2778TPM_ALG_MGF1
2779
27800x0007
2781
2782HM
2783
2784the mask-generation function defined in IEEE Std
27851363-2000
2786
2787TPM_ALG_KEYEDHASH
2788
27890x0008
2790
2791HEXO
2792
2793an encryption or signing algorithm using a keyed hash,
2794defined by TCG in the TPM 2.0 specification
2795may also refer to a data object that is neither signing
2796nor encrypting
2797
2798TPM_ALG_XOR
2799
28000x000A
2801
2802HS
2803
2804marker value
2805
2806the XOR obfuscation algorithm
2807NOTE
2808
2809Family “2.0”
2810Level 00 Revision 00.99
2811
2812Published
2813Copyright © TCG 2006-2013
2814
2815Page 19
2816October 31, 2013
2817
2818Part 2: Structures
2819Algorithm Name
2820
2821Trusted Platform Module Library
2822a
2823
2824Value
2825
2826Type
2827
2828TPM_ALG_SHA256
2829
28300x000B
2831
2832H
2833
2834D
2835
2836Comments
2837the SHA 256 algorithm
2838OID 30 31 30 0d 06 09 60 86 48 01 65 03 04 02 01 05
283900 04 2016
2840
2841TPM_ALG_SHA384
2842
28430x000C
2844
2845H
2846
2847the SHA 384 algorithm
2848OID 30 41 30 0d 06 09 60 86 48 01 65 03 04 02 02 05
284900 04 3016
2850
2851TPM_ALG_SHA512
2852
28530x000D
2854
2855H
2856
2857the SHA 512 algorithm
2858OID 30 51 30 0d 06 09 60 86 48 01 65 03 04 02 03 05
285900 04 4016
2860
2861TPM_ALG_NULL
2862
28630x0010
2864
2865TPM_ALG_SM3_256
2866
28670x0012
2868
2869H
2870
2871hash algorithm standardized by OSCCA
2872Block size is 512 bits.
2873Output size is 256 bits.
2874
2875TPM_ALG_SM4
2876
28770x0013
2878
2879S
2880
2881symmetric algorithm standardized by OSCCA
2882Key and block size are 128 bits.
2883
2884TPM_ALG_RSASSA
2885
28860x0014
2887
2888AX
2889
2890RSA a signature algorithm according to PKCS#1v2.1, 8.2
2891
2892TPM_ALG_RSAES
2893
28940x0015
2895
2896AE
2897
2898RSA a padding algorithm according to PKCS#1v2.1, 7.2
2899
2900TPM_ALG_RSAPSS
2901
29020x0016
2903
2904AX
2905
2906RSA signature algorithm (RSSASSA-PSS) according to
2907PKCS#1v2.1, 8.1
2908
2909TPM_ALG_OAEP
2910
29110x0017
2912
2913AE
2914
2915RSA padding algorithm
2916PKCS#1v2.1, 7.1
2917
2918TPM_ALG_ECDSA
2919
29200x0018
2921
2922AX
2923
2924ECC signature algorithm using elliptic curve cryptography
2925(ECC)
2926
2927TPM_ALG_ECDH
2928
29290x0019
2930
2931AM
2932
2933ECC secret sharing using ECC from SP800-56A
2934Based on context, this can be either One-Pass DiffieHellman, C(1, 1, ECC CDH) defined in 6.2.2.2 or Full
2935Unified Model C(2, 2, ECC CDH) defined in 6.1.1.2
2936
2937TPM_ALG_ECDAA
2938
29390x001A
2940
2941AX
2942
2943ECC elliptic-curve based, anonymous signing scheme
2944
2945TPM_ALG_SM2
2946
29470x001B
2948
2949AXE
2950
2951Null algorithm
2952
2953(RSAES_OAEP)
2954
2955according
2956
2957to
2958
2959ECC depending on context, either an elliptic-curve based,
2960signature algorithm or a key exchange protocol
2961NOTE
2962
2963This would be one of the algorithms specified in
2964CM/T 0002 – 2012.
2965
2966TPM_ALG_ECSCHNORR
2967
29680x001C
2969
2970AX
2971
2972ECC elliptic-curve-based Schnorr signature
2973
2974TPM_ALG_ECMQV
2975
29760x001D
2977
2978AE
2979
2980ECC two-phase elliptic-curve key exchange -- C(2, 2, ECC
2981MQV) from SP800-56A
2982
2983TPM_ALG_KDF1_SP800_56a
2984
29850x0020
2986
2987HM
2988
2989ECC key derivation alternative #1 from SP800-56A
2990
2991TPM_ALG_KDF2
2992
29930x0021
2994
2995HM
2996
2997key derivation function from IEEE Std 1363a-2004
2998
2999TPM_ALG_KDF1_SP800_108
3000
30010x0022
3002
3003HM
3004
3005a key derivation method according to SP 800-108, "5.1
3006KDF in Counter Mode”
3007
3008TPM_ALG_ECC
3009
30100x0023
3011
3012AO
3013
3014prime field ECC
3015
3016TPM_ALG_SYMCIPHER
3017
30180x0025
3019
3020O
3021
3022TPM_ALG_CTR
3023
30240x0040
3025
3026SE
3027
3028Counter mode – if implemented, all symmetric block
3029ciphers (S type) implemented shall be capable of using
3030this mode.
3031
3032TPM_ALG_OFB
3033
30340x0041
3035
3036SE
3037
3038Output Feedback mode – if implemented, all
3039symmetric block ciphers (S type) implemented shall be
3040capable of using this mode.
3041
3042TPM_ALG_CBC
3043
30440x0042
3045
3046SE
3047
3048Cipher Block Chaining mode – if implemented, all
3049symmetric block ciphers (S type) implemented shall be
3050capable of using this mode.
3051
3052Page 20
3053October 31, 2013
3054
3055the object type for a symmetric block cipher
3056
3057Published
3058Copyright © TCG 2006-2013
3059
3060Family “2.0”
3061Level 00 Revision 00.99
3062
3063Trusted Platform Module Library
3064
3065Part 2: Structures
3066a
3067
3068Algorithm Name
3069
3070Value
3071
3072Type
3073
3074TPM_ALG_CFB
3075
30760x0043
3077
3078SE
3079
3080D
3081
3082Comments
3083Cipher Feedback mode – if implemented, all
3084symmetric block ciphers (S type) implemented shall be
3085capable of using this mode.
3086
3087TPM_ALG_ECB
3088
30890x0044
3090
3091SE
3092
3093Electronic Codebook mode – if implemented, all
3094symmetric block ciphers (S type) implemented shall be
3095capable of using this mode.
3096NOTE
3097
3098This mode is not recommended for uses unless
3099the key is frequently rotated such as in video
3100codecs.
3101
3102TPM_ALG_LAST
3103
31040x0044
3105
3106marker value
3107
3108reserved
3109
31100x00C1
3111
31120x00C1 – 0x00C6 are reserved
3113
3114reserved
3115
31160x00C2
3117
3118reserved
3119
31200x00C3
3121
3122reserved
3123
31240x00C4
3125
3126reserved
3127
31280x00C5
3129
3130reserved
3131
31320x00C6
3133
3134NOTE a Column Indicates the algorithm type and use of the algorithm inside of the TPM. The values are:
3135A – asymmetric algorithm with a public and private key
3136S – symmetric algorithm with only a private key
3137H – hash algorithm that compresses input data to a digest value
3138X – signing algorithm
3139E – an encryption algorithm
3140M – a method such as a mask generation function
3141O – an object type
3142
3143Family “2.0”
3144Level 00 Revision 00.99
3145
3146Published
3147Copyright © TCG 2006-2013
3148
3149Page 21
3150October 31, 2013
3151
3152Part 2: Structures
31536.4
3154
3155Trusted Platform Module Library
3156
3157TPM_ECC_CURVE
3158
3159The TCG maintains a registry of all curves that have an assigned curve identifier. That registry is the
3160definitive list of curves that may be supported by a TPM.
3161Table 8 is a copy of the TPM_ECC_CURVE constants table in the TCG registry as of the date of
3162publication of this specification. Table 8 is provided for illustrative purposes only.
3163{{Note for TCG Admin: Table 8 and the text in the paragraph above should be updated to reflect the final
3164decisions by the TCG Board of Directors about inclusion of the table and the contents of the table. The
3165desired approach is to leave the text as is and, immediately before publication of this specification for
3166TCG admin to verify that Table 8 is the same as the curve registry table published by the TCG.}}
3167Table 8 — Definition of (UINT16) {ECC} TPM_ECC_CURVE Constants <IN/OUT, S>
3168Name
3169
3170Value
3171
3172Comments
3173
3174TPM_ECC_NONE
3175
31760x0000
3177
3178TPM_ECC_NIST_P192
3179
31800x0001
3181
3182TPM_ECC_NIST_P224
3183
31840x0002
3185
3186TPM_ECC_NIST_P256
3187
31880x0003
3189
3190TPM_ECC_NIST_P384
3191
31920x0004
3193
3194TPM_ECC_NIST_P521
3195
31960x0005
3197
3198TPM_ECC_BN_P256
3199
32000x0010
3201
3202curve to support ECDAA
3203
3204TPM_ECC_BN_P638
3205
32060x0011
3207
3208curve to support ECDAA
3209
3210TPM_ECC_SM2_P256
3211
32120x0020
3213
3214#TPM_RC_CURVE
3215
32166.5
32176.5.1
3218
3219TPM_CC (Command Codes)
3220Format
3221
3222A command is a 32-bit structure with fields assigned as shown in Figure 1.
32233 3 2 2
32241 0 9 8
3225
3226Res V
3227
32281 1
32296 5
3230
3231Reserved
3232
32330
32340
3235
3236Command Index
3237
3238Figure 1 — Command Format
3239Table 9 — TPM Command Format Fields Description
3240Bit
324115:0
3242
3243Name
3244
3245Definition
3246
3247Command Index
3248
3249the index of the command
3250
325128:16 Reserved
325229
3253
3254V
3255
325631:30 Res
3257
3258Page 22
3259October 31, 2013
3260
3261shall be zero
3262SET(1): the command is vendor specific
3263CLEAR(0): the command is not vendor specific
3264shall be zero
3265
3266Published
3267Copyright © TCG 2006-2013
3268
3269Family “2.0”
3270Level 00 Revision 00.99
3271
3272Trusted Platform Module Library
32736.5.2
3274
3275Part 2: Structures
3276
3277Description
3278
3279Table 10 provides the legend for the interpretation of the column data in Table 11.
3280Table 10 — Legend for Command Code Tables
3281Column
3282
3283Allowed
3284Values
3285
3286Comments
3287
3288Name
3289
3290Command
3291Code Name
3292
3293Name of the command
3294
3295Command Code
3296
3297Numeric value
3298
3299the numeric value for the commandCode
3300
3301NV Write
3302
3303blank, Y, O
3304
3305indicates whether the command may cause an NV write operation
3306If this column contains a “Y,” then successful completion of the
3307command is expected to cause modification of the NV memory
3308because of the command actions.
3309If the column contains an “O,” then the command may cause a
3310modification to NV associated with an orderly shutdown. That is, the
3311command may modify the orderly save state of NV, in which case, an
3312NV write will be necessary.
3313NOTE 1
3314
3315Any command may be delayed in order for the TPM to complete
3316NV actions due to a previous command or because of an
3317asynchronous update of Clock.
3318
3319NOTE 2
3320
3321Any command with an authorization value may cause an NV write
3322on an authorization failure but the command does not complete
3323successfully.
3324
3325If the entry is blank, then writing to NV is not allowed in the command
3326actions.
3327Physical Presence
3328
3329blank, Y
3330
3331indicates whether the platformAuth for this command may require
3332confirmation through a physical presence indication
3333
3334Encrypted
3335
3336blank, 2, 4
3337
3338A numeric value that indicates the number of octets in the size field of
3339the first parameter of a command
3340Blank indicates that no size field is present and no parameter
3341encryption is allowed.
3342
3343Encrypt
3344
3345blank, 2, 4
3346
3347A numeric value that indicates the number of octets in the size field of
3348the first parameter of a response
3349Blank indicates that no size field is present and no parameter
3350encryption is allowed.
3351
3352Family “2.0”
3353Level 00 Revision 00.99
3354
3355Published
3356Copyright © TCG 2006-2013
3357
3358Page 23
3359October 31, 2013
3360
3361Part 2: Structures
33626.5.3
3363
3364Trusted Platform Module Library
3365
3366TPM_CC Listing
3367
3368Table 11 lists the command codes and their attributes. The only normative column in this table is the
3369column indicating the command code assigned to a specific command (the "Command Code" column).
3370For all other columns, the command and response tables in Part 3 are definitive.
3371
3372Encrypt
3373
3374Encrypted
3375
3376Physical Presence
3377
3378NV Write
3379
3380Table 11 — Definition of (UINT32) TPM_CC Constants (Numeric Order) <IN/OUT, S>
3381
3382Name
3383
3384Command
3385Code
3386
3387TPM_CC_FIRST
3388
33890x0000011F
3390
3391Compile variable. May decrease
3392based on implementation.
3393
3394TPM_CC_PP_FIRST
3395
33960x0000011F
3397
3398Compile variable. Would decrease
3399if new PP commands are added
3400
3401TPM_CC_NV_UndefineSpaceSpecial
3402
34030x0000011F
3404
3405Y
3406
3407Y
3408
3409TPM_CC_EvictControl
3410
34110x00000120
3412
3413Y
3414
3415Y
3416
3417TPM_CC_HierarchyControl
3418
34190x00000121
3420
3421Y
3422
3423Y
3424
3425TPM_CC_NV_UndefineSpace
3426
34270x00000122
3428
3429Y
3430
3431Y
3432
3433TPM_CC_ChangeEPS
3434
34350x00000124
3436
3437Y
3438
3439Y
3440
3441TPM_CC_ChangePPS
3442
34430x00000125
3444
3445Y
3446
3447Y
3448
3449TPM_CC_Clear
3450
34510x00000126
3452
3453Y
3454
3455Y
3456
3457TPM_CC_ClearControl
3458
34590x00000127
3460
3461Y
3462
3463Y
3464
3465TPM_CC_ClockSet
3466
34670x00000128
3468
3469Y
3470
3471Y
3472
3473TPM_CC_HierarchyChangeAuth
3474
34750x00000129
3476
3477Y
3478
3479Y
3480
34812
3482
3483TPM_CC_NV_DefineSpace
3484
34850x0000012A
3486
3487Y
3488
3489Y
3490
34912
3492
3493TPM_CC_PCR_Allocate
3494
34950x0000012B
3496
3497Y
3498
3499Y
3500
3501TPM_CC_PCR_SetAuthPolicy
3502
35030x0000012C
3504
3505Y
3506
3507Y
3508
3509TPM_CC_PP_Commands
3510
35110x0000012D
3512
3513Y
3514
3515Y
3516
3517TPM_CC_SetPrimaryPolicy
3518
35190x0000012E
3520
3521Y
3522
3523Y
3524
35252
3526
3527TPM_CC_FieldUpgradeStart
3528
35290x0000012F
3530
3531O
3532
3533Y
3534
35352
3536
3537TPM_CC_ClockRateAdjust
3538
35390x00000130
3540
3541O
3542
3543Y
3544
3545TPM_CC_CreatePrimary
3546
35470x00000131
3548
3549TPM_CC_NV_GlobalWriteLock
3550
35510x00000132
3552
3553TPM_CC_PP_LAST
3554
35550x00000132
3556
3557TPM_CC_GetCommandAuditDigest
3558
35590x00000133
3560
3561Y
3562
3563TPM_CC_NV_Increment
3564
35650x00000134
3566
3567Y
3568
3569Page 24
3570October 31, 2013
3571
3572Y
3573O
3574
3575Comments
3576
35772
3578
35792
3580
35812
3582
3583Y
3584Compile variable
35852
3586
3587Published
3588Copyright © TCG 2006-2013
3589
3590Family “2.0”
3591Level 00 Revision 00.99
3592
3593Command
3594Code
3595
3596TPM_CC_NV_SetBits
3597
35980x00000135
3599
3600Y
3601
3602TPM_CC_NV_Extend
3603
36040x00000136
3605
3606Y
3607
3608TPM_CC_NV_Write
3609
36100x00000137
3611
3612Y
3613
3614TPM_CC_NV_WriteLock
3615
36160x00000138
3617
3618Y
3619
3620TPM_CC_DictionaryAttackLockReset
3621
36220x00000139
3623
3624O
3625
3626TPM_CC_DictionaryAttackParameters
3627
36280x0000013A
3629
3630Y
3631
3632TPM_CC_NV_ChangeAuth
3633
36340x0000013B
3635
3636Y
3637
36382
3639
3640TPM_CC_PCR_Event
3641
36420x0000013C
3643
3644O
3645
36462
3647
3648TPM_CC_PCR_Reset
3649
36500x0000013D
3651
3652O
3653
3654TPM_CC_SequenceComplete
3655
36560x0000013E
3657
3658O
3659
3660TPM_CC_SetAlgorithmSet
3661
36620x0000013F
3663
3664Y
3665
3666TPM_CC_SetCommandCodeAuditStatus
3667
36680x00000140
3669
3670Y
3671
3672TPM_CC_FieldUpgradeData
3673
36740x00000141
3675
3676O
3677
3678TPM_CC_IncrementalSelfTest
3679
36800x00000142
3681
3682O
3683
3684TPM_CC_SelfTest
3685
36860x00000143
3687
3688O
3689
3690TPM_CC_Startup
3691
36920x00000144
3693
3694Y
3695
3696TPM_CC_Shutdown
3697
36980x00000145
3699
3700Y
3701
3702TPM_CC_StirRandom
3703
37040x00000146
3705
3706Y
3707
3708TPM_CC_ActivateCredential
3709
37100x00000147
3711
3712TPM_CC_Certify
3713
37140x00000148
3715
3716TPM_CC_PolicyNV
3717
37180x00000149
3719
3720TPM_CC_CertifyCreation
3721
37220x0000014A
3723
3724TPM_CC_Duplicate
3725
37260x0000014B
3727
3728TPM_CC_GetTime
3729
37300x0000014C
3731
3732O
3733
37342
3735
3736TPM_CC_GetSessionAuditDigest
3737
37380x0000014D
3739
3740O
3741
37422
3743
3744TPM_CC_NV_Read
3745
37460x0000014E
3747
3748TPM_CC_NV_ReadLock
3749
37500x0000014F
3751
3752TPM_CC_ObjectChangeAuth
3753
37540x00000150
3755
37562
3757
3758TPM_CC_PolicySecret
3759
37600x00000151
3761
37622
3763
3764TPM_CC_Rewrap
3765
37660x00000152
3767
37682
3769
3770Family “2.0”
3771Level 00 Revision 00.99
3772
3773Encrypt
3774
3775Name
3776
3777NV Write
3778
3779Encrypted
3780
3781Part 2: Structures
3782
3783Physical Presence
3784
3785Trusted Platform Module Library
3786
37872
3788
3789PCR
3790PCR
3791
37922
3793
37942
3795
37962
3797
37982
37992
3800
3801O
3802
38032
3804
38052
3806
38072
3808
38092
3810O
3811
3812Comments
3813
3814Policy
3815
38162
3817
38182
3819
38202
3821
38222
3823
38242
3825O
3826
3827Published
3828Copyright © TCG 2006-2013
3829
38302
3831Policy
38322
3833
3834Page 25
3835October 31, 2013
3836
3837Trusted Platform Module Library
3838
3839Command
3840Code
3841
3842Encrypt
3843
3844TPM_CC_Create
3845
38460x00000153
3847
38482
3849
38502
3851
3852TPM_CC_ECDH_ZGen
3853
38540x00000154
3855
38562
3857
38582
3859
3860TPM_CC_HMAC
3861
38620x00000155
3863
38642
3865
38662
3867
3868TPM_CC_Import
3869
38700x00000156
3871
38722
3873
38742
3875
3876TPM_CC_Load
3877
38780x00000157
3879
38802
3881
38822
3883
3884TPM_CC_Quote
3885
38860x00000158
3887
38882
3889
38902
3891
3892TPM_CC_RSA_Decrypt
3893
38940x00000159
3895
3896TPM_CC_HMAC_Start
3897
38980x0000015B
3899
39002
3901
3902TPM_CC_SequenceUpdate
3903
39040x0000015C
3905
39062
3907
3908TPM_CC_Sign
3909
39100x0000015D
3911
39122
3913
3914TPM_CC_Unseal
3915
39160x0000015E
3917
3918TPM_CC_PolicySigned
3919
39200x00000160
3921
3922TPM_CC_ContextLoad
3923
39240x00000161
3925
3926O
3927
3928Context
3929
3930TPM_CC_ContextSave
3931
39320x00000162
3933
3934O
3935
3936Context
3937
3938TPM_CC_ECDH_KeyGen
3939
39400x00000163
3941
39422
3943
3944TPM_CC_EncryptDecrypt
3945
39460x00000164
3947
39482
3949
3950TPM_CC_FlushContext
3951
39520x00000165
3953
3954TPM_CC_LoadExternal
3955
39560x00000167
3957
39582
3959
39602
3961
3962TPM_CC_MakeCredential
3963
39640x00000168
3965
39662
3967
39682
3969
3970TPM_CC_NV_ReadPublic
3971
39720x00000169
3973
3974TPM_CC_PolicyAuthorize
3975
39760x0000016A
3977
3978TPM_CC_PolicyAuthValue
3979
39800x0000016B
3981
3982Policy
3983
3984TPM_CC_PolicyCommandCode
3985
39860x0000016C
3987
3988Policy
3989
3990TPM_CC_PolicyCounterTimer
3991
39920x0000016D
3993
39942
3995
3996Policy
3997
3998TPM_CC_PolicyCpHash
3999
40000x0000016E
4001
40022
4003
4004Policy
4005
4006TPM_CC_PolicyLocality
4007
40080x0000016F
4009
4010TPM_CC_PolicyNameHash
4011
40120x00000170
4013
4014TPM_CC_PolicyOR
4015
40160x00000171
4017
4018TPM_CC_PolicyTicket
4019
40200x00000172
4021
4022TPM_CC_ReadPublic
4023
40240x00000173
4025
4026Page 26
4027October 31, 2013
4028
4029NV Write
4030
4031Name
4032
4033Encrypted
4034
4035Physical Presence
4036
4037Part 2: Structures
4038
4039O
4040
4041Comments
4042
40432
40442
4045
40462
40472
4048
4049Policy
4050
4051O
4052
4053Context
4054
4055NV
40562
4057
4058Policy
4059
4060Policy
40612
4062
4063Policy
4064Policy
4065
40662
4067
4068Published
4069Copyright © TCG 2006-2013
4070
4071Policy
40722
4073
4074Family “2.0”
4075Level 00 Revision 00.99
4076
4077Encrypt
4078
40792
4080
4081NV Write
4082
4083Encrypted
4084
4085Part 2: Structures
4086
4087Physical Presence
4088
4089Trusted Platform Module Library
4090
40912
4092
40932
4094
40952
4096
4097Name
4098
4099Command
4100Code
4101
4102TPM_CC_RSA_Encrypt
4103
41040x00000174
4105
4106TPM_CC_StartAuthSession
4107
41080x00000176
4109
4110TPM_CC_VerifySignature
4111
41120x00000177
4113
4114TPM_CC_ECC_Parameters
4115
41160x00000178
4117
4118TPM_CC_FirmwareRead
4119
41200x00000179
4121
4122TPM_CC_GetCapability
4123
41240x0000017A
4125
4126TPM_CC_GetRandom
4127
41280x0000017B
4129
4130TPM_CC_GetTestResult
4131
41320x0000017C
4133
4134TPM_CC_Hash
4135
41360x0000017D
4137
4138TPM_CC_PCR_Read
4139
41400x0000017E
4141
4142PCR
4143
4144TPM_CC_PolicyPCR
4145
41460x0000017F
4147
4148Policy
4149
4150TPM_CC_PolicyRestart
4151
41520x00000180
4153
4154TPM_CC_ReadClock
4155
41560x00000181
4157
4158TPM_CC_PCR_Extend
4159
41600x00000182
4161
4162O
4163
41642
4165
4166TPM_CC_PCR_SetAuthValue
4167
41680x00000183
4169
4170N
4171
41722
4173
4174TPM_CC_NV_Certify
4175
41760x00000184
4177
4178O
4179
4180TPM_CC_EventSequenceComplete
4181
41820x00000185
4183
4184O
4185
4186TPM_CC_HashSequenceStart
4187
41880x00000186
4189
4190TPM_CC_PolicyPhysicalPresence
4191
41920x00000187
4193
4194Policy
4195
4196TPM_CC_PolicyDuplicationSelect
4197
41980x00000188
4199
4200Policy
4201
4202TPM_CC_PolicyGetDigest
4203
42040x00000189
4205
4206Policy
4207
4208TPM_CC_TestParms
4209
42100x0000018A
4211
4212TPM_CC_Commit
4213
42140x0000018B
4215
4216TPM_CC_PolicyPassword
4217
42180x0000018C
4219
4220TPM_CC_ZGen_2Phase
4221
42220x0000018D
4223
4224TPM_CC_EC_Ephemeral
4225
42260x0000018E
4227
4228TPM_CC_PolicyNvWritten
4229
42300x0000018F
4231
4232Policy
4233
4234TPM_CC_LAST
4235
42360x0000018F
4237
4238Compile variable. May increase
4239based on implementation.
4240
4241O
4242
4243Comments
4244
42452
4246
42472
4248
42492
4250
4251O
4252
42532
4254
42552
4256
42572
4258Policy
4259
42602
4261
42622
4263
4264NOTE
4265
4266#TPM_RC_COMMAND_CODE
4267
4268Family “2.0”
4269Level 00 Revision 00.99
4270
4271Published
4272Copyright © TCG 2006-2013
4273
4274This is not a FMT1 code
4275and a parameter indicator
4276value may not be added to
4277
4278Page 27
4279October 31, 2013
4280
4281Encrypt
4282
4283Encrypted
4284
4285Command
4286Code
4287
4288Name
4289
4290Physical Presence
4291
4292Trusted Platform Module Library
4293
4294NV Write
4295
4296Part 2: Structures
4297
4298Comments
4299this value.
4300
43016.6
4302
4303TPM_RC (Response Codes)
4304
43056.6.1
4306
4307Description
4308
4309Each return from the TPM has a 32-bit response code. The TPM will always set the upper 20 bits (31:12)
4310of the response code to 0 00 0016 and the low-order 12 bits (11:00) will contain the response code.
4311When a command succeeds, the TPM shall return TPM_RC_SUCCESS (0 0016) and will update any
4312authorization-session nonce associated with the command.
4313When a command fails to complete for any reason, the TPM shall return
43144315
4316a TPM_ST (UINT16) with a value of TPM_TAG_RSP_COMMAND or TPM_ST_NO_SESSIONS,
4317followed by
4318
43194320
4321a UINT32 (responseSize) with a value of 10, followed by
4322
43234324
4325a UINT32 containing a response code with a value other than TPM_RC_SUCCESS.
4326
4327Commands defined in this specification will use a tag of either TPM_ST_NO_SESSIONS or
4328TPM_ST_SESSIONS. Error responses will use a tag value of TPM_ST_NO_SESSIONS and the
4329response code will be as defined in this specification. Commands that use tags defined in the TPM 1.2
4330specification will use TPM_TAG_RSP_COMMAND in an error and a response code defined in TPM 1.2.
4331If the tag of the command is not a recognized command tag, the TPM error response will differ depending
4332on TPM 1.2 compatibility. If the TPM supports 1.2 compatibility, the TPM shall return a tag of
4333TPM_TAG_RSP_COMMAND and an appropriate TPM 1.2 response code (TPM_BADTAG =
433400 00 00 1E16). If the TPM does not have compatibility with TPM 1.2, the TPM shall return
4335TPM_ST_NO_SESSION and a response code of TPM_RC_TAG.
4336When a command fails, the TPM shall not update the authorization-session nonces associated with the
4337command and will not close the authorization sessions used by the command. Audit digests will not be
4338updated on an error. Unless noted in the command actions, a command that returns an error shall leave
4339the state of the TPM as if the command had not been attempted. The exception to this principle is that a
4340failure due to an authorization failure may update the dictionary-attack protection values.
4341
4342Page 28
4343October 31, 2013
4344
4345Published
4346Copyright © TCG 2006-2013
4347
4348Family “2.0”
4349Level 00 Revision 00.99
4350
4351Trusted Platform Module Library
43526.6.2
4353
4354Part 2: Structures
4355
4356Response Code Formats
4357
4358The response codes for this specification are defined such that there is no overlap between the response
4359codes used for this specification and those assigned in previous TPM specifications.
4360The formats defined in this clause only apply when the tag for the response is TPM_ST_NO_SESSIONS.
4361The response codes use two different format groups. One group contains the TPM 1.2 compatible
4362response codes and the response codes for this specification that are not related to command
4363parameters. The second group contains the errors that may be associated with a command parameter,
4364handle, or session.
4365Figure 2 shows the format for the response codes when bit 7 is zero.
43661
43671
4368
43691
43700
4371
43720
43739
4374
43750
43768
4377
43780
43797
4380
4381S
4382
4383bit
4384
4385T
4386
4387r
4388
4389V
4390
43910
43926
4393
43940
43955
4396
4397F
4398
43990
44004
4401
44020
44033
4404
44050
44062
4407
44080
44091
4410
44110
44120
4413
4414E
4415
4416Figure 2 — Format-Zero Response Codes
4417
4418Family “2.0”
4419Level 00 Revision 00.99
4420
4421Published
4422Copyright © TCG 2006-2013
4423
4424Page 29
4425October 31, 2013
4426
4427Part 2: Structures
4428
4429Trusted Platform Module Library
4430
4431The field definitions are:
4432Table 12 — Format-Zero Response Codes
4433Bit
4434
4435Name
4436
4437Definition
4438
443906:00
4440
4441E
4442
4443the error number
4444The interpretation of this field is dependent on the setting of the G and S fields.
4445
444607
4447
4448F
4449
4450format selector
4451CLEAR when the format is as defined in this Table 12 or when the response code is
4452TPM_RC_BAD_TAG.
4453
445408
4455
4456V
4457
4458version
4459SET (1): The error number is defined in this specification and is returned when the response tag
4460is TPM_ST_NO_SESSIONS.
4461CLEAR (0): The error number is defined by a previous TPM specification. The error number is
4462returned when the response tag is TPM_TAG_RSP_COMMAND.
4463NOTE
4464
446509
4466
4467In any error number returned by a TPM, the F (bit 7) and V (bit 8) attributes shall be CLEAR
4468when the response tag is TPM_TAG_RSP_COMMAND value used in TPM 1.2.
4469
4470Reserved shall be zero.
4471
447210
4473
4474T
4475
4476TCG/Vendor indicator
4477SET (1): The response code is defined by the TPM vendor.
4478CLEAR (0): The response code is defined by the TCG (a value in this specification).
4479NOTE
4480
448111
4482
4483S
4484
4485This attribute does not indicate a vendor-specific code unless the F attribute (bit[07]) is CLEAR.
4486
4487severity
4488SET (1): The response code is a warning and the command was not necessarily in error. This
4489command indicates that the TPM is busy or that the resources of the TPM have to be adjusted in
4490order to allow the command to execute.
4491CLEAR (0): The response code indicates that the command had an error that would prevent it
4492from running.
4493
4494When the format bit (bit 7) is SET, then the error occurred during the unmarshaling or validation of an
4495input parameter to the TPM. Figure 3 shows the format for the response codes when bit 7 is one.
4496bit
4497
44981
44991
4500
45011
45020
4503
45040
45059
4506
4507N
4508
45090
45108
4511
45120
45137
4514
45150
45166
4517
45181
4519
45200
45215
4522
4523P
4524
45250
45264
4527
45280
45293
4530
45310
45322
4533
45340
45351
4536
45370
45380
4539
4540E
4541
4542Figure 3 — Format-One Response Codes
4543There are 64 errors with this format. The errors can be associated with a parameter, handle, or session.
4544The error number for this format is in bits[05:00]. When an error is associated with a parameter, 0 40 16 is
4545added and N is set to the parameter number.
4546For an error associated with a handle, a parameter number (1 to 7) is added to the N field. For an error
4547associated with a session, a value of 8 plus the session number (1 to 7) is added to the N field. In other
4548words, if P is clear, then a value of 0 to 7 in the N field will indicate a handle error, and a value of 8 – 15
4549will indicate a session error.
4550NOTE
4551
4552If an implementation is not able to designate the handle, session, or parameter in error, then P and N will
4553be zero.
4554
4555Page 30
4556October 31, 2013
4557
4558Published
4559Copyright © TCG 2006-2013
4560
4561Family “2.0”
4562Level 00 Revision 00.99
4563
4564Trusted Platform Module Library
4565
4566Part 2: Structures
4567
4568The field definitions are:
4569Table 13 — Format-One Response Codes
4570Bit
4571
4572Name Definition
4573
457405:00
4575
4576E
4577
4578the error number
4579The error number is independent of the other settings.
4580
458106
4582
4583P
4584
4585SET (1): The error is associated with a parameter.
4586CLEAR (0): The error is associated with a handle or a session.
4587
458807
4589
4590F
4591
4592the response code format selector
4593This field shall be SET for the format in this table.
4594
459511:08
4596
4597N
4598
4599the number of the handle, session, or parameter in error
4600If P is SET, then this field is the parameter in error. If P is CLEAR, then this field indicates the
4601handle or session in error. Handles use values of N between 0000 2 and 01112. Sessions use
4602values between 10002 and 11112.
4603
4604The groupings of response codes are determined by bits 08, 07, and 06 of the response code as
4605summarized in Table 14.
4606Table 14 — Response Code Groupings
4607Bit
46080
46098
4610
46110
46127
4613
46140
46156
4616
4617Definition
4618
46190
4620
46210
4622
4623x
4624
4625a response code defined by TPM 1.2
4626NOTE
4627
4628An “x” in a column indicates that this may be either 0 or 1 and not affect the grouping of the response
4629code.
4630
46311
4632
46330
4634
4635x
4636
4637a response code defined by this specification with no handle, session, or parameter number modifier
4638
4639x
4640
46411
4642
46430
4644
4645a response code defined by this specification with either a handle or session number modifier
4646
4647x
4648
46491
4650
46511
4652
4653a response code defined by this specification with a parameter number modifier
4654
4655Family “2.0”
4656Level 00 Revision 00.99
4657
4658Published
4659Copyright © TCG 2006-2013
4660
4661Page 31
4662October 31, 2013
4663
4664Part 2: Structures
46656.6.3
4666
4667Trusted Platform Module Library
4668
4669TPM_RC Values
4670
4671In general, response codes defined in Part 2 will be unmarshaling errors and will have the F (format) bit
4672SET. Codes that are unique to Part 3 will have the F bit CLEAR but the V (version) attribute will be SET to
4673indicate that it is a TPM 2.0 response code.
4674NOTE
4675
4676The constant RC_VER1 is used to indicate that the V attribute is SET and the constant RC_ FMT1 is used
4677to indicate that the F attribute is SET and that the return code is variable based on handle, session, and
4678parameter modifiers.
4679
4680Table 15 — Definition of (UINT32) TPM_RC Constants (Actions) <OUT>
4681Name
4682
4683Value
4684
4685Description
4686
4687TPM_RC_SUCCESS
4688
46890x000
4690
4691TPM_RC_BAD_TAG
4692
46930x01E
4694
4695defined for compatibility with TPM 1.2
4696
4697RC_VER1
4698
46990x100
4700
4701set for all format 0 response codes
4702
4703TPM_RC_INITIALIZE
4704
4705RC_VER1 + 0x000
4706
4707TPM not initialized
4708commands not being accepted because of a TPM
4709failure
4710
4711TPM_RC_FAILURE
4712
4713RC_VER1 + 0x001
4714
4715NOTE
4716
4717TPM_RC_SEQUENCE
4718
4719RC_VER1 + 0x003
4720
4721improper use of a sequence handle
4722
4723TPM_RC_PRIVATE
4724
4725RC_VER1 + 0x00B
4726
4727TPM_RC_HMAC
4728
4729RC_VER1 + 0x019
4730
4731TPM_RC_DISABLED
4732
4733RC_VER1 + 0x020
4734
4735TPM_RC_EXCLUSIVE
4736
4737RC_VER1 + 0x021
4738
4739command failed because audit sequence required
4740exclusivity
4741
4742TPM_RC_AUTH_TYPE
4743
4744RC_VER1 + 0x024
4745
4746authorization handle is not correct for command
4747
4748TPM_RC_AUTH_MISSING
4749
4750RC_VER1 + 0x025
4751
4752command requires an authorization session for
4753handle and it is not present.
4754
4755TPM_RC_POLICY
4756
4757RC_VER1 + 0x026
4758
4759policy Failure In Math Operation or an invalid
4760authPolicy value
4761
4762TPM_RC_PCR
4763
4764RC_VER1 + 0x027
4765
4766PCR check fail
4767
4768TPM_RC_PCR_CHANGED
4769
4770RC_VER1 + 0x028
4771
4772PCR have changed since checked.
4773
4774TPM_RC_UPGRADE
4775
4776RC_VER1 + 0x02D
4777
4778for
4779all
4780commands
4781other
4782than
4783TPM2_FieldUpgradeData(), this code indicates
4784that the TPM is in field upgrade mode; for
4785TPM2_FieldUpgradeData(), this code indicates
4786that the TPM is not in field upgrade mode
4787
4788TPM_RC_TOO_MANY_CONTEXTS
4789
4790RC_VER1 + 0x02E
4791
4792context ID counter is at maximum.
4793
4794TPM_RC_AUTH_UNAVAILABLE
4795
4796RC_VER1 + 0x02F
4797
4798authValue or authPolicy is not available for
4799selected entity.
4800
4801TPM_RC_REBOOT
4802
4803RC_VER1 + 0x030
4804
4805a _TPM_Init and Startup(CLEAR) is required
4806before the TPM can resume operation.
4807
4808TPM_RC_UNBALANCED
4809
4810RC_VER1 + 0x031
4811
4812the protection algorithms (hash and symmetric) are
4813not reasonably balanced. The digest size of the
4814hash must be larger than the key size of the
4815symmetric algorithm.
4816
4817Page 32
4818October 31, 2013
4819
4820This
4821may
4822be
4823returned
4824by
4825TPM2_GetTestResult() as the testResult
4826parameter.
4827
4828Published
4829Copyright © TCG 2006-2013
4830
4831Family “2.0”
4832Level 00 Revision 00.99
4833
4834Trusted Platform Module Library
4835Name
4836
4837Part 2: Structures
4838Value
4839
4840Description
4841
4842TPM_RC_COMMAND_SIZE
4843
4844RC_VER1 + 0x042
4845
4846command commandSize value is inconsistent with
4847contents of the command buffer; either the size is
4848not the same as the octets loaded by the hardware
4849interface layer or the value is not large enough to
4850hold a command header
4851
4852TPM_RC_COMMAND_CODE
4853
4854RC_VER1 + 0x043
4855
4856command code not supported
4857
4858TPM_RC_AUTHSIZE
4859
4860RC_VER1 + 0x044
4861
4862the value of authorizationSize is out of range or the
4863number of octets in the Authorization Area is
4864greater than required
4865
4866TPM_RC_AUTH_CONTEXT
4867
4868RC_VER1 + 0x045
4869
4870use of an authorization session with a context
4871command
4872
4873TPM_RC_NV_RANGE
4874
4875RC_VER1 + 0x046
4876
4877NV offset+size is out of range.
4878
4879TPM_RC_NV_SIZE
4880
4881RC_VER1 + 0x047
4882
4883Requested allocation size is larger than allowed.
4884
4885TPM_RC_NV_LOCKED
4886
4887RC_VER1 + 0x048
4888
4889NV access locked.
4890
4891TPM_RC_NV_AUTHORIZATION
4892
4893RC_VER1 + 0x049
4894
4895NV access authorization fails in command actions
4896(this failure does not affect lockout.action)
4897
4898TPM_RC_NV_UNINITIALIZED
4899
4900RC_VER1 + 0x04A
4901
4902an NV Index is used before being initialized or the
4903state saved by TPM2_Shutdown(STATE) could not
4904be restored
4905
4906TPM_RC_NV_SPACE
4907
4908RC_VER1 + 0x04B
4909
4910insufficient space for NV allocation
4911
4912TPM_RC_NV_DEFINED
4913
4914RC_VER1 + 0x04C
4915
4916NV Index or persistend object already defined
4917
4918TPM_RC_BAD_CONTEXT
4919
4920RC_VER1 + 0x050
4921
4922context in TPM2_ContextLoad() is not valid
4923
4924TPM_RC_CPHASH
4925
4926RC_VER1 + 0x051
4927
4928cpHash value already set or not correct for use
4929
4930TPM_RC_PARENT
4931
4932RC_VER1 + 0x052
4933
4934handle for parent is not a valid parent
4935
4936TPM_RC_NEEDS_TEST
4937
4938RC_VER1 + 0x053
4939
4940some function needs testing.
4941
4942TPM_RC_NO_RESULT
4943
4944RC_VER1 + 0x054
4945
4946returned when an internal function cannot process
4947a request due to an unspecified problem. This
4948code is usually related to invalid parameters that
4949are not properly filtered by the input unmarshaling
4950code.
4951
4952TPM_RC_SENSITIVE
4953
4954RC_VER1 + 0x055
4955
4956the sensitive area did not unmarshal correctly after
4957decryption – this code is used in lieu of the other
4958unmarshaling errors so that an attacker cannot
4959determine where the unmarshaling error occurred
4960
4961RC_MAX_FM0
4962
4963RC_VER1 + 0x07F
4964
4965largest version 1 code that is not a warning
4966
4967New Subsection
4968
4969RC_FMT1
4970
49710x080
4972
4973This bit is SET in all format 1 response codes
4974The codes in this group may have a value added to
4975them to indicate the handle, session, or parameter
4976to which they apply.
4977
4978TPM_RC_ASYMMETRIC
4979
4980RC_FMT1 + 0x001
4981
4982asymmetric algorithm not supported or not correct
4983
4984TPM_RC_ATTRIBUTES
4985
4986RC_FMT1 + 0x002
4987
4988inconsistent attributes
4989
4990TPM_RC_HASH
4991
4992RC_FMT1 + 0x003
4993
4994hash algrithm not supported or not appropriate
4995
4996TPM_RC_VALUE
4997
4998RC_FMT1 + 0x004
4999
5000value is out of range or is not correct for the
5001context
5002
5003TPM_RC_HIERARCHY
5004
5005RC_FMT1 + 0x005
5006
5007hierarchy is not enabled or is not correct for the
5008use
5009
5010Family “2.0”
5011Level 00 Revision 00.99
5012
5013Published
5014Copyright © TCG 2006-2013
5015
5016Page 33
5017October 31, 2013
5018
5019Part 2: Structures
5020
5021Trusted Platform Module Library
5022
5023Name
5024
5025Value
5026
5027Description
5028
5029TPM_RC_KEY_SIZE
5030
5031RC_FMT1 + 0x007
5032
5033key size is not supported
5034
5035TPM_RC_MGF
5036
5037RC_FMT1 + 0x008
5038
5039mask generation function not supported
5040
5041TPM_RC_MODE
5042
5043RC_FMT1 + 0x009
5044
5045mode of operation not supported
5046
5047TPM_RC_TYPE
5048
5049RC_FMT1 + 0x00A
5050
5051the type of the value is not appropriate for the use
5052
5053TPM_RC_HANDLE
5054
5055RC_FMT1 + 0x00B
5056
5057the handle is not correct for the use
5058
5059TPM_RC_KDF
5060
5061RC_FMT1 + 0x00C
5062
5063unsupported key derivation function or function not
5064appropriate for use
5065
5066TPM_RC_RANGE
5067
5068RC_FMT1 + 0x00D
5069
5070value was out of allowed range.
5071
5072TPM_RC_AUTH_FAIL
5073
5074RC_FMT1 + 0x00E
5075
5076the authorization HMAC check failed and DA
5077counter incremented
5078
5079TPM_RC_NONCE
5080
5081RC_FMT1 + 0x00F
5082
5083invalid nonce size
5084
5085TPM_RC_PP
5086
5087RC_FMT1 + 0x010
5088
5089authorization requires assertion of PP
5090
5091TPM_RC_SCHEME
5092
5093RC_FMT1 + 0x012
5094
5095unsupported or incompatible scheme
5096
5097TPM_RC_SIZE
5098
5099RC_FMT1 + 0x015
5100
5101structure is the wrong size
5102
5103TPM_RC_SYMMETRIC
5104
5105RC_FMT1 + 0x016
5106
5107unsupported symmetric algorithm or key size, or
5108not appropriate for instance
5109
5110TPM_RC_TAG
5111
5112RC_FMT1 + 0x017
5113
5114incorrect structure tag
5115
5116TPM_RC_SELECTOR
5117
5118RC_FMT1 + 0x018
5119
5120union selector is incorrect
5121
5122TPM_RC_INSUFFICIENT
5123
5124RC_FMT1 + 0x01A
5125
5126the TPM was unable to unmarshal a value
5127because there were not enough octets in the input
5128buffer
5129
5130TPM_RC_SIGNATURE
5131
5132RC_FMT1 + 0x01B
5133
5134the signature is not valid
5135
5136TPM_RC_KEY
5137
5138RC_FMT1 + 0x01C
5139
5140key fields are not compatible with the selected use
5141
5142TPM_RC_POLICY_FAIL
5143
5144RC_FMT1 + 0x01D
5145
5146a policy check failed
5147
5148TPM_RC_INTEGRITY
5149
5150RC_FMT1 + 0x01F
5151
5152integrity check failed
5153
5154TPM_RC_TICKET
5155
5156RC_FMT1 + 0x020
5157
5158invalid ticket
5159
5160TPM_RC_RESERVED_BITS
5161
5162RC_FMT1 + 0x021
5163
5164reserved bits not set to zero as required
5165
5166TPM_RC_BAD_AUTH
5167
5168RC_FMT1 + 0x022
5169
5170authroization failure without DA implications
5171
5172TPM_RC_EXPIRED
5173
5174RC_FMT1 + 0x023
5175
5176the policy has expired
5177
5178TPM_RC_POLICY_CC
5179
5180RC_FMT1 + 0x024
5181
5182the commandCode in the policy is not the
5183commandCode of the command or the command
5184code in a policy command references a command
5185that is not implemented
5186
5187TPM_RC_BINDING
5188
5189RC_FMT1 + 0x025
5190
5191public and sensitive portions of an object are not
5192cryptographically bound
5193
5194TPM_RC_CURVE
5195
5196RC_FMT1 + 0x026
5197
5198curve not supported
5199
5200TPM_RC_ECC_POINT
5201
5202RC_FMT1 + 0x027
5203
5204point is not on the required curve.
5205
5206New Subsection
5207RC_WARN
5208
52090x900
5210
5211set for warning response codes
5212
5213TPM_RC_CONTEXT_GAP
5214
5215RC_WARN + 0x001
5216
5217gap for context ID is too large
5218
5219TPM_RC_OBJECT_MEMORY
5220
5221RC_WARN + 0x002
5222
5223out of memory for object contexts
5224
5225Page 34
5226October 31, 2013
5227
5228Published
5229Copyright © TCG 2006-2013
5230
5231Family “2.0”
5232Level 00 Revision 00.99
5233
5234Trusted Platform Module Library
5235
5236Part 2: Structures
5237
5238Name
5239
5240Value
5241
5242Description
5243
5244TPM_RC_SESSION_MEMORY
5245
5246RC_WARN + 0x003
5247
5248out of memory for session contexts
5249
5250TPM_RC_MEMORY
5251
5252RC_WARN + 0x004
5253
5254out of shared object/session memory or need
5255space for internal operations
5256
5257TPM_RC_SESSION_HANDLES
5258
5259RC_WARN + 0x005
5260
5261out of session handles – a session must be flushed
5262before a new session may be created
5263out of object handles – the handle space for
5264objects is depleted and a reboot is required
5265NOTE
5266
5267This cannot occur
5268implementation.
5269
5270NOTE
5271
5272There is no reason why an implementation
5273would implement a design that would deplete
5274handle space. Platform specifications are
5275encouraged to forbid it.
5276
5277TPM_RC_OBJECT_HANDLES
5278
5279RC_WARN + 0x006
5280
5281TPM_RC_LOCALITY
5282
5283RC_WARN + 0x007
5284
5285TPM_RC_YIELDED
5286
5287RC_WARN + 0x008
5288
5289on
5290
5291the
5292
5293reference
5294
5295bad locality
5296the TPM has suspended operation on the
5297command; forward progress was made and the
5298command may be retried.
5299See Part 1, “Multi-tasking.”
5300NOTE
5301
5302This cannot occur
5303implementation.
5304
5305on
5306
5307the
5308
5309reference
5310
5311TPM_RC_CANCELED
5312
5313RC_WARN + 0x009
5314
5315the command was canceled
5316
5317TPM_RC_TESTING
5318
5319RC_WARN + 0x00A
5320
5321TPM is performing self-tests
5322
5323TPM_RC_REFERENCE_H0
5324
5325RC_WARN + 0x010
5326
5327the 1 handle in the handle area references a
5328transient object or session that is not loaded
5329
5330TPM_RC_REFERENCE_H1
5331
5332RC_WARN + 0x011
5333
5334the 2 handle in the handle area references a
5335transient object or session that is not loaded
5336
5337TPM_RC_REFERENCE_H2
5338
5339RC_WARN + 0x012
5340
5341the 3 handle in the handle area references a
5342transient object or session that is not loaded
5343
5344TPM_RC_REFERENCE_H3
5345
5346RC_WARN + 0x013
5347
5348the 4 handle in the handle area references a
5349transient object or session that is not loaded
5350
5351TPM_RC_REFERENCE_H4
5352
5353RC_WARN + 0x014
5354
5355the 5 handle in the handle area references a
5356transient object or session that is not loaded
5357
5358TPM_RC_REFERENCE_H5
5359
5360RC_WARN + 0x015
5361
5362the 6 handle in the handle area references a
5363transient object or session that is not loaded
5364
5365TPM_RC_REFERENCE_H6
5366
5367RC_WARN + 0x016
5368
5369the 7 handle in the handle area references a
5370transient object or session that is not loaded
5371
5372TPM_RC_REFERENCE_S0
5373
5374RC_WARN + 0x018
5375
5376the 1 authorization session handle references a
5377session that is not loaded
5378
5379TPM_RC_REFERENCE_S1
5380
5381RC_WARN + 0x019
5382
5383the 2 authorization session handle references a
5384session that is not loaded
5385
5386TPM_RC_REFERENCE_S2
5387
5388RC_WARN + 0x01A
5389
5390the 3 authorization session handle references a
5391session that is not loaded
5392
5393TPM_RC_REFERENCE_S3
5394
5395RC_WARN + 0x01B
5396
5397the 4th authorization session handle references a
5398session that is not loaded
5399
5400TPM_RC_REFERENCE_S4
5401
5402RC_WARN + 0x01C
5403
5404the 5 session handle references a session that is
5405not loaded
5406
5407TPM_RC_REFERENCE_S5
5408
5409RC_WARN + 0x01D
5410
5411the 6 session handle references a session that is
5412not loaded
5413
5414st
5415
5416nd
5417
5418rd
5419
5420th
5421
5422th
5423
5424th
5425
5426th
5427
5428st
5429
5430nd
5431
5432rd
5433
5434th
5435
5436th
5437
5438Family “2.0”
5439Level 00 Revision 00.99
5440
5441Published
5442Copyright © TCG 2006-2013
5443
5444Page 35
5445October 31, 2013
5446
5447Part 2: Structures
5448
5449Trusted Platform Module Library
5450
5451Name
5452
5453Value
5454
5455Description
5456
5457TPM_RC_REFERENCE_S6
5458
5459RC_WARN + 0x01E
5460
5461the 7 authorization session handle references a
5462session that is not loaded
5463
5464TPM_RC_NV_RATE
5465
5466RC_WARN + 0x020
5467
5468the TPM is rate-limiting accesses to prevent
5469wearout of NV
5470
5471TPM_RC_LOCKOUT
5472
5473RC_WARN + 0x021
5474
5475authorizations for objects subject to DA protection
5476are not allowed at this time because the TPM is in
5477DA lockout mode
5478
5479TPM_RC_RETRY
5480
5481RC_WARN + 0x022
5482
5483the TPM was not able to start the command
5484
5485TPM_RC_NV_UNAVAILABLE
5486
5487RC_WARN + 0x023
5488
5489the command may require writing of NV and NV is
5490not current accessible
5491
5492TPM_RC_NOT_USED
5493
5494RC_WARN + 0x7F
5495
5496this value is reserved and shall not be returned by
5497the TPM
5498
5499th
5500
5501Additional Defines
5502TPM_RC_H
5503
55040x000
5505
5506add to a handle-related error
5507
5508TPM_RC_P
5509
55100x040
5511
5512add to a parameter-related error
5513
5514TPM_RC_S
5515
55160x800
5517
5518add to a session-related error
5519
5520TPM_RC_1
5521
55220x100
5523
5524add to a parameter-, handle-, or session-related
5525error
5526
5527TPM_RC_2
5528
55290x200
5530
5531add to a parameter-, handle-, or session-related
5532error
5533
5534TPM_RC_3
5535
55360x300
5537
5538add to a parameter-, handle-, or session-related
5539error
5540
5541TPM_RC_4
5542
55430x400
5544
5545add to a parameter-, handle-, or session-related
5546error
5547
5548TPM_RC_5
5549
55500x500
5551
5552add to a parameter-, handle-, or session-related
5553error
5554
5555TPM_RC_6
5556
55570x600
5558
5559add to a parameter-, handle-, or session-related
5560error
5561
5562TPM_RC_7
5563
55640x700
5565
5566add to a parameter-, handle-, or session-related
5567error
5568
5569TPM_RC_8
5570
55710x800
5572
5573add to a parameter-related error
5574
5575TPM_RC_9
5576
55770x900
5578
5579add to a parameter-related error
5580
5581TPM_RC_A
5582
55830xA00
5584
5585add to a parameter-related error
5586
5587TPM_RC_B
5588
55890xB00
5590
5591add to a parameter-related error
5592
5593TPM_RC_C
5594
55950xC00
5596
5597add to a parameter-related error
5598
5599TPM_RC_D
5600
56010xD00
5602
5603add to a parameter-related error
5604
5605TPM_RC_E
5606
56070xE00
5608
5609add to a parameter-related error
5610
5611TPM_RC_F
5612
56130xF00
5614
5615add to a parameter-related error
5616
5617TPM_RC_N_MASK
5618
56190xF00
5620
5621number mask
5622
5623Page 36
5624October 31, 2013
5625
5626Published
5627Copyright © TCG 2006-2013
5628
5629Family “2.0”
5630Level 00 Revision 00.99
5631
5632Trusted Platform Module Library
56336.7
5634
5635Part 2: Structures
5636
5637TPM_CLOCK_ADJUST
5638
5639A TPM_CLOCK_ADJUST value is used to change the rate at which the TPM internal oscillator is divided.
5640A change to the divider will change the rate at which Clock and Time change.
5641NOTE
5642
5643The recommended adjustments are approximately 1% for a course adjustment, 0.1% for a medium
5644adjustment, and the minimum possible on the implementation for the fine adjustment (e.g., one count of
5645the pre-scalar if possible).
5646
5647Table 16 — Definition of (INT8) TPM_CLOCK_ADJUST Constants <IN>
5648Name
5649
5650Value
5651
5652Comments
5653
5654TPM_CLOCK_COARSE_SLOWER
5655
5656-3
5657
5658Slow the Clock update rate by one coarse adjustment step.
5659
5660TPM_CLOCK_MEDIUM_SLOWER
5661
5662-2
5663
5664Slow the Clock update rate by one medium adjustment step.
5665
5666TPM_CLOCK_FINE_SLOWER
5667
5668-1
5669
5670Slow the Clock update rate by one fine adjustment step.
5671
5672TPM_CLOCK_NO_CHANGE
5673
56740
5675
5676No change to the Clock update rate.
5677
5678TPM_CLOCK_FINE_FASTER
5679
56801
5681
5682Speed the Clock update rate by one fine adjustment step.
5683
5684TPM_CLOCK_MEDIUM_FASTER
5685
56862
5687
5688Speed the Clock update rate by one medium adjustment step.
5689
5690TPM_CLOCK_COARSE_FASTER
5691
56923
5693
5694Speed the Clock update rate by one coarse adjustment step.
5695
5696#TPM_RC_VALUE
5697
56986.8
5699
5700TPM_EO (EA Arithmetic Operands)
5701Table 17 — Definition of (UINT16) TPM_EO Constants <IN/OUT>
5702
5703Operation Name
5704
5705Value
5706
5707Comments
5708
5709TPM_EO_EQ
5710
57110x0000
5712
5713A=B
5714
5715TPM_EO_NEQ
5716
57170x0001
5718
5719A≠B
5720
5721TPM_EO_SIGNED_GT
5722
57230x0002
5724
5725A > B signed
5726
5727TPM_EO_UNSIGNED_GT
5728
57290x0003
5730
5731A > B unsigned
5732
5733TPM_EO_SIGNED_LT
5734
57350x0004
5736
5737A < B signed
5738
5739TPM_EO_UNSIGNED_LT
5740
57410x0005
5742
5743A < B unsigned
5744
5745TPM_EO_SIGNED_GE
5746
57470x0006
5748
5749A ≥ B signed
5750
5751TPM_EO_UNSIGNED_GE
5752
57530x0007
5754
5755A ≥ B unsigned
5756
5757TPM_EO_SIGNED_LE
5758
57590x0008
5760
5761A ≤ B signed
5762
5763TPM_EO_UNSIGNED_LE
5764
57650x0009
5766
5767A ≤ B unsigned
5768
5769TPM_EO_BITSET
5770
57710x000A
5772
5773All bits SET in B are SET in A. ((A&B)=B)
5774
5775TPM_EO_BITCLEAR
5776
57770x000B
5778
5779All bits SET in B are CLEAR in A. ((A&B)=0)
5780
5781#TPM_RC_VALUE
5782
5783Family “2.0”
5784Level 00 Revision 00.99
5785
5786Response code returned when unmarshaling of this type fails
5787
5788Published
5789Copyright © TCG 2006-2013
5790
5791Page 37
5792October 31, 2013
5793
5794Part 2: Structures
5795
57966.9
5797
5798Trusted Platform Module Library
5799
5800TPM_ST (Structure Tags)
5801
5802Structure tags are used to disambiguate structures. They are 16-bit values with the most significant bit
5803SET so that they do not overlap TPM_ALG_ID values. A single exception is made for the value
5804associated with TPM_ST_RSP_COMMAND (0x00C4), which has the same value as the
5805TPM_TAG_RSP_COMMAND tag from earlier versions of this specification. This value is used when the
5806TPM is compatible with a previous TPM specification and the TPM cannot determine which family of
5807response code to return because the command tag is not valid.
5808Many of the structures defined in this document have parameters that are unions of other structures. That
5809is, a parameter may be one of several structures. The parameter will have a selector value that indicates
5810which of the options is actually present.
5811In order to allow the marshaling and unmarshaling code to determine which of the possible structures is
5812allowed, each selector will have a unique interface type and will constrain the number of possible tag
5813values.
5814Table 18 defines the structure tags values. The definition of many structures is context-sensitive using an
5815algorithm ID. In cases where an algorithm ID is not a meaningful way to designate the structure, the
5816values in this table are used.
5817Table 18 — Definition of (UINT16) TPM_ST Constants <IN/OUT, S>
5818Name
5819TPM_ST_RSP_COMMAND
5820
5821Value
5822
5823Comments
5824
58250x00C4
5826
5827
5828TPM_ST_NULL
5829
58300X8000
5831
5832no structure type specified
5833
5834TPM_ST_NO_SESSIONS
5835
58360x8001
5837
5838tag value for a command/response for a command
5839defined in this specification; indicating that the
5840command/response has no attached sessions and no
5841authorizationSize/parameterSize value is present
5842If the responseCode from the TPM is not
5843TPM_RC_SUCCESS, then the response tag shall
5844have this value.
5845
5846TPM_ST_SESSIONS
5847
58480x8002
5849
5850tag value for a command/response for a command
5851defined in this specification; indicating that the
5852command/response has one or more attached
5853sessions and the authorizationSize/parameterSize
5854field is present
5855
5856Page 38
5857October 31, 2013
5858
5859Published
5860Copyright © TCG 2006-2013
5861
5862Family “2.0”
5863Level 00 Revision 00.99
5864
5865Trusted Platform Module Library
5866Name
5867reserved
5868
5869Part 2: Structures
5870Value
5871
5872Comments
5873
58740x8003
5875
5876When used between application software and the TPM
5877resource manager, this tag indicates that the
5878command has no sessions and the handles are using
5879the Name format rather than the 32-bit handle format.
5880NOTE 1
5881
5882The response to application software will have a
5883tag of TPM_ST_NO_SESSIONS.
5884
5885Between the TRM and TPM, this tag would occur in a
5886response from a TPM that overlaps the tag parameter
5887of a request with the tag parameter of a response,
5888when the response has no associated sessions.
5889NOTE 2
5890
5891reserved
5892
58930x8004
5894
5895This tag is not used by all TPM or TRM
5896implementations.
5897
5898When used between application software and the TPM
5899resource manager, this tag indicates that the
5900command has sessions and the handles are using the
5901Name format rather than the 32-bit handle format.
5902NOTE 1
5903
5904If the command completes successfully, the
5905response to application software will have a tag
5906of TPM_ST_SESSIONS.
5907
5908Between the TRM and TPM, would occur in a
5909response from a TPM that overlaps the tag parameter
5910of a request with the tag parameter of a response,
5911when the response has authorization sessions.
5912NOTE 2
5913
5914This tag is not used by all TPM or TRM
5915implementations.
5916
5917TPM_ST_ATTEST_NV
5918
59190x8014
5920
5921tag for an attestation structure
5922
5923TPM_ST_ATTEST_COMMAND_AUDIT
5924
59250x8015
5926
5927tag for an attestation structure
5928
5929TPM_ST_ATTEST_SESSION_AUDIT
5930
59310x8016
5932
5933tag for an attestation structure
5934
5935TPM_ST_ATTEST_CERTIFY
5936
59370x8017
5938
5939tag for an attestation structure
5940
5941TPM_ST_ATTEST_QUOTE
5942
59430x8018
5944
5945tag for an attestation structure
5946
5947TPM_ST_ATTEST_TIME
5948
59490x8019
5950
5951tag for an attestation structure
5952
5953TPM_ST_ATTEST_CREATION
5954
59550x801A
5956
5957tag for an attestation structure
5958
5959reserved
5960
59610x801B
5962
5963do not use
5964NOTE
5965
5966This
5967was
5968previously
5969assigned
5970to
5971TPM_ST_ATTEST_NV. The tag is changed
5972because the structure has changed
5973
5974TPM_ST_CREATION
5975
59760x8021
5977
5978tag for a ticket type
5979
5980TPM_ST_VERIFIED
5981
59820x8022
5983
5984tag for a ticket type
5985
5986TPM_ST_AUTH_SECRET
5987
59880x8023
5989
5990tag for a ticket type
5991
5992TPM_ST_HASHCHECK
5993
59940x8024
5995
5996tag for a ticket type
5997
5998TPM_ST_AUTH_SIGNED
5999
60000x8025
6001
6002tag for a ticket type
6003
6004TPM_ST_FU_MANIFEST
6005
60060x8029
6007
6008tag for a structure describing a Field Upgrade Policy
6009
6010Family “2.0”
6011Level 00 Revision 00.99
6012
6013Published
6014Copyright © TCG 2006-2013
6015
6016Page 39
6017October 31, 2013
6018
6019Part 2: Structures
6020
6021Trusted Platform Module Library
6022
60236.10 TPM_SU (Startup Type)
6024These values are used in TPM2_Startup() to indicate the shutdown and startup mode. The defined
6025startup sequences are:
6026a) TPM Reset – Two cases:
60271) Shutdown(CLEAR) followed by Startup(CLEAR)
60282) Startup(CLEAR) with no Shutdown()
6029b) TPM Restart – Shutdown(STATE) followed by Startup(CLEAR)
6030c) TPM Resume – Shutdown(STATE) followed by Startup(STATE)
6031TPM_SU values of 80 0016 and above are reserved for internal use of the TPM and may not be assigned
6032values.
6033NOTE
6034
6035In the reference code, a value of FF FF 16 indicates that the startup state has not been set. If this was
6036defined in this table to be, say, TPM_SU_NONE, then TPM_SU_NONE would be a valid input value but
6037the caller is not allowed to indicate the that the startup type is TPM_SU_NONE so the reserved value is
6038defined in the implementation as required for internal TPM uses.
6039
6040Table 19 — Definition of (UINT16) TPM_SU Constants <IN>
6041Name
6042
6043Value
6044
6045Description
6046
6047TPM_SU_CLEAR
6048
60490x0000
6050
6051on TPM2_Shutdown(), indicates that the TPM should prepare
6052for loss of power and save state required for an orderly startup
6053(TPM Reset).
6054on TPM2_Startup(), indicates that the TPM should start from
6055perform TPM Reset or TPM Restart
6056
6057TPM_SU_STATE
6058
60590x0001
6060
6061on TPM2_Shutdown(), indicates that the TPM should prepare
6062for loss of power and save state required for an orderly startup
6063(TPM Restart or TPM Resume)
6064on TPM2_Startup(), indicates that the TPM should restore the
6065state saved by TPM2_Shutdown(TPM_SU_STATE)
6066
6067#TPM_RC_VALUE
6068
6069response code when incorrect value is used
6070
60716.11 TPM_SE (Session Type)
6072This type is used in TPM2_StartAuthSession() to indicate the type of the session to be created.
6073Table 20 — Definition of (UINT8) TPM_SE Constants <IN>
6074Name
6075
6076Value
6077
6078TPM_SE_HMAC
6079
60800x00
6081
6082TPM_SE_POLICY
6083
60840x01
6085
6086TPM_SE_TRIAL
6087
60880x03
6089
6090#TPM_RC_VALUE
6091
6092Page 40
6093October 31, 2013
6094
6095Description
6096
6097The policy session is being used to compute the policyHash and
6098not for command authorization.
6099This setting modifies some policy commands and prevents
6100session from being used to authorize a command.
6101response code when incorrect value is used
6102
6103Published
6104Copyright © TCG 2006-2013
6105
6106Family “2.0”
6107Level 00 Revision 00.99
6108
6109Trusted Platform Module Library
6110
6111Part 2: Structures
6112
61136.12 TPM_CAP (Capabilities)
6114The TPM_CAP values are used in TPM2_GetCapability() to select the type of the value to be returned.
6115The format of the response varies according to the type of the value.
6116Table 21 — Definition of (UINT32) TPM_CAP Constants
6117Capability Name
6118
6119Value
6120
6121Property Type
6122
6123Return Type
6124
6125TPM_CAP_FIRST
6126
61270x00000000
6128
6129TPM_CAP_ALGS
6130
61310x00000000
6132
6133TPM_CAP_HANDLES
6134
61350x00000001
6136
6137TPML_HANDLE
6138
6139TPM_CAP_COMMANDS
6140
61410x00000002
6142
6143TPML_CCA
6144
6145TPM_CAP_PP_COMMANDS
6146
61470x00000003
6148
6149TPML_CC
6150
6151TPM_CAP_AUDIT_COMMANDS
6152
61530x00000004
6154
6155TPML_CC
6156
6157TPM_CAP_PCRS
6158
61590x00000005
6160
6161TPML_PCR_SELECTION
6162
6163TPM_CAP_TPM_PROPERTIES
6164
61650x00000006
6166
6167TPML_TAGGED_TPM_PROPERTY
6168
6169TPM_CAP_PCR_PROPERTIES
6170
61710x00000007
6172
6173(1)
6174
6175TPM_CAP_ECC_CURVES
6176
61770x00000008
6178
6179TPML_ALG_PROPERTY
6180
6181TPML_TAGGED_PCR_PROPERTY
6182(1)
6183
6184TPM_CAP_LAST
6185
61860x00000008
6187
6188TPM_CAP_VENDOR_PROPERTY
61890x00000100
6190
6191TPML_ECC_CURVE
6192
6193manufacturer-specific values
6194
6195#TPM_RC_VALUE
6196NOTES:
6197(1) The TPM_ALG_ID or TPM_ECC_CURVE is cast to a UINT32
6198
61996.13 TPM_PT (Property Tag)
6200The TPM_PT constants are used in TPM2_GetCapability(capability = TPM_CAP_TPM_PROPERTIES) to
6201indicate the property being selected or returned.
6202The values in the fixed group (PT_FIXED) are not changeable through programmatic means other than a
6203firmware update. The values in the variable group (PT_VAR) may be changed with TPM commands but
6204should be persistent over power cycles and only changed when indicated by the detailed actions code.
6205Table 22 — Definition of (UINT32) TPM_PT Constants <IN/OUT, S>
6206Capability Name
6207
6208Value
6209
6210Comments
6211
6212TPM_PT_NONE
6213
62140x00000000
6215
6216indicates no property type
6217
6218PT_GROUP
6219
62200x00000100
6221
6222The number of properties in each group.
6223NOTE The first group with any properties is group 1
6224(PT_GROUP * 1). Group 0 is reserved.
6225
6226PT_FIXED
6227
6228PT_GROUP * 1
6229 the
6230group
6231of
6232fixed
6233properties
6234returned
6235as
6236TPMS_TAGGED_PROPERTY
6237The values in this group are only changed due to a
6238firmware change in the TPM.
6239
6240TPM_PT_FAMILY_INDICATOR
6241
6242PT_FIXED + 0
6243 a 4-octet character string containing the TPM Family value
6244(TPM_SPEC_FAMILY)
6245
6246Family “2.0”
6247Level 00 Revision 00.99
6248
6249Published
6250Copyright © TCG 2006-2013
6251
6252Page 41
6253October 31, 2013
6254
6255Part 2: Structures
6256
6257Capability Name
6258TPM_PT_LEVEL
6259
6260Trusted Platform Module Library
6261
6262Value
6263
6264Comments
6265
6266PT_FIXED + 1
6267 the level of the specification
6268NOTE 1
6269
6270TPM_PT_REVISION
6271
6272PT_FIXED + 2
6273For this specification, the level is zero.
6274
6275NOTE 2
6276
6277The level is on the title page of the specification.
6278
6279 the specification Revision times 100
6280EXAMPLE Revision 01.01 would have a value of 101.
6281NOTE
6282
6283TPM_PT_DAY_OF_YEAR
6284
6285PT_FIXED + 3
6286The Revision value is on the title page of the
6287specification.
6288
6289 the specification day of year using TCG calendar
6290EXAMPLE November 15, 2010, has a day of year value of 319
6291(00 00 01 3F16).
6292NOTE
6293
6294TPM_PT_YEAR
6295
6296PT_FIXED + 4
6297The specification date is on the title page of the
6298specification.
6299
6300 the specification year using the CE
6301EXAMPLE The year 2010 has a value of 00 00 07 DA16.
6302NOTE
6303
6304The specification date is on the title page of the
6305specification.
6306
6307TPM_PT_MANUFACTURER
6308
6309PT_FIXED + 5
6310 the vendor ID unique to each TPM manufacturer
6311
6312TPM_PT_VENDOR_STRING_1
6313
6314PT_FIXED + 6
6315 the first four characters of the vendor ID string
6316NOTE
6317
6318When the vendor string is fewer than 16 octets, the
6319additional property values do not have to be present.
6320A vendor string of 4 octets can be represented in one
632132-bit value and no null terminating character is
6322required.
6323
6324TPM_PT_VENDOR_STRING_2
6325
6326PT_FIXED + 7
6327 the second four characters of the vendor ID string
6328
6329TPM_PT_VENDOR_STRING_3
6330
6331PT_FIXED + 8
6332 the third four characters of the vendor ID string
6333
6334TPM_PT_VENDOR_STRING_4
6335
6336PT_FIXED + 9
6337 the fourth four characters of the vendor ID sting
6338
6339TPM_PT_VENDOR_TPM_TYPE
6340
6341PT_FIXED + 10
6342 vendor-defined value indicating the TPM model
6343
6344TPM_PT_FIRMWARE_VERSION_1
6345
6346PT_FIXED + 11
6347 the most-significant 32 bits of a vendor-specific value
6348indicating the version of the firmware
6349
6350TPM_PT_FIRMWARE_VERSION_2
6351
6352PT_FIXED + 12
6353 the least-significant 32 bits of a vendor-specific value
6354indicating the version of the firmware
6355
6356TPM_PT_INPUT_BUFFER
6357
6358PT_FIXED + 13
6359 the maximum size of
6360TPM2B_MAX_BUFFER)
6361
6362TPM_PT_HR_TRANSIENT_MIN
6363
6364PT_FIXED + 14
6365 the minimum number of transient objects that can be held
6366in TPM RAM
6367NOTE
6368
6369TPM_PT_HR_PERSISTENT_MIN
6370
6371PT_FIXED + 15
6372parameter
6373
6374(typically,
6375
6376a
6377
6378This minimum shall be no less than the minimum
6379value required by the platform-specific specification
6380to which the TPM is built.
6381
6382 the minimum number of persistent objects that can be
6383held in TPM NV memory
6384NOTE
6385
6386TPM_PT_HR_LOADED_MIN
6387
6388PT_FIXED + 16
6389a
6390
6391This minimum shall be no less than the minimum
6392value required by the platform-specific specification
6393to which the TPM is built.
6394
6395 the minimum number of authorization sessions that can
6396be held in TPM RAM
6397NOTE
6398
6399Page 42
6400October 31, 2013
6401
6402This minimum shall be no less than the minimum
6403value required by the platform-specific specification
6404to which the TPM is built.
6405
6406Published
6407
6408Family “2.0”
6409
6410Copyright © TCG 2006-2013
6411
6412Level 00 Revision 00.99
6413
6414Trusted Platform Module Library
6415Capability Name
6416TPM_PT_ACTIVE_SESSIONS_MAX
6417
6418Part 2: Structures
6419Value
6420
6421Comments
6422
6423PT_FIXED + 17
6424 the number of authorization sessions that may be active at
6425a time
6426A session is active when it has a context associated with
6427its handle. The context may either be in TPM RAM or be
6428context saved.
6429NOTE
6430
6431This value shall be no less than the minimum value
6432required by the platform-specific specification to
6433which the TPM is built.
6434
6435TPM_PT_PCR_COUNT
6436
6437PT_FIXED + 18
6438 the number of PCR implemented
6439NOTE This number is determined by the defined
6440attributes, not the number of PCR that are populated.
6441
6442TPM_PT_PCR_SELECT_MIN
6443
6444PT_FIXED + 19
6445 the
6446minimum
6447number
6448of
6449TPMS_PCR_SELECT.sizeOfSelect
6450NOTE
6451
6452TPM_PT_CONTEXT_GAP_MAX
6453
6454PT_FIXED + 20
6455octets
6456
6457in
6458
6459a
6460
6461This value is not determined by the number of PCR
6462implemented but by the number of PCR required by
6463the platform-specific specification with which the TPM
6464is compliant.
6465
6466 the maximum allowed difference (unsigned) between the
6467contextID values of two saved session contexts
646816
6469
6470This value shall be at least 2 -1 (65535).
6471PT_FIXED + 21
6472 skipped
6473TPM_PT_NV_COUNTERS_MAX
6474
6475PT_FIXED + 22
6476 the maximum number of NV Indexes that are allowed to
6477have the TPMA_NV_COUNTER attribute SET
6478NOTE
6479
6480It is allowed for this value to be larger than the
6481number of NV Indexes that can be defined. This
6482would be indicative of a TPM implementation that did
6483not use different implementation technology for
6484different NV Index types.
6485
6486TPM_PT_NV_INDEX_MAX
6487
6488PT_FIXED + 23
6489 the maximum size of an NV Index data area
6490
6491TPM_PT_MEMORY
6492
6493PT_FIXED + 24
6494 a TPMA_MEMORY indicating the memory management
6495method for the TPM
6496
6497TPM_PT_CLOCK_UPDATE
6498
6499PT_FIXED + 25
6500 interval, in milliseconds, between updates to the copy of
6501TPMS_CLOCK_INFO.clock in NV
6502
6503TPM_PT_CONTEXT_HASH
6504
6505PT_FIXED + 26
6506 the algorithm used for the integrity HMAC on saved
6507contexts
6508and
6509for
6510hashing
6511the
6512fuData
6513of
6514TPM2_FirmwareRead()
6515
6516TPM_PT_CONTEXT_SYM
6517
6518PT_FIXED + 27
6519 the algorithm used for encryption of saved contexts
6520
6521TPM_PT_CONTEXT_SYM_SIZE
6522
6523PT_FIXED + 28
6524 the size of the key used for encryption of saved contexts
6525
6526TPM_PT_ORDERLY_COUNT
6527
6528PT_FIXED + 29
6529 the modulus - 1 of the count for NV update of an orderly
6530counter
6531The returned value is MAX_ORDERLY_COUNT.
6532N
6533This will have a value of 2 – 1 where 1 ≤ N ≤ 32
6534NOTE
6535
6536An “orderly counter” is an NV Index with
6537TPMA_NV_COUNTER and TPMA_NV_ORDERLY
6538both SET.
6539
6540TPM_PT_MAX_COMMAND_SIZE
6541
6542PT_FIXED + 30
6543 the maximum value for commandSize in a command
6544
6545TPM_PT_MAX_RESPONSE_SIZE
6546
6547PT_FIXED + 31
6548 the maximum value for responseSize in a response
6549
6550TPM_PT_MAX_DIGEST
6551
6552PT_FIXED + 32
6553 the maximum size of a digest that can be produced by the
6554TPM
6555
6556TPM_PT_MAX_OBJECT_CONTEXT
6557
6558PT_FIXED + 33
6559 the maximum size of an object context that will be
6560returned by TPM2_ContextSave
6561
6562Family “2.0”
6563Level 00 Revision 00.99
6564
6565Published
6566Copyright © TCG 2006-2013
6567
6568Page 43
6569October 31, 2013
6570
6571Part 2: Structures
6572
6573Capability Name
6574
6575Trusted Platform Module Library
6576
6577Value
6578
6579Comments
6580
6581TPM_PT_MAX_SESSION_CONTEXT
6582PT_FIXED + 34
6583 the maximum size of a session context that will be
6584returned by TPM2_ContextSave
6585TPM_PT_PS_FAMILY_INDICATOR
6586
6587PT_FIXED + 35
6588 platform-specific family (a TPM_PS value)(see Table 24)
6589NOTE
6590
6591The platform-specific values for the TPM_PT_PS
6592parameters are in the relevant platform-specific
6593specification. In the reference implementation, all of
6594these values are 0.
6595
6596TPM_PT_PS_LEVEL
6597
6598PT_FIXED + 36
6599 the level of the platform-specific specification
6600
6601TPM_PT_PS_REVISION
6602
6603PT_FIXED + 37
6604 the specification Revision times 100 for the platformspecific specification
6605
6606TPM_PT_PS_DAY_OF_YEAR
6607
6608PT_FIXED + 38
6609 the platform-specific specification day of year using TCG
6610calendar
6611
6612TPM_PT_PS_YEAR
6613
6614PT_FIXED + 39
6615 the platform-specific specification year using the CE
6616
6617TPM_PT_SPLIT_MAX
6618
6619PT_FIXED + 40
6620 the number of split signing operations supported by the
6621TPM
6622
6623TPM_PT_TOTAL_COMMANDS
6624
6625PT_FIXED + 41
6626 total number of commands implemented in the TPM
6627
6628TPM_PT_LIBRARY_COMMANDS
6629
6630PT_FIXED + 42
6631 number of commands from the TPM library that are
6632implemented
6633
6634TPM_PT_VENDOR_COMMANDS
6635
6636PT_FIXED + 43
6637 number of vendor commands that are implemented
6638
6639TPM_PT_NV_BUFFER_MAX
6640
6641PT_FIXED + 44
6642 the maximum data size in one NV write command
6643
6644PT_VAR
6645
6646PT_GROUP * 2
6647 the group of variable properties returned as
6648TPMS_TAGGED_PROPERTY
6649The properties in this group change because of a
6650Protected Capability other than a firmware update. The
6651values are not necessarily persistent across all power
6652transitions.
6653
6654TPM_PT_PERMANENT
6655
6656PT_VAR + 0
6657
6658TPMA_PERMANENT
6659
6660TPM_PT_STARTUP_CLEAR
6661
6662PT_VAR + 1
6663
6664TPMA_STARTUP_CLEAR
6665
6666TPM_PT_HR_NV_INDEX
6667
6668PT_VAR + 2
6669
6670the number of NV Indexes currently defined
6671
6672TPM_PT_HR_LOADED
6673
6674PT_VAR + 3
6675
6676the number of authorization sessions currently loaded into
6677TPM RAM
6678
6679TPM_PT_HR_LOADED_AVAIL
6680
6681PT_VAR + 4
6682
6683the number of additional authorization sessions, of any
6684type, that could be loaded into TPM RAM
6685This value is an estimate. If this value is at least 1, then at
6686least one authorization session of any type may be
6687loaded. Any command that changes the RAM memory
6688allocation can make this estimate invalid.
6689NOTE
6690
6691TPM_PT_HR_ACTIVE
6692
6693Page 44
6694October 31, 2013
6695
6696PT_VAR + 5
6697
6698A valid implementation may return 1 even if more
6699than one authorization session would fit into RAM.
6700
6701the number of active authorization sessions currently
6702being tracked by the TPM
6703This is the sum of the loaded and saved sessions.
6704
6705Published
6706Copyright © TCG 2006-2013
6707
6708Family “2.0”
6709Level 00 Revision 00.99
6710
6711Trusted Platform Module Library
6712Capability Name
6713TPM_PT_HR_ACTIVE_AVAIL
6714
6715Part 2: Structures
6716Value
6717
6718Comments
6719
6720PT_VAR + 6
6721
6722the number of additional authorization sessions, of any
6723type, that could be created
6724This value is an estimate. If this value is at least 1, then at
6725least one authorization session of any type may be
6726created. Any command that changes the RAM memory
6727allocation can make this estimate invalid.
6728NOTE
6729
6730TPM_PT_HR_TRANSIENT_AVAIL
6731
6732PT_VAR + 7
6733
6734A valid implementation may return 1 even if more
6735than one authorization session could be created.
6736
6737estimate of the number of additional transient objects that
6738could be loaded into TPM RAM
6739This value is an estimate. If this value is at least 1, then at
6740least one object of any type may be loaded. Any
6741command that changes the memory allocation can make
6742this estimate invalid.
6743NOTE
6744
6745A valid implementation may return 1 even if more
6746than one transient object would fit into RAM.
6747
6748TPM_PT_HR_PERSISTENT
6749
6750PT_VAR + 8
6751
6752the number of persistent objects currently loaded into
6753TPM NV memory
6754
6755TPM_PT_HR_PERSISTENT_AVAIL
6756
6757PT_VAR + 9
6758
6759the number of additional persistent objects that could be
6760loaded into NV memory
6761This value is an estimate. If this value is at least 1, then at
6762least one object of any type may be made persistent. Any
6763command that changes the NV memory allocation can
6764make this estimate invalid.
6765NOTE
6766
6767A valid implementation may return 1 even if more
6768than one persistent object would fit into NV memory.
6769
6770TPM_PT_NV_COUNTERS
6771
6772PT_VAR + 10
6773
6774the number of defined NV Indexes that have NV
6775TPMA_NV_COUNTER attribute SET
6776
6777TPM_PT_NV_COUNTERS_AVAIL
6778
6779PT_VAR + 11
6780
6781the number of additional NV Indexes that can be defined
6782with
6783their
6784TPMA_NV_COUNTER
6785and
6786TPMA_NV_ORDERLY attribute SET
6787This value is an estimate. If this value is at least 1, then at
6788least one NV Index may be created with the
6789TPMA_NV_COUNTER
6790and
6791TPMA_NV_ORDERLY
6792attributes SET. Any command that changes the NV
6793memory allocation can make this estimate invalid.
6794NOTE A valid implementation may return 1 even if more
6795than one NV counter could be defined.
6796
6797TPM_PT_ALGORITHM_SET
6798
6799PT_VAR + 12
6800
6801code that limits the algorithms that may be used with the
6802TPM
6803
6804TPM_PT_LOADED_CURVES
6805
6806PT_VAR + 13
6807
6808the number of loaded ECC curves
6809
6810TPM_PT_LOCKOUT_COUNTER
6811
6812PT_VAR + 14
6813
6814the current value of the lockout counter (failedTries)
6815
6816TPM_PT_MAX_AUTH_FAIL
6817
6818PT_VAR + 15
6819
6820the number of authorization failures before DA lockout is
6821invoked
6822
6823TPM_PT_LOCKOUT_INTERVAL
6824
6825PT_VAR + 16
6826
6827the number of seconds before the value reported by
6828TPM_PT_LOCKOUT_COUNTER is decremented
6829
6830TPM_PT_LOCKOUT_RECOVERY
6831
6832PT_VAR + 17
6833
6834the number of seconds after a lockoutAuth failure before
6835use of lockoutAuth may be attempted again
6836
6837TPM_PT_NV_WRITE_RECOVERY
6838
6839PT_VAR + 18
6840
6841number of milliseconds before the TPM will accept
6842another command that will modify NV
6843This value is an approximation and may go up or down
6844over time.
6845
6846Family “2.0”
6847Level 00 Revision 00.99
6848
6849Published
6850Copyright © TCG 2006-2013
6851
6852Page 45
6853October 31, 2013
6854
6855Part 2: Structures
6856
6857Capability Name
6858
6859Trusted Platform Module Library
6860
6861Value
6862
6863Comments
6864
6865TPM_PT_AUDIT_COUNTER_0
6866
6867PT_VAR + 19
6868
6869the high-order 32 bits of the command audit counter
6870
6871TPM_PT_AUDIT_COUNTER_1
6872
6873PT_VAR + 20
6874
6875the low-order 32 bits of the command audit counter
6876
6877Page 46
6878October 31, 2013
6879
6880Published
6881Copyright © TCG 2006-2013
6882
6883Family “2.0”
6884Level 00 Revision 00.99
6885
6886Trusted Platform Module Library
6887
6888Part 2: Structures
6889
68906.14 TPM_PT_PCR (PCR Property Tag)
6891The TPM_PT_PCR constants are used in TPM2_GetCapability() to indicate the property being selected
6892or returned. The PCR properties can be read when capability == TPM_CAP_PCR_PROPERTIES.
6893Table 23 — Definition of (UINT32) TPM_PT_PCR Constants <IN/OUT, S>
6894Capability Name
6895
6896Value
6897
6898Comments
6899
6900TPM_PT_PCR_FIRST
6901
69020x00000000
6903
6904bottom of the range of TPM_PT_PCR properties
6905
6906TPM_PT_PCR_SAVE
6907
69080x00000000
6909
6910a SET bit in the TPMS_PCR_SELECT indicates that the PCR is
6911saved and restored by TPM_SU_STATE
6912
6913TPM_PT_PCR_EXTEND_L0
6914
69150x00000001
6916
6917a SET bit in the TPMS_PCR_SELECT indicates that the PCR
6918may be extended from locality 0
6919This property is only present if a locality other than 0 is
6920implemented.
6921
6922TPM_PT_PCR_RESET_L0
6923
69240x00000002
6925
6926a SET bit in the TPMS_PCR_SELECT indicates that the PCR
6927may be reset by TPM2_PCR_Reset() from locality 0
6928
6929TPM_PT_PCR_EXTEND_L1
6930
69310x00000003
6932
6933a SET bit in the TPMS_PCR_SELECT indicates that the PCR
6934may be extended from locality 1
6935This property is only present if locality 1 is implemented.
6936
6937TPM_PT_PCR_RESET_L1
6938
69390x00000004
6940
6941a SET bit in the TPMS_PCR_SELECT indicates that the PCR
6942may be reset by TPM2_PCR_Reset() from locality 1
6943This property is only present if locality 1 is implemented.
6944
6945TPM_PT_PCR_EXTEND_L2
6946
69470x00000005
6948
6949a SET bit in the TPMS_PCR_SELECT indicates that the PCR
6950may be extended from locality 2
6951This property is only present if localities 1 and 2 are
6952implemented.
6953
6954TPM_PT_PCR_RESET_L2
6955
69560x00000006
6957
6958a SET bit in the TPMS_PCR_SELECT indicates that the PCR
6959may be reset by TPM2_PCR_Reset() from locality 2
6960This property is only present if localities 1 and 2 are
6961implemented.
6962
6963TPM_PT_PCR_EXTEND_L3
6964
69650x00000007
6966
6967a SET bit in the TPMS_PCR_SELECT indicates that the PCR
6968may be extended from locality 3
6969This property is only present if localities 1, 2, and 3 are
6970implemented.
6971
6972TPM_PT_PCR_RESET_L3
6973
69740x00000008
6975
6976a SET bit in the TPMS_PCR_SELECT indicates that the PCR
6977may be reset by TPM2_PCR_Reset() from locality 3
6978This property is only present if localities 1, 2, and 3 are
6979implemented.
6980
6981TPM_PT_PCR_EXTEND_L4
6982
69830x00000009
6984
6985a SET bit in the TPMS_PCR_SELECT indicates that the PCR
6986may be extended from locality 4
6987This property is only present if localities 1, 2, 3, and 4 are
6988implemented.
6989
6990TPM_PT_PCR_RESET_L4
6991
69920x0000000A
6993
6994a SET bit in the TPMS_PCR_SELECT indicates that the PCR
6995may be reset by TPM2_PCR_Reset() from locality 4
6996This property is only present if localities 1, 2, 3, and 4 are
6997implemented.
6998
6999Family “2.0”
7000Level 00 Revision 00.99
7001
7002Published
7003Copyright © TCG 2006-2013
7004
7005Page 47
7006October 31, 2013
7007
7008Part 2: Structures
7009
7010Capability Name
7011reserved
7012
7013Trusted Platform Module Library
7014
7015Value
7016
7017Comments
7018
70190x0000000B – the values in this range are reserved
70200x00000010 They correspond to values that may be used to describe
7021attributes associated with the extended localities (32255).synthesize additional software localities. The meaning of
7022these properties need not be the same as the meaning for the
7023Extend and Reset properties above.
7024
7025TPM_PT_PCR_NO_INCREMENT
7026
70270x00000011
7028
7029a SET bit in the TPMS_PCR_SELECT indicates that
7030modifications to this PCR (reset or Extend) will not increment
7031the pcrUpdateCounter
7032
7033TPM_PT_PCR_DRTM_RESET
7034
70350x00000012
7036
7037a SET bit in the TPMS_PCR_SELECT indicates that the PCR is
7038reset by a DRTM event
7039These PCR are reset to -1 on TPM2_Startup() and reset to 0 on
7040a _TPM_Hash_End event following a _TPM_Hash_Start event.
7041
7042TPM_PT_PCR_POLICY
7043
70440x00000013
7045
7046a SET bit in the TPMS_PCR_SELECT indicates that the PCR is
7047controlled by policy
7048This property is only present if the TPM supports policy control
7049of a PCR.
7050
7051TPM_PT_PCR_AUTH
7052
70530x00000014
7054
7055a SET bit in the TPMS_PCR_SELECT indicates that the PCR is
7056controlled by an authorization value
7057This property is only present if the TPM supports authorization
7058control of a PCR.
7059
7060reserved
7061
70620x00000015
7063
7064reserved for the next (2 ) TPM_PT_PCR_POLICY set
7065
7066reserved
7067
70680x00000016
7069
7070reserved for the next (2 ) TPM_PT_PCR_AUTH set
7071
7072reserved
7073
7074nd
7075nd
7076
7077nd
7078
7079th
7080
70810x00000017 – reserved for the 2 through 255 TPM_PT_PCR_POLICY and
70820x00000210 TPM_PT_PCR_AUTH values
7083th
7084
7085and
7086
7087highest
7088
7089allowed,
7090
7091th
7092
7093and
7094
7095highest
7096
7097allowed,
7098
7099reserved
7100
71010x00000211
7102
7103reserved
7104to
7105the
7106256 ,
7107TPM_PT_PCR_POLICY set
7108
7109reserved
7110
71110x00000212
7112
7113reserved
7114to
7115the
7116256 ,
7117TPM_PT_PCR_AUTH set
7118
7119reserved
7120
71210x00000213
7122
7123new PCR property values may be assigned starting with this
7124value
7125
7126TPM_PT_PCR_LAST
7127
71280x00000014
7129
7130top of the range of TPM_PT_PCR properties of the
7131implementation
7132If the TPM receives a request for a PCR property with a value
7133larger than this, the TPM will return a zero length list and set the
7134moreData parameter to NO.
7135NOTE
7136
7137Page 48
7138October 31, 2013
7139
7140This is an implementation-specific value. The value shown
7141reflects the reference code implementation.
7142
7143Published
7144Copyright © TCG 2006-2013
7145
7146Family “2.0”
7147Level 00 Revision 00.99
7148
7149Trusted Platform Module Library
7150
7151Part 2: Structures
7152
71536.15 TPM_PS (Platform Specific)
7154The platform values in Table 24 are used for the TPM_PT_PS_FAMILY_INDICATOR.
7155NOTE
7156
7157Values below six (6) have the same values as the purview assignments in TPM 1.2.
7158
7159Table 24 — Definition of (UINT32) TPM_PS Constants <OUT>
7160Capability Name
7161
7162Value
7163
7164Comments
7165
7166TPM_PS_MAIN
7167
71680x00000000
7169
7170not platform specific
7171
7172TPM_PS_PC
7173
71740x00000001
7175
7176PC Client
7177
7178TPM_PS_PDA
7179
71800x00000002
7181
7182PDA (includes all mobile devices that are not specifically cell
7183phones)
7184
7185TPM_PS_CELL_PHONE
7186
71870x00000003
7188
7189Cell Phone
7190
7191TPM_PS_SERVER
7192
71930x00000004
7194
7195Server WG
7196
7197TPM_PS_PERIPHERAL
7198
71990x00000005
7200
7201Peripheral WG
7202
7203TPM_PS_TSS
7204
72050x00000006
7206
7207TSS WG
7208
7209TPM_PS_STORAGE
7210
72110x00000007
7212
7213Storage WG
7214
7215TPM_PS_AUTHENTICATION
7216
72170x00000008
7218
7219Authentication WG
7220
7221TPM_PS_EMBEDDED
7222
72230x00000009
7224
7225Embedded WG
7226
7227TPM_PS_HARDCOPY
7228
72290x0000000A
7230
7231Hardcopy WG
7232
7233TPM_PS_INFRASTRUCTURE
7234
72350x0000000B
7236
7237Infrastructure WG
7238
7239TPM_PS_VIRTUALIZATION
7240
72410x0000000C
7242 Virtualization WG
7243
7244TPM_PS_TNC
7245
72460x0000000D
7247 Trusted Network Connect WG
7248
7249TPM_PS_MULTI_TENANT
7250
72510x0000000E
7252
7253Multi-tenant WG
7254
7255TPM_PS_TC
7256
72570x0000000F
7258
7259Technical Committee
7260
7261Family “2.0”
7262Level 00 Revision 00.99
7263
7264Published
7265Copyright © TCG 2006-2013
7266
7267Page 49
7268October 31, 2013
7269
7270Part 2: Structures
7271
72727
7273
7274Trusted Platform Module Library
7275
7276Handles
7277
72787.1
7279
7280Introduction
7281
7282Handles are 32-bit values used to reference shielded locations of various types within the TPM.
7283Table 25 — Definition of Types for Handles
7284Type
7285
7286Name
7287
7288Description
7289
7290UINT32
7291
7292TPM_HANDLE
7293
7294Handles may refer to objects (keys or data blobs), authorization sessions (HMAC and policy), NV
7295Indexes, permanent TPM locations, and PCR.
72967.2
7297
7298TPM_HT (Handle Types)
7299
7300The 32-bit handle space is divided into 256 regions of equal size with 2
7301ranges represents a handle type.
7302
730324
7304
7305values in each. Each of these
7306
7307The type of the entity is indicated by the MSO of its handle. The values for the MSO and the entity
7308referenced are shown in Table 26.
7309Table 26 — Definition of (UINT8) TPM_HT Constants <S>
7310Name
7311
7312Value
7313
7314Comments
7315
7316TPM_HT_PCR
7317
73180x00
7319
7320PCR – consecutive numbers, starting at 0, that reference the PCR
7321registers
7322A platform-specific specification will set the minimum number of PCR
7323and an implementation may have more.
7324
7325TPM_HT_NV_INDEX
7326
73270x01
7328
7329NV Index – assigned by the caller
7330
7331TPM_HT_HMAC_SESSION
7332
73330x02
7334
7335HMAC Authorization Session – assigned by the TPM when the
7336session is created
7337
7338TPM_HT_LOADED_SESSION
7339
73400x02
7341
7342Loaded Authorization Session – used only in the context of
7343TPM2_GetCapability
7344This type references both loaded HMAC and loaded policy
7345authorization sessions.
7346
7347TPM_HT_POLICY_SESSION
7348
73490x03
7350
7351Policy Authorization Session – assigned by the TPM when the
7352session is created
7353
7354TPM_HT_ACTIVE_SESSION
7355
73560x03
7357
7358Active Authorization Session – used only in the context of
7359TPM2_GetCapability
7360This type references saved authorization session contexts for which
7361the TPM is maintaining tracking information.
7362
7363TPM_HT_PERMANENT
7364
73650x40
7366
7367Permanent Values – assigned by this specification in Table 27
7368
7369TPM_HT_TRANSIENT
7370
73710x80
7372
7373Transient Objects – assigned by the TPM when an object is loaded
7374into transient-object memory or when a persistent object is converted
7375to a transient object
7376
7377TPM_HT_PERSISTENT
7378
73790x81
7380
7381Persistent Objects – assigned by the TPM when a loaded transient
7382object is made persistent
7383
7384Page 50
7385October 31, 2013
7386
7387Published
7388Copyright © TCG 2006-2013
7389
7390Family “2.0”
7391Level 00 Revision 00.99
7392
7393Trusted Platform Module Library
7394
7395Part 2: Structures
7396
7397When a transient object is loaded, the TPM shall assign a handle with an MSO of TPM_HT_TRANSIENT.
7398The object may be assigned a different handle each time it is loaded. The TPM shall ensure that handles
7399assigned to transient objects are unique and assigned to only one transient object at a time.
7400EXAMPLE
7401
7402If a TPM is only able to hold 4 transient objects in internal memory, it might choose to assign handles to
7403those objects with the values 80 00 00 0016 – 80 00 00 0316.
7404
7405When a transient object is converted to a persistent object (TPM2_EvictControl()), the TPM shall validate
7406that the handle provided by the caller has an MSO of TPM_HT_PERSISTENT and that the handle is not
7407already assigned to a persistent object.
7408A handle is assigned to a session when the session is started. The handle shall have an MSO equal to
7409TPM_HT_SESSION and remain associated with that session until the session is closed or flushed. The
7410TPM shall ensure that a session handle is only associated with one session at a time. When the session
7411is loaded into the TPM using TPM2_LoadContext(), it will have the same handle each time it is loaded.
7412EXAMPLE
7413
74147.3
7415
7416If a TPM is only able to track 64 active sessions at a time, it could number those sessions using the
7417values xx 00 01 0016 – xx 00 01 3F 16 where xx is either 02 16 or 03 16 depending on the session type.
7418
7419Persistent Handle Sub-ranges
7420
7421Persistent handles are assigned by the caller of TPM2_EvictControl(). ownerAuth or platformAuth is
7422required to authorize allocation of space for a persistent object. These entities are given separate ranges
7423of persistent handles so that they do not have to allocate from a common range of handles.
7424NOTE
7425
7426While this “namespace” allocation of the handle ranges could have been handled by convention, TPM
7427enforcement is used to prevent errors by the OS or malicious software from affecting the platform’s use of
7428the NV memory.
7429
7430The Owner is allocated persistent handles in the range of 81 00 00 0016 to 81 7F FF FF16 inclusive and
7431the TPM will return an error if ownerAuth is used to attempt to assign a persistent handle outside of this
7432range.
7433
7434Family “2.0”
7435Level 00 Revision 00.99
7436
7437Published
7438Copyright © TCG 2006-2013
7439
7440Page 51
7441October 31, 2013
7442
7443Part 2: Structures
74447.4
7445
7446Trusted Platform Module Library
7447
7448TPM_RH (Permanent Handles)
7449
7450Table 27 lists the architecturally defined handles that cannot be changed. The handles include
7451authorization handles, and special handles.
7452Table 27 — Definition of (UINT32) TPM_RH Constants <IN, S>
7453Name
7454
7455Value
7456
7457Type
7458
7459TPM_RH_FIRST
7460
74610x40000000
7462
7463R
7464
7465TPM_RH_SRK
7466
74670x40000000
7468
7469R
7470
7471TPM_RH_OWNER
7472
74730x40000001
7474
7475K, A, P
7476
7477TPM_RH_REVOKE
7478
74790x40000002
7480
7481R
7482
7483not used
7484
74851
7486
7487TPM_RH_TRANSPORT
7488
74890x40000003
7490
7491R
7492
7493not used
7494
74951
7496
7497TPM_RH_OPERATOR
7498
74990x40000004
7500
7501R
7502
7503not used
7504
75051
7506
7507TPM_RH_ADMIN
7508
75090x40000005
7510
7511R
7512
7513not used
7514
75151
7516
7517TPM_RH_EK
7518
75190x40000006
7520
7521R
7522
7523not used
7524
75251
7526
7527TPM_RH_NULL
7528
75290x40000007
7530
7531K, A, P
7532
7533a handle associated with the null hierarchy, an EmptyAuth
7534authValue, and an Empty Policy authPolicy.
7535
7536TPM_RH_UNASSIGNED
7537
75380x40000008
7539
7540R
7541
7542value reserved to the TPM to indicate a handle location that
7543has not been initialized or assigned
7544
7545TPM_RS_PW
7546
75470x40000009
7548
7549S
7550
7551authorization value
7552authorization session
7553
7554TPM_RH_LOCKOUT
7555
75560x4000000A
7557
7558A
7559
7560references the authorization associated with the dictionary
7561attack lockout reset
7562
7563TPM_RH_ENDORSEMENT
7564
75650x4000000B
7566
7567K, A, P
7568
7569references the Endorsement Primary
7570endorsementAuth, and endorsementPolicy
7571
7572TPM_RH_PLATFORM
7573
75740x4000000C
7575
7576K, A, P
7577
7578references the Platform Primary Seed (PPS), platformAuth,
7579and platformPolicy
7580
7581TPM_RH_PLATFORM_NV
7582
75830x4000000D
7584
7585C
7586
7587for phEnableNV
7588
7589R
7590
7591the top of the reserved handle area
7592This is set to allow TPM2_GetCapability() to know where to
7593stop. It may vary as implementations add to the permanent
7594handle area.
7595
7596TPM_RH_LAST
7597
75980x4000000D
7599
7600Comments
7601
7602not used
7603
76041
7605
7606handle references the Storage Primary Seed (SPS), the
7607ownerAuth, and the ownerPolicy
7608
7609used
7610
7611to
7612
7613indicate
7614
7615a
7616
7617password
7618
7619Seed
7620
7621(EPS),
7622
7623Type definitions:
7624R – a reserved value
7625K – a Primary Seed
7626A – an authorization value
7627P – a policy value
7628S – a session handle
7629C - a controlNote 1 The handle is only used in a TPM that is compatible with a previous version of this specification. It is not used
7630in any command defined in this version of the specification.
7631
7632Page 52
7633October 31, 2013
7634
7635Published
7636Copyright © TCG 2006-2013
7637
7638Family “2.0”
7639Level 00 Revision 00.99
7640
7641Trusted Platform Module Library
76427.5
7643
7644Part 2: Structures
7645
7646TPM_HC (Handle Value Constants)
7647
7648The definitions in Table 28 are used to define many of the interface data types. However, the values of
7649these constants, other than PCR_FIRST, are informative and may be changed by an implementation as
7650long as the values stay within the prescribed ranges for the handle type.
7651NOTE
7652
7653PCR0 is architecturally defined to have a handle value of 0.
7654
7655For the reference implementation, the handle range for sessions starts at the lowest allowed value for a
7656session handle. The highest value for a session handle is determined by how many active sessions are
7657allowed by the implementation. The MSO of the session handle will be set according to the session type.
7658A similar approach is used for transient objects with the first assigned handle at the bottom of the range
7659defined by TPM_HT_TRANSIENT and the top of the range determined by the implementation-dependent
7660value of MAX_LOADED_OBJECTS.
7661The first assigned handle for evict objects is also at the bottom of the allowed range defined by
7662TPM_HT_PERSISTENT and the top of the range determined by the implementation-dependent value of
7663MAX_EVICT_OBJECTS.
7664NOTE
7665
7666The values in Table 28 are intended to facilitate the process of making the handle larger than 32 bits in
7667the future. It is intended that HR_MASK and HR_SHIFT are the only values that need change to resize
7668the handle space.
7669
7670Family “2.0”
7671Level 00 Revision 00.99
7672
7673Published
7674Copyright © TCG 2006-2013
7675
7676Page 53
7677October 31, 2013
7678
7679Part 2: Structures
7680
7681Trusted Platform Module Library
7682
7683Table 28 — Definition of (TPM_HANDLE) TPM_HC Constants <IN, S>
7684Name
7685
7686Value
7687
7688Comments
7689
7690HR_HANDLE_MASK
7691
76920x00FFFFFF
7693
7694to mask off the HR
7695
7696HR_RANGE_MASK
7697
76980xFF000000
7699
7700to mask off the variable
7701part
7702
7703HR_SHIFT
7704
770524
7706
7707HR_PCR
7708
7709(TPM_HT_PCR << HR_SHIFT)
7710
7711HR_HMAC_SESSION
7712
7713(TPM_HT_HMAC_SESSION << HR_SHIFT)
7714
7715HR_POLICY_SESSION
7716
7717(TPM_HT_POLICY_SESSION << HR_SHIFT)
7718
7719HR_TRANSIENT
7720
7721(TPM_HT_TRANSIENT << HR_SHIFT)
7722
7723HR_PERSISTENT
7724
7725(TPM_HT_PERSISTENT << HR_SHIFT)
7726
7727HR_NV_INDEX
7728
7729(TPM_HT_NV_INDEX << HR_SHIFT)
7730
7731HR_PERMANENT
7732
7733(TPM_HT_PERMANENT << HR_SHIFT)
7734
7735PCR_FIRST
7736
7737(HR_PCR + 0)
7738
7739first PCR
7740
7741PCR_LAST
7742
7743(PCR_FIRST + IMPLEMENTATION_PCR-1)
7744
7745last PCR
7746
7747HMAC_SESSION_FIRST
7748
7749(HR_HMAC_SESSION + 0)
7750
7751first HMAC session
7752
7753HMAC_SESSION_LAST
7754
7755(HMAC_SESSION_FIRST+MAX_ACTIVE_SESSIONS-1)
7756
7757last HMAC session
7758
7759LOADED_SESSION_FIRST HMAC_SESSION_FIRST
7760
7761used in GetCapability
7762
7763LOADED_SESSION_LAST
7764
7765HMAC_SESSION_LAST
7766
7767used in GetCapability
7768
7769POLICY_SESSION_FIRST
7770
7771(HR_POLICY_SESSION + 0)
7772
7773first policy session
7774
7775POLICY_SESSION_LAST
7776
7777(POLICY_SESSION_FIRST + MAX_ACTIVE_SESSIONS-1)
7778 last policy session
7779
7780TRANSIENT_FIRST
7781
7782(HR_TRANSIENT + 0)
7783
7784first transient object
7785
7786ACTIVE_SESSION_FIRST
7787
7788POLICY_SESSION_FIRST
7789
7790used in GetCapability
7791
7792ACTIVE_SESSION_LAST
7793
7794POLICY_SESSION_LAST
7795
7796used in GetCapability
7797
7798TRANSIENT_LAST
7799
7800(TRANSIENT_FIRST+MAX_LOADED_OBJECTS-1)
7801
7802last transient object
7803
7804PERSISTENT_FIRST
7805
7806(HR_PERSISTENT + 0)
7807
7808first persistent object
7809
7810PERSISTENT_LAST
7811
7812(PERSISTENT_FIRST + 0x00FFFFFF)
7813
7814last persistent object
7815
7816PLATFORM_PERSISTENT
7817
7818(PERSISTENT_FIRST + 0x00800000)
7819
7820first platform persistent
7821object
7822
7823NV_INDEX_FIRST
7824
7825(HR_NV_INDEX + 0)
7826
7827first allowed NV Index
7828
7829NV_INDEX_LAST
7830
7831(NV_INDEX_FIRST + 0x00FFFFFF)
7832
7833last allowed NV Index
7834
7835PERMANENT_FIRST
7836
7837TPM_RH_FIRST
7838
7839PERMANENT_LAST
7840
7841TPM_RH_LAST
7842
7843Page 54
7844October 31, 2013
7845
7846Published
7847Copyright © TCG 2006-2013
7848
7849Family “2.0”
7850Level 00 Revision 00.99
7851
7852Trusted Platform Module Library
7853
7854Part 2: Structures
7855
7856Attribute Structures
7857
78588
78598.1
7860
7861Description
7862
7863Attributes are expressed as bit fields of varying size. An attribute field structure may be 1, 2, or 4 octets in
7864length.
7865The bit numbers for an attribute structure are assigned with the number 0 assigned to the least-significant
7866bit of the structure and the highest number assigned to the most-significant bit of the structure.
7867The least significant bit is determined by treating the attribute structure as an integer. The least-significant
7868bit would be the bit that is set when the value of the integer is 1.
7869When any reserved bit in an attribute is SET, the TPM shall return TPM_RC_RESERVED_BITS. This
7870response code is not shown in the tables for attributes.
78718.2
7872
7873TPMA_ALGORITHM
7874
7875This structure defines the attributes of an algorithm.
7876Each algorithm has a fundamental attribute: asymmetric, symmetric, or hash. In some cases (e.g.,
7877TPM_ALG_RSA or TPM_ALG_AES), this is the only attribute.
7878A mode, method, or scheme may have an associated asymmetric, symmetric, or hash algorithm.
7879Table 29 — Definition of (UINT32) TPMA_ALGORITHM Bits
7880Bit
7881
7882Name
7883
7884Definition
7885
78860
7887
7888asymmetric
7889
7890SET (1): an asymmetric algorithm with public and private portions
7891CLEAR (0): not an asymmetric algorithm
7892
78931
7894
7895symmetric
7896
7897SET (1): a symmetric block cipher
7898CLEAR (0): not a symmetric block cipher
7899
79002
7901
7902hash
7903
7904SET (1): a hash algorithm
7905CLEAR (0): not a hash algorithm
7906
79073
7908
7909object
7910
7911SET (1): an algorithm that may be used as an object type
7912CLEAR (0): an algorithm that is not used as an object type
7913
79147:4 Reserved
7915
79168
7917
7918signing
7919
7920SET (1): a signing algorithm. The setting of asymmetric, symmetric, and hash
7921will indicate the type of signing algorithm.
7922CLEAR (0): not a signing algorithm
7923
79249
7925
7926encrypting
7927
7928SET (1): an encryption/decryption algorithm. The setting of asymmetric,
7929symmetric, and hash will indicate the type of encryption/decryption algorithm.
7930CLEAR (0): not an encryption/decryption algorithm
7931
793210
7933
7934method
7935
7936SET (1): a method such as a key derivative function (KDF)
7937CLEAR (0): not a method
7938
793931:11 Reserved
7940
79418.3
79428.3.1
7943
7944TPMA_OBJECT (Object Attributes)
7945Introduction
7946
7947Family “2.0”
7948Level 00 Revision 00.99
7949
7950Published
7951Copyright © TCG 2006-2013
7952
7953Page 55
7954October 31, 2013
7955
7956Part 2: Structures
7957
7958Trusted Platform Module Library
7959
7960This attribute structure indicates an object’s use, its authorization types, and it relationship to other
7961objects.
7962The state of the attributes is determined when the object is created and they are never changed by the
7963TPM. Additionally, the setting of these structures is reflected in the integrity value of the private area of an
7964object in order to allow the TPM to detect modifications of the Protected Object when stored off the TPM.
79658.3.2
7966
7967Structure Definition
7968Table 30 — Definition of (UINT32) TPMA_OBJECT Bits
7969
7970Bit
7971
7972Name
7973
7974Definition
7975
79760 Reserved
7977
7978shall be zero
7979
79801
7981
7982fixedTPM
7983
7984SET (1): The hierarchy of the object, as indicated by its Qualified Name, may
7985not change.
7986CLEAR (0): The hierarchy of the object may change as a result of this object or
7987an ancestor key being duplicated for use in another hierarchy.
7988
79892
7990
7991stClear
7992
7993SET (1): Previously saved contexts of this object may not be loaded after
7994Startup(CLEAR).
7995CLEAR (0): Saved contexts of this object may be used after a
7996Shutdown(STATE) and subsequent Startup().
7997
79983 Reserved
7999
8000shall be zero
8001
80024
8003
8004fixedParent
8005
8006SET (1): The parent of the object may not change.
8007CLEAR (0): The parent of the object may change as the result of a
8008TPM2_Duplicate() of the object.
8009
80105
8011
8012sensitiveDataOrigin
8013
8014SET (1): Indicates that, when the object was created with TPM2_Create() or
8015TPM2_CreatePrimary(), the TPM generated all of the sensitive data other than
8016the authValue.
8017CLEAR (0): A portion of the sensitive data, other than the authValue, was
8018provided by the caller.
8019
80206
8021
8022userWithAuth
8023
8024SET (1): Approval of USER role actions with this object may be with an HMAC
8025session or with a password using the authValue of the object or a policy
8026session.
8027CLEAR (0): Approval of USER role actions with this object may only be done
8028with a policy session.
8029
80307
8031
8032adminWithPolicy
8033
8034SET (1): Approval of ADMIN role actions with this object may only be done with
8035a policy session.
8036CLEAR (0): Approval of ADMIN role actions with this object may be with an
8037HMAC session or with a password using the authValue of the object or a policy
8038session.
8039
80409:8 Reserved
8041
8042shall be zero
8043
804410
8045
8046noDA
8047
8048SET (1): The object is not subject to dictionary attack protections.
8049CLEAR (0): The object is subject to dictionary attack protections.
8050
805111
8052
8053encryptedDuplication
8054
8055SET (1): If the object is duplicated, then symmetricAlg shall not be
8056TPM_ALG_NULL and newParentHandle shall not be TPM_RH_NULL.
8057CLEAR (0): The object may be duplicated without an inner wrapper on the
8058private portion of the object and the new parent may be TPM_RH_NULL.
8059
806015:12 Reserved
806116
8062
8063restricted
8064
8065Page 56
8066October 31, 2013
8067
8068shall be zero
8069SET (1): Key usage is restricted to manipulate structures of known format; the
8070parent of this key shall have restricted SET.
8071CLEAR (0): Key usage is not restricted to use on special formats.
8072
8073Published
8074Copyright © TCG 2006-2013
8075
8076Family “2.0”
8077Level 00 Revision 00.99
8078
8079Trusted Platform Module Library
8080
8081Part 2: Structures
8082
8083Bit
8084
8085Name
8086
8087Definition
8088
808917
8090
8091decrypt
8092
8093SET (1): The private portion of the key may be used to decrypt.
8094CLEAR (0): The private portion of the key may not be used to decrypt.
8095
809618
8097
8098sign
8099
8100SET (1): The private portion of the key may be used to sign.
8101CLEAR (0): The private portion of the key may not be used to sign.
8102
810331:19 Reserved
8104
81058.3.3
81068.3.3.1
8107
8108shall be zero
8109
8110Attribute Descriptions
8111Introduction
8112
8113The following remaining paragraphs in this clause describe the use and settings for each of the
8114TPMA_OBJECT attributes. The description includes checks that are performed on the objectAttributes
8115when an object is created, when it is loaded, and when it is imported. In these descriptions:
8116Creation –
8117
8118indicates
8119settings
8120for
8121TPM2_CreatePrimary()
8122
8123the
8124
8125template
8126
8127parameter
8128
8129in
8130
8131TPM2_Create()
8132
8133or
8134
8135Load
8136
81378138
8139indicates settings for the inPublic parameter in TPM2_Load()
8140
8141Import
8142
81438144
8145indicates settings for the objectPublic parameter in TPM2_Import()
8146
8147External
8148
81498150
8151indicates settings that apply to the inPublic parameter in TPM2_LoadExternal() if both the
8152public and sensitive portions of the object are loaded
8153
8154NOTE
8155
8156For TPM2_LoadExternal() when only the public portion of the object is loaded, the only attribute checks
8157are the checks in the validation code following Table 30 and the reserved attributes check.
8158
8159For any consistency error of attributes in TPMA_OBJECT, the TPM shall return TPM_RC_ATTRIBUTES.
81608.3.3.2
8161
8162Bit[1] – fixedTPM
8163
8164When SET, the object cannot be duplicated for use on a different TPM, either directly or indirectly and the
8165Qualified Name of the object cannot change. When CLEAR, the object’s Qualified Name may change if
8166the object or an ancestor is duplicated.
8167NOTE
8168
8169This attribute is the logical inverse of the migratable attribute in 1.2. That is, when this attribute is C LEAR,
8170it is the equivalent to a 1.2 object with migratable SET.
8171
8172Creation –
8173
8174If fixedTPM is SET in the object's parent, then fixedTPM and fixedParent shall both be
8175set to the same value in template. If fixedTPM is CLEAR in the parent, this attribute shall
8176also be CLEAR in template.
8177NOTE
8178
8179For a Primary Object, the parent is considered to have fixedTPM SET.
8180
8181Load
8182
81838184
8185If fixedTPM is SET in the object's parent, then fixedTPM and fixedParent shall both be
8186set to the same value. If fixedTPM is CLEAR in the parent, this attribute shall also be
8187CLEAR.
8188
8189Import
8190
81918192
8193shall be CLEAR
8194
8195External
8196
81978198
8199shall be CLEAR if both the public and sensitive portions are loaded or if fixedParent is
8200CLEAR, otherwise may be SET or CLEAR
8201
8202Family “2.0”
8203Level 00 Revision 00.99
8204
8205Published
8206Copyright © TCG 2006-2013
8207
8208Page 57
8209October 31, 2013
8210
8211Part 2: Structures
82128.3.3.3
8213
8214Trusted Platform Module Library
8215
8216Bit[2] – stClear
8217
8218If this attribute is SET, then saved contexts of this object will be invalidated on
8219TPM2_Startup(TPM_SU_CLEAR). If the attribute is CLEAR, then the TPM shall not invalidate the saved
8220context if the TPM received TPM2_Shutdown(TPM_SU_STATE). If the saved state is valid when checked
8221at the next TPM2_Startup(), then the TPM shall continue to be able to use the saved contexts.
8222Creation –
8223
8224may be SET or CLEAR in template
8225
8226Load
8227
82288229
8230may be SET or CLEAR
8231
8232Import
8233
82348235
8236may be SET or CLEAR
8237
8238External
8239
82408241
8242may be SET or CLEAR
8243
82448.3.3.4
8245
8246Bit[4] – fixedParent
8247
8248If this attribute is SET, the object’s parent may not be changed. That is, this object may not be the object
8249of a TPM2_Duplicate(). If this attribute is CLEAR, then this object may be the object of a
8250TPM2_Duplicate().
8251Creation –
8252
8253may be SET or CLEAR in template
8254
8255Load
8256
82578258
8259may be SET or CLEAR
8260
8261Import
8262
82638264
8265shall be CLEAR
8266
8267External
8268
82698270
8271shall be CLEAR if both the public and sensitive portions are loaded; otherwise it may be
8272SET or CLEAR
8273
82748.3.3.5
8275
8276Bit[5] – sensitiveDataOrigin
8277
8278This attribute is SET for any key that was generated by TPM in TPM2_Create() or
8279TPM2_CreatePrimary(). If CLEAR, it indicates that the sensitive part of the object (other than the
8280obfuscation value) was provided by the caller.
8281NOTE 1
8282
8283If the fixedTPM attribute is SET, then this attribute is authoritative and accurately reflects the source of
8284the sensitive area data. If the fixedTPM attribute is CLEAR, then validation of this attribute requires
8285evaluation of the properties of the ancestor keys.
8286
8287Creation –
8288
8289If inSensitive.sensitive.data.size is zero, then this attribute shall be SET in the template;
8290otherwise, it shall be CLEAR in the template.
8291
8292NOTE 2
8293
8294The inSensitive.sensitive.data.size parameter is required to be zero for an asymmetric key so
8295sensitiveDataOrigin is required to be SET.
8296
8297NOTE 3
8298
8299The inSensitive.sensitive.data.size parameter may not be zero for a data object so sensitiveDataOrigin is
8300required to be CLEAR. A data object has type = TPM_ALG_KEYEDHASH and its sign and decrypt
8301attributes are CLEAR.
8302
8303Load
8304
83058306
8307may be SET or CLEAR
8308
8309Import
8310
83118312
8313may be SET or CLEAR
8314
8315External
8316
83178318
8319may be SET or CLEAR
8320
8321Page 58
8322October 31, 2013
8323
8324Published
8325Copyright © TCG 2006-2013
8326
8327Family “2.0”
8328Level 00 Revision 00.99
8329
8330Trusted Platform Module Library
83318.3.3.6
8332
8333Part 2: Structures
8334
8335Bit[6] – userWithAuth
8336
8337If SET, authorization for operations that require USER role authorization may be given if the caller
8338provides proof of knowledge of the authValue of the object with an HMAC authorization session or a
8339password.
8340If this attribute is CLEAR, then then HMAC or password authorizations may not be used for USER role
8341authorizations.
8342NOTE 1
8343
8344Regardless of the setting of this attribute, authorizations for operations th at require USER role
8345authorizations may be provided with a policy session that satisfies the object's authPolicy.
8346
8347NOTE 2
8348
8349Regardless of the setting of this attribute, the authValue may be referenced in a policy session or used to
8350provide the bind value in TPM2_StartAuthSession(). However, if userWithAuth is CLEAR, then the object
8351may be used as the bind object in TPM2_StartAuthSession() but the session cannot be used to authorize
8352actions on the object. If this were allowed, then the userWithAuth control could be circumvented simply by
8353using the object as the bind object.
8354
8355Creation –
8356
8357may be SET or CLEAR in template
8358
8359Load
8360
83618362
8363may be SET or CLEAR
8364
8365Import
8366
83678368
8369may be SET or CLEAR
8370
8371External
8372
83738374
8375may be SET or CLEAR
8376
83778.3.3.7
8378
8379Bit[7] – adminWithPolicy
8380
8381If CLEAR, authorization for operations that require ADMIN role may be given if the caller provides proof of
8382knowledge of the authValue of the object with an HMAC authorization session or a password.
8383If this attribute is SET, then then HMAC or password authorizations may not be used for ADMIN role
8384authorizations.
8385NOTE 1
8386
8387Regardless of the setting of this attribute, operations that require ADMIN role authorization may be
8388provided by a policy session that satisfies the object's authPolicy.
8389
8390NOTE 2
8391
8392This attribute is similar to userWithAuth but the logic is a bit different. When userWithAuth is CLEAR, the
8393authValue may not be used for USER mode authorizations. When adminWithPolicy is CLEAR, it means
8394that the authValue may be used for ADMIN role. Policy may always be used regardless of t he setting of
8395userWithAuth or adminWithPolicy.
8396
8397Actions that always require policy (TPM2_Duplicate()) are not affected by the setting of this attribute.
8398Creation –
8399
8400may be SET or CLEAR in template
8401
8402Load
8403
84048405
8406may be SET or CLEAR
8407
8408Import
8409
84108411
8412may be SET or CLEAR
8413
8414External
8415
84168417
8418may be SET or CLEAR
8419
84208.3.3.8
8421
8422Bit[10] – noDA
8423
8424If SET, then authorization failures for the object do not affect the dictionary attack protection logic and
8425authorization of the object is not blocked if the TPM is in lockout.
8426Creation –
8427
8428may be SET or CLEAR in template
8429
8430Load
8431
84328433
8434may be SET or CLEAR
8435
8436Import
8437
84388439
8440may be SET or CLEAR
8441
8442External
8443
84448445
8446may be SET or CLEAR
8447
8448Family “2.0”
8449Level 00 Revision 00.99
8450
8451Published
8452Copyright © TCG 2006-2013
8453
8454Page 59
8455October 31, 2013
8456
8457Part 2: Structures
84588.3.3.9
8459
8460Trusted Platform Module Library
8461
8462Bit[11] – encryptedDuplication
8463
8464If SET, then when the object is duplicated, the sensitive portion of the object is required to be encrypted
8465with an inner wrapper and the new parent shall be an asymmetric key and not TPM_RH_NULL
8466NOTE 1
8467
8468Enforcement of these requirements in TPM2_Duplicate() is by not allowing symmetricAlg to be
8469TPM_ALG_NULL and newParentHandle may not be TPM_RH_NULL.
8470
8471This attribute shall not be SET in any object that has fixedTPM SET.
8472NOTE 2
8473
8474This requirement means that encryptedDuplication may not be SET if the object cannot be directly or
8475indirectly duplicated.
8476
8477If an object's parent has fixedTPM SET, and the object is duplicable (fixedParent == CLEAR), then
8478encryptedDuplication may be SET or CLEAR in the object.
8479NOTE 3
8480
8481This allows the object at the boundary between duplicable and non -duplicable objects to have either
8482setting.
8483
8484If an object's parent has fixedTPM CLEAR, then the object is required to have the same setting of
8485encryptedDuplication as its parent.
8486NOTE 4
8487
8488This requirement forces all
8489encryptedDuplication setting.
8490
8491duplicable
8492
8493objects
8494
8495in
8496
8497a
8498
8499duplication
8500
8501group
8502
8503to
8504
8505have
8506
8507the
8508
8509same
8510
8511Creation –
8512
8513shall be CLEAR if fixedTPM is SET. If fixedTPM is CLEAR, then this attribute shall have
8514the same value as its parent unless fixedTPM is SET in the object's parent, in which
8515case, it may be SET or CLEAR.
8516
8517Load
8518
85198520
8521shall be CLEAR if fixedTPM is SET. If fixedTPM is CLEAR, then this attribute shall have
8522the same value as its parent, unless fixedTPM is SET the parent, in which case, it may
8523be SET or CLEAR.
8524
8525Import
8526
85278528
8529if fixedTPM is SET in the object's new parent, then this attribute may be SET or CLEAR,
8530otherwise, it shall have the same setting as the new parent.
8531
8532External
8533
85348535
8536may be SET or CLEAR.
8537
85388.3.3.10
8539
8540Bit[16] – restricted
8541
8542This this attribute modifies the decrypt and sign attributes of an object.
8543NOTE
8544
8545A key with this object CLEAR may not be a parent for another object.
8546
8547Creation –
8548
8549shall be CLEAR in template if neither sign nor decrypt is SET in template.
8550
8551Load
8552
85538554
8555shall be CLEAR if neither sign nor decrypt is SET in the object
8556
8557Import
8558
85598560
8561may be SET or CLEAR
8562
8563External
8564
85658566
8567shall be CLEAR
8568
8569Page 60
8570October 31, 2013
8571
8572Published
8573Copyright © TCG 2006-2013
8574
8575Family “2.0”
8576Level 00 Revision 00.99
8577
8578Trusted Platform Module Library
85798.3.3.11
8580
8581Part 2: Structures
8582
8583Bit[17] – decrypt
8584
8585When SET, the private portion of this key can be used to decrypt an external blob. If restricted is SET,
8586then the TPM will return an error if the external decrypted blob is not formatted as appropriate for the
8587command.
8588NOTE 1
8589
8590Since TPM-generated keys and sealed data will contain a hash and a structure tag, the TPM can ensure
8591that it is not being used to improperly decrypt and return sensitive data that should not be returned. The
8592only type of data that may be returned after decryption is a Sealed Data Object (a keyedHash object with
8593decrypt and sign CLEAR).
8594
8595When restricted is CLEAR, there are no restrictions on the use of the private portion of the key for
8596decryption and the key may be used to decrypt and return any structure encrypted by the public portion of
8597the key.
8598NOTE 2
8599
8600A key with this attribute SET may be a parent for another object if restricted is SET and sign is CLEAR.
8601
8602If decrypt is SET on an object with type set to TPM_ALG_KEYEDHASH, it indicates that the object is an
8603XOR encryption key.
8604Creation –
8605
8606may be SET or CLEAR in template
8607
8608Load
8609
86108611
8612may be SET or CLEAR
8613
8614Import
8615
86168617
8618may be SET or CLEAR
8619
8620External
8621
86228623
8624may be SET or CLEAR
8625
86268.3.3.12
8627
8628Bit[18] – sign
8629
8630When this attribute is SET, the private portion of this key may be used to sign a digest. If restricted is
8631SET, then the key may only be used to sign a digest that was computed by the TPM. A restricted signing
8632key may be used to sign a TPM-generated digest. If a structure is generated by the TPM, it will begin with
8633TPM_GENERATED_VALUE and the TPM may sign the digest of that structure. If the data is externally
8634supplied and has TPM_GENERATED_VALUE as its first octets, then the TPM will not sign a digest of
8635that data with a restricted signing key.
8636If restricted is CLEAR, then the key may be used to sign any digest, whether generated by the TPM or
8637externally provided.
8638NOTE 1
8639
8640Some asymmetric algorithms may not support both sign and decrypt being SET in the same key.
8641
8642If sign is SET on an object with type set to TPM_ALG_KEYEDHASH, it indicates that the object is an
8643HMAC key.
8644NOTE 2
8645
8646A key with this attribute SET may not be a parent for another object.
8647
8648Creation –
8649
8650shall not be SET if decrypt and restricted are both SET
8651
8652Load
8653
86548655
8656shall not be SET if decrypt and restricted are both SET
8657
8658Import
8659
86608661
8662shall not be SET if decrypt and restricted are both SET
8663
8664External
8665
86668667
8668shall not be SET if decrypt and restricted are both SET
8669
8670Family “2.0”
8671Level 00 Revision 00.99
8672
8673Published
8674Copyright © TCG 2006-2013
8675
8676Page 61
8677October 31, 2013
8678
8679Part 2: Structures
86808.4
8681
8682Trusted Platform Module Library
8683
8684TPMA_SESSION (Session Attributes)
8685
8686This octet in each session is used to identify the session type, indicate its relationship to any handles in
8687the command, and indicate its use in parameter encryption.
8688Table 31 — Definition of (UINT8) TPMA_SESSION Bits <IN/OUT>
8689Bit
8690
8691Name
8692
8693Meaning
8694
86950
8696
8697continueSession
8698
8699SET (1): In a command, this setting indicates that the session is to remain active
8700after successful completion of the command. In a response, it indicates that the
8701session is still active. If SET in the command, this attribute shall be SET in the
8702response.
8703CLEAR (0): In a command, this setting indicates that the TPM should close the
8704session and flush any related context when the command completes successfully. In
8705a response, it indicates that the session is closed and the context is no longer active.
8706This attribute has no meaning for a password authorization and the TPM will allow
8707any setting of the attribute in the command and SET the attribute in the response.
8708This attribute will only be CLEAR in one response for a logical session. If the attribute
8709is CLEAR, the context associated with the session is no longer in use and the space
8710is available. A session created after another session is ended may have the same
8711handle but logically is not the same session.
8712This attribute has no effect if the command does not complete successfully.
8713
87141
8715
8716auditExclusive
8717
8718SET (1): In a command, this setting indicates that the command should only be
8719executed if the session is exclusive at the start of the command. In a response, it
8720indicates that the session is exclusive. This setting is only allowed if the audit
8721attribute is SET.
8722CLEAR (0): If audit is CLEAR, then this field is reserved but the error is
8723TPM_RC_ATTRIBUTES rather than TPM_RC_RESERVED_BITS.
8724See "Exclusive Audit Session" clause in Part 1.
8725
87262
8727
8728auditReset
8729
8730SET (1): In a command, this setting indicates that the audit digest of the session
8731should be initialized and the exclusive status of the session SET.
8732CLEAR (0): If audit is CLEAR, then this field is reserved but the error is
8733TPM_RC_ATTRIBUTES rather than TPM_RC_RESERVED_BITS. This setting is
8734always used for a response.
8735
87364:3 Reserved
8737
8738shall be CLEAR
8739
8740decrypt
8741
8742SET (1): In a command, this setting indicates that the first parameter in the command
8743is symmetrically encrypted using the parameter encryption scheme described in Part
87441. The TPM will decrypt the parameter after performing any HMAC computations and
8745before unmarshaling the parameter. In a response, the attribute is copied from the
8746request but has no effect on the response.
8747CLEAR (0): Session not used for encryption.
8748
87495
8750
8751For a password authorization, this attribute will be CLEAR in both the command and
8752response.
8753This attribute may only be SET in one session per command.
8754This attribute may be SET in a session that is not associated with a command
8755handle. Such a session is provided for purposes of encrypting a parameter and not
8756for authorization.
8757This attribute may be SET in combination with any other session attributes.
8758This attribute may only be SET if the first parameter of the command is a sized buffer
8759(TPM2B_).
8760
8761Page 62
8762October 31, 2013
8763
8764Published
8765Copyright © TCG 2006-2013
8766
8767Family “2.0”
8768Level 00 Revision 00.99
8769
8770Trusted Platform Module Library
8771
8772Part 2: Structures
8773
8774Bit
8775
8776Name
8777
8778Meaning
8779
87806
8781
8782encrypt
8783
8784SET (1): In a command, this setting indicates that the TPM should use this session to
8785encrypt the first parameter in the response. In a response, it indicates that the
8786attribute was set in the command and that the TPM used the session to encrypt the
8787first parameter in the response using the parameter encryption scheme described in
8788Part 1 of this specification.
8789CLEAR (0): Session not used for encryption.
8790For a password authorization, this attribute will be CLEAR in both the command and
8791response.
8792This attribute may only be SET in one session per command.
8793This attribute may be SET in a session that is not associated with a command
8794handle. Such a session is provided for purposes of encrypting a parameter and not
8795for authorization.
8796This attribute may only be SET if the first parameter of a response is a sized buffer
8797(TPM2B_).
8798
87997
8800
8801SET (1): In a command or response, this setting indicates that the session is for audit
8802and that auditExclusive and auditReset have meaning. This session may also be
8803used for authorization, encryption, or decryption. The encrypted and encrypt fields
8804may be SET or CLEAR.
8805CLEAR (0): Session is not used for audit.
8806
8807audit
8808
8809This attribute may only be SET in one session per command or response. If SET in
8810the command, then this attribute will be SET in the response.
8811
88128.5
8813
8814TPMA_LOCALITY (Locality Attribute)
8815
8816In a TPMS_CREATION_DATA structure, this structure is used to indicate the locality of the command that
8817created the object. No more than one of the locality attributes shall be set in the creation data.
8818When used in TPM2_PolicyLocality(), this structure indicates which localities are approved by the policy.
8819When a policy is started, all localities are allowed. If TPM2_PolicyLocality() is executed, it indicates that
8820the command may only be executed at specific localities. More than one locality may be selected.
8821EXAMPLE 1
8822
8823TPM_LOC_TWO would indicate that only locality 2 is authorized.
8824
8825EXAMPLE 2
8826
8827TPM_LOC_ONE + TPM_LOC_TWO would indicate that locality 1 or 2 is authorized.
8828
8829EXAMPLE 3
8830
8831TPM_LOC_FOUR + TPM_LOC_THREE would indicate that localities 3 or 4 are authorized.
8832
8833EXAMPLE 4
8834
8835A value of 21 16 would represent a locality of 33.
8836
8837NOTE
8838
8839Locality values of 5 through 31 are not selectable.
8840
8841Family “2.0”
8842Level 00 Revision 00.99
8843
8844Published
8845Copyright © TCG 2006-2013
8846
8847Page 63
8848October 31, 2013
8849
8850Part 2: Structures
8851
8852Trusted Platform Module Library
8853
8854If Extended is non-zero, then an extended locality is indicated and the TPMA_LOCALITY contains an
8855integer value.
8856Table 32 — Definition of (UINT8) TPMA_LOCALITY Bits <IN/OUT>
8857Bit
8858
8859Name
8860
8861Definition
8862
88630
8864
8865TPM_LOC_ZERO
8866
88671
8868
8869TPM_LOC_ONE
8870
88712
8872
8873TPM_LOC_TWO
8874
88753
8876
8877TPM_LOC_THREE
8878
88794
8880
8881TPM_LOC_FOUR
8882
88837:5
8884
88858.6
8886
8887Extended
8888
8889If any of these bits is set, an extended locality is indicated
8890
8891TPMA_PERMANENT
8892
8893The attributes in this structure are persistent and are not changed as a result of _TPM_Init or any
8894TPM2_Startup(). Some of the attributes in this structure may change as the result of specific Protected
8895Capabilities.
8896This
8897structure
8898may
8899be
8900read
8901using
8902TPM2_GetCapability(capability
8903=
8904TPM_CAP_TPM_PROPERTIES, property = TPM_PT_PERMANENT).
8905Table 33 — Definition of (UINT32) TPMA_PERMANENT Bits <OUT>
8906Bit
8907
8908Parameter
8909
8910Description
8911
89120
8913
8914ownerAuthSet
8915
8916SET (1): TPM2_HierarchyChangeAuth() with ownerAuth has been executed since
8917the last TPM2_Clear().
8918CLEAR (0): ownerAuth has not been changed since TPM2_Clear().
8919
89201
8921
8922endorsementAuthSet
8923
8924SET (1): TPM2_HierarchyChangeAuth() with endorsementAuth has been executed
8925since the last TPM2_Clear().
8926CLEAR (0): endorsementAuth has not been changed since TPM2_Clear().
8927
89282
8929
8930lockoutAuthSet
8931
8932SET (1): TPM2_HierarchyChangeAuth() with lockoutAuth has been executed since
8933the last TPM2_Clear().
8934CLEAR (0): lockoutAuth has not been changed since TPM2_Clear().
8935
89367:3 Reserved
8937
89388
8939
8940disableClear
8941
8942SET (1): TPM2_Clear() is disabled.
8943CLEAR (0): TPM2_Clear() is enabled.
8944NOTE
8945
8946See “TPM2_ClearControl” in Part 3 of this specification for details on changing
8947this attribute.
8948
89499
8950
8951inLockout
8952
8953SET (1): The TPM is in lockout and commands that require authorization with other
8954than platformAuth will not succeed.
8955
895610
8957
8958tpmGeneratedEPS
8959
8960SET (1): The EPS was created by the TPM.
8961CLEAR (0): The EPS was created outside of the TPM using a manufacturerspecific process.
8962
896331:11 Reserved
8964
8965Page 64
8966October 31, 2013
8967
8968Published
8969Copyright © TCG 2006-2013
8970
8971Family “2.0”
8972Level 00 Revision 00.99
8973
8974Trusted Platform Module Library
89758.7
8976
8977Part 2: Structures
8978
8979TPMA_STARTUP_CLEAR
8980
8981These attributes are set to their default state on reset on each TPM Reset or TPM Restart. The attributes
8982are preserved on TPM Resume.
8983On each TPM2_Startup(TPM_SU_CLEAR), the TPM will set these attributes to their indicated defaults.
8984This structure may be read using TPM2_GetCapability(capability = TPM_CAP_TPM_PROPERTIES,
8985property = TPM_PT_STARTUP_CLEAR).
8986Some of attributes may be changed as the result of specific Protected Capabilities.
8987Table 34 — Definition of (UINT32) TPMA_STARTUP_CLEAR Bits <OUT>
8988Bit
89890
8990
8991Parameter
8992
8993Description
8994
8995phEnable
8996
8997SET (1): (default) The platform hierarchy is enabled and platformAuth or
8998platformPolicy may be used for authorization.
8999CLEAR (0): platformAuth and platformPolicy may not be used for authorizations,
9000and objects in the platform hierarchy, including NV Indexes and persistent objects,
9001cannot be used.
9002NOTE
9003
90041
9005
9006shEnable
9007
9008SET (1): (default) The Storage hierarchy is enabled and ownerAuth or ownerPolicy
9009may be used for authorization.
9010CLEAR (0): ownerAuth and ownerPolicy may not be used for authorizations, and
9011objects in the Storage hierarchy, including NV Indexes and persistent objects,
9012cannot be used.
9013NOTE
9014
90152
9016
9017ehEnable
9018
9019phEnableNV
9020
9021See “TPM2_HierarchyControl” in Part 3 of this specification for details on
9022changing this attribute.
9023
9024SET (1): (default) The EPS hierarchy is enabled and endorsementAuth may be
9025used to authorize commands.
9026CLEAR (0): endorsementAuth and endorsementPolicy may not be used for
9027authorizations, and objects in the endorsement hierarchy, including persistent
9028objects, cannot be used.
9029NOTE
9030
90313
9032
9033See “TPM2_HierarchyControl” in Part 3 of this specification for details on
9034changing this attribute.
9035
9036See “TPM2_HierarchyControl” in Part 3 of this specification for details on
9037changing this attribute.
9038
9039SET (1): (default) NV indices that have TPMA_PLATFORM_CREATE SET may be
9040read or written. The platform can create define and undefine indices.
9041CLEAR (0): NV indices that have TPMA_PLATFORM_CREATE SET may not be
9042read or written (TPM_RC_HANDLE). The platform cannot
9043define
9044(TPM_RC_HIERARCHY) or undefined (TPM_RC_HANDLE) indices.
9045NOTE
9046See “TPM2_HierarchyControl” in Part 3 of this specification for details on changing
9047this attribute.
9048NOTE
9049read refers to these commands: TPM2_NV_Read, TPM2_NV_ReadPublic, TPM_NV_Certify,
9050TPM2_PolicyNV
9051write refers to thse commands: TPM2_NV_Write, TPM2_NV_Increment, TPM2_NV_Extend,
9052TPM2_NV_SetBits
9053NOTE The TPM must query the index TPMA_PLATFORM_CREATE attribute to determine
9054whether phEnableNV is applicable. Since the TPM will return TPM_RC_HANDLE if the index
9055does not exist, it also returns this error code if the index is disabled. Otherwise, the TPM
9056would leak the existence of an index even when disabled.
9057
905830:4 Reserved
9059
9060Family “2.0”
9061Level 00 Revision 00.99
9062
9063shall be zero
9064
9065Published
9066Copyright © TCG 2006-2013
9067
9068Page 65
9069October 31, 2013
9070
9071Part 2: Structures
9072
9073Trusted Platform Module Library
9074
9075Bit
9076
9077Parameter
9078
9079Description
9080
908131
9082
9083orderly
9084
9085SET (1): The TPM received a TPM2_Shutdown() and a matching TPM2_Startup().
9086CLEAR (0): TPM2_Startup(TPM_SU_CLEAR) was not preceded by a
9087TPM2_Shutdown() of any type.
9088NOTE
9089
90908.8
9091
9092A shutdown is orderly if the TPM receives a TPM2_Shutdown() of any type
9093followed by a TPM2_Startup() of any type. However, the TPM will return an error if
9094TPM2_Startup(TPM_SU_STATE)
9095was
9096not
9097preceded
9098by
9099TPM2_State_Save(TPM_SU_STATE).
9100
9101TPMA_MEMORY
9102
9103This structure of this attribute is used to report the memory management method used by the TPM for
9104transient
9105objects
9106and
9107authorization
9108sessions.
9109This
9110structure
9111may be
9112read
9113using
9114TPM2_GetCapability(capability = TPM_CAP_TPM_PROPERTIES, property = TPM_PT_MEMORY).
9115If the RAM memory is shared, then context save of a session may make it possible to load an additional
9116transient object.
9117Table 35 — Definition of (UINT32) TPMA_MEMORY Bits <Out>
9118Bit
9119
9120Name
9121
9122Definition
9123
91240
9125
9126sharedRAM
9127
9128SET (1): indicates that the RAM memory used for authorization session
9129contexts is shared with the memory used for transient objects
9130CLEAR (0): indicates that the memory used for authorization sessions is not
9131shared with memory used for transient objects
9132
91331
9134
9135sharedNV
9136
9137SET (1): indicates that the NV memory used for persistent objects is shared
9138with the NV memory used for NV Index values
9139CLEAR (0): indicates that the persistent objects and NV Index values are
9140allocated from separate sections of NV
9141
91422
9143
9144objectCopiedToRam
9145
9146SET (1): indicates that the TPM copies persistent objects to a transient-object
9147slot in RAM when the persistent object is referenced in a command. The TRM
9148is required to make sure that an object slot is available.
9149CLEAR (0): indicates that the TPM does not use transient-object slots when
9150persistent objects are referenced
9151
915231:3 Reserved
9153
9154shall be zero
9155
9156Page 66
9157October 31, 2013
9158
9159Published
9160Copyright © TCG 2006-2013
9161
9162Family “2.0”
9163Level 00 Revision 00.99
9164
9165Trusted Platform Module Library
91668.9
9167
9168Part 2: Structures
9169
9170TPMA_CC (Command Code Attributes)
9171
91728.9.1
9173
9174Introduction
9175
9176This structure defines the attributes of a command from a context management perspective. The fields of
9177the structure indicate to the TPM Resource Manager (TRM) the number of resources required by a
9178command and how the command affects the TPM’s resources.
9179This structure is only used in a list returned by the TPM in response to TPM2_GetCapability(capability =
9180TPM_CAP_COMMANDS).
9181For a command to the TPM, only the commandIndex field and V attribute are allowed to be non-zero.
91828.9.2
9183
9184Structure Definition
9185Table 36 — Definition of (TPM_CC) TPMA_CC Bits <OUT>
9186
9187Bit
918815:0
9189
9190Name
9191
9192Definition
9193
9194commandIndex
9195
9196indicates the command being selected
9197
919821:16 Reserved
9199
9200shall be zero
9201
920222
9203
9204nv
9205
9206SET (1): indicates that the command may write to NV
9207CLEAR (0): indicates that the command does not write to NV
9208
920923
9210
9211extensive
9212
9213SET (1): This command could flush any number of loaded contexts.
9214CLEAR (0): no additional changes other than indicated by the flushed attribute
9215
921624
9217
9218flushed
9219
9220SET (1): The context associated with any transient handle in the command will
9221be flushed when this command completes.
9222CLEAR (0): No context is flushed as a side effect of this command.
9223
922427:25 cHandles
9225
9226indicates the number of the handles in the handle area for this command
9227
922828
9229
9230rHandle
9231
9232SET (1): indicates the presence of the handle area in the input
9233
923429
9235
9236V
9237
9238SET (1): indicates that the command is vendor-specific
9239CLEAR (0): indicates that the command is defined in a version of this
9240specification
9241
924231:30 Res
9243
92448.9.3
92458.9.3.1
9246
9247allocated for software; shall be zero
9248
9249Field Descriptions
9250Bits[15:0] – commandIndex
9251
9252This is the command index of the command in the set of commands. The two sets are defined by the V
9253attribute. If V is zero, then the commandIndex shall be in the set of commands defined in a version of this
9254specification. If V is one, then the meaning of commandIndex is as determined by the TPM vendor.
92558.9.3.2
9256
9257Bit[22] – nv
9258
9259If this attribute is SET, then the TPM may perform an NV write as part of the command actions. This write
9260is independent of any write that may occur as a result of dictionary attack protection. If this attribute is
9261CLEAR, then the TPM shall not perform an NV write as part of the command actions.
92628.9.3.3
9263
9264Bit[23] – extensive
9265
9266Family “2.0”
9267Level 00 Revision 00.99
9268
9269Published
9270Copyright © TCG 2006-2013
9271
9272Page 67
9273October 31, 2013
9274
9275Part 2: Structures
9276
9277Trusted Platform Module Library
9278
9279If this attribute is SET, then the TPM may flush many transient objects as a side effect of this command.
9280In Part 3, a command that has this attribute is indicated by using a “{E}” decoration in the “Description”
9281column of the commandCode parameter.
9282EXAMPLE
9283
9284See “TPM2_Clear” in Part 3.
9285
9286NOTE
9287
9288The “{E}” decoration may be combined with other decorations such as “{NV}” in which case the decoration
9289would be “{NV E}.”
9290
92918.9.3.4
9292
9293Bit[24] – flushed
9294
9295If this attribute is SET, then the TPM will flush transient objects as a side effect of this command. Any
9296transient objects listed in the handle area of the command will be flushed from TPM memory. Handles
9297associated with persistent objects, sessions, PCR, or other fixed TPM resources are not flushed.
9298NOTE
9299
9300The TRM is expected to use this value to determine how many objects are loaded into transient TPM
9301memory.
9302
9303NOTE
9304
9305The “{F}” decoration may be combined with other decorations such as “{NV}” in which case the decoration
9306would be “{NV F}.”
9307
9308If this attribute is SET for a command, and the handle of the command is associated with a hierarchy
9309(TPM_RH_PLATFORM, TPM_RH_OWNER, or TPM_RH_ENDORSEMENT), all loaded objects in the
9310indicated hierarchy are flushed.
9311The TRM is expected to know the behaviour of TPM2_ContextSave(), and sessions are flushed when
9312context saved, but objects are not. The flushed attribute for that command shall be CLEAR.
9313In Part 3, a command that has this attribute is indicated by using a “{F}” decoration in the “Description”
9314column of the commandCode parameter.
9315EXAMPLE
9316
93178.9.3.5
9318
9319See “TPM2_SequenceComplete” in Part 3.”
9320
9321Bits[27:25] – cHandles
9322
9323This field indicates the number of handles in the handle area of the command. This number allows the
9324TRM to enumerate the handles in the handle area and find the position of the authorizations (if any).
93258.9.3.6
9326
9327Bit[28] – rHandle
9328
9329If this attribute is SET, then the response to this command has a handle area. This area will contain no
9330more than one handle. This field is necessary to allow the TRM to locate the parameterSize field in the
9331response, which is then used to locate the authorizations.
9332NOTE
9333
9334The TRM is expected to “virtualize” the handle value for any returned handle.
9335
9336Page 68
9337October 31, 2013
9338
9339Published
9340Copyright © TCG 2006-2013
9341
9342Family “2.0”
9343Level 00 Revision 00.99
9344
9345Trusted Platform Module Library
9346
9347Part 2: Structures
9348
9349A TPM command is only allowed to have one handle in the session area.
93508.9.3.7
9351
9352Bit[29] – V
9353
9354When this attribute is SET, it indicates that the command operation is defined by the TPM vendor. When
9355CLEAR, it indicates that the command is defined by a version of this specification.
93568.9.3.8
9357
9358Bits[31:30] – Res
9359
9360This field is reserved for system software. This field is required to be zero for a command to the TPM.
9361
9362Family “2.0”
9363Level 00 Revision 00.99
9364
9365Published
9366Copyright © TCG 2006-2013
9367
9368Page 69
9369October 31, 2013
9370
9371Part 2: Structures
9372
93739
9374
9375Trusted Platform Module Library
9376
9377Interface Types
9378
93799.1
9380
9381Introduction
9382
9383This clause contains definitions for interface types. An interface type is type checked when it is
9384unmarshaled. These types are based on an underlying type that is indicated in the table title by the value
9385in parentheses. When an interface type is used, the base type is unmarshaled and then checked to see if
9386it has one of the allowed values.
93879.2
9388
9389TPMI_YES_NO
9390
9391This interface type is used in place of a Boolean type in order to eliminate ambiguity in the handling of a
9392octet that conveys a single bit of information. This type only has two allowed values, YES (1) and NO (0).
9393NOTE
9394
9395This list is not used as input to the TPM.
9396
9397Table 37 — Definition of (BYTE) TPMI_YES_NO Type
9398Value
9399
9400Description
9401
9402NO
9403
9404a value of 0
9405
9406YES
9407
9408a value of 1
9409
9410#TPM_RC_VALUE
9411
94129.3
9413
9414TPMI_DH_OBJECT
9415
9416The TPMI_DH_OBJECT interface type is a handle that references a loaded object. The handles in this
9417set are used to refer to either transient or persistent object. The range of these values would change
9418according to the TPM implementation.
9419NOTE
9420
9421These interface types should not be used by system software to qualify the keys produced by the TPM.
9422The value returned by the TPM shall be used to reference the object.
9423
9424Table 38 — Definition of (TPM_HANDLE) TPMI_DH_OBJECT Type
9425Values
9426
9427Comments
9428
9429{TRANSIENT_FIRST:TRANSIENT_LAST}
9430
9431allowed range for transient objects
9432
9433{PERSISTENT_FIRST:PERSISTENT_LAST}
9434
9435allowed range for persistent objects
9436
9437+TPM_RH_NULL
9438
9439the conditional value
9440
9441#TPM_RC_VALUE
9442
9443Page 70
9444October 31, 2013
9445
9446Published
9447Copyright © TCG 2006-2013
9448
9449Family “2.0”
9450Level 00 Revision 00.99
9451
9452Trusted Platform Module Library
94539.4
9454
9455Part 2: Structures
9456
9457TPMI_DH_PERSISTENT
9458
9459The TPMI_DH_PERSISTENT interface type is a handle that references a location for a transient object.
9460This type is used in TPM2_EvictControl() to indicate the handle to be assigned to the persistent object.
9461Table 39 — Definition of (TPM_HANDLE) TPMI_DH_PERSISTENT Type
9462Values
9463
9464Comments
9465
9466{PERSISTENT_FIRST:PERSISTENT_LAST}
9467
9468allowed range for persistent objects
9469
9470#TPM_RC_VALUE
9471
94729.5
9473
9474TPMI_DH_ENTITY
9475
9476The TPMI_DH_ENTITY interface type is TPM-defined values that are used to indicate that the handle
9477refers to an authValue. The range of these values would change according to the TPM implementation.
9478Table 40 — Definition of (TPM_HANDLE) TPMI_DH_ENTITY Type <IN>
9479Values
9480
9481Comments
9482
9483TPM_RH_OWNER
9484TPM_RH_ENDORSEMENT
9485TPM_RH_PLATFORM
9486TPM_RH_LOCKOUT
9487{TRANSIENT_FIRST:TRANSIENT_LAST}
9488
9489range of object handles
9490
9491{PERSISTENT_FIRST:PERSISTENT_LAST}
9492{NV_INDEX_FIRST:NV_INDEX_LAST}
9493{PCR_FIRST:PCR_LAST}
9494+TPM_RH_NULL
9495
9496conditional value
9497
9498#TPM_RC_VALUE
9499
9500Family “2.0”
9501Level 00 Revision 00.99
9502
9503Published
9504Copyright © TCG 2006-2013
9505
9506Page 71
9507October 31, 2013
9508
9509Part 2: Structures
95109.6
9511
9512Trusted Platform Module Library
9513
9514TPMI_DH_PCR
9515
9516This interface type consists of the handles that may be used as PCR references. The upper end of this
9517range of values would change according to the TPM implementation.
9518NOTE 1
9519
9520Typically, the 0 th PCR will have a handle value of zero.
9521
9522NOTE 2
9523
9524The handle range for PCR is defined to be the same as the handle range for PCR in previous versions of
9525TPM specifications.
9526
9527Table 41 — Definition of (TPM_HANDLE) TPMI_DH_PCR Type <IN>
9528Values
9529
9530Comments
9531
9532{PCR_FIRST:PCR_LAST}
9533+TPM_RH_NULL
9534
9535conditional value
9536
9537#TPM_RC_VALUE
9538
95399.7
9540
9541TPMI_SH_AUTH_SESSION
9542
9543The TPMI_SH_AUTH_SESSION interface type is TPM-defined values that are used to indicate that the
9544handle refers to an authorization session.
9545Table 42 — Definition of (TPM_HANDLE) TPMI_SH_AUTH_SESSION Type <IN/OUT>
9546Values
9547
9548Comments
9549
9550{HMAC_SESSION_FIRST:HMAC_SESSION_LAST}
9551
9552range of HMAC authorization session handles
9553
9554{POLICY_SESSION_FIRST:POLICY_SESSION_LAST}
9555
9556range of policy authorization session handles
9557
9558+TPM_RS_PW
9559
9560a password authorization
9561
9562#TPM_RC_VALUE
9563
9564error returned if the handle is out of range
9565
95669.8
9567
9568TPMI_SH_HMAC
9569
9570This interface type is used for an authorization handle when the authorization session uses an HMAC.
9571Table 43 — Definition of (TPM_HANDLE) TPMI_SH_HMAC Type <IN/OUT>
9572Values
9573
9574Comments
9575
9576{HMAC_SESSION_FIRST:HMAC_SESSION_LAST}
9577
9578range of HMAC authorization session handles
9579
9580#TPM_RC_VALUE
9581
9582error returned if the handle is out of range
9583
95849.9
9585
9586TPMI_SH_POLICY
9587
9588This interface type is used for a policy handle when it appears in a policy command.
9589Table 44 — Definition of (TPM_HANDLE) TPMI_SH_POLICY Type <IN/OUT>
9590Values
9591
9592Comments
9593
9594{POLICY_SESSION_FIRST:POLICY_SESSION_LAST}
9595
9596range of policy authorization session handles
9597
9598#TPM_RC_VALUE
9599
9600error returned if the handle is out of range
9601
9602Page 72
9603October 31, 2013
9604
9605Published
9606Copyright © TCG 2006-2013
9607
9608Family “2.0”
9609Level 00 Revision 00.99
9610
9611Trusted Platform Module Library
9612
9613Part 2: Structures
9614
96159.10 TPMI_DH_CONTEXT
9616This type defines the handle values that may be used in TPM2_ContextSave() or TPM2_Flush().
9617Table 45 — Definition of (TPM_HANDLE) TPMI_DH_CONTEXT Type
9618Values
9619
9620Comments
9621
9622{HMAC_SESSION_FIRST:HMAC_SESSION_LAST}
9623{POLICY_SESSION_FIRST:POLICY_SESSION_LAST}
9624{TRANSIENT_FIRST:TRANSIENT_LAST}
9625#TPM_RC_VALUE
9626
96279.11 TPMI_RH_HIERARCHY
9628The TPMI_RH_HIERARCHY interface type is used as the type of a handle in a command when the
9629handle is required to be one of the hierarchy selectors.
9630Table 46 — Definition of (TPM_HANDLE) TPMI_RH_HIERARCHY Type
9631Values
9632
9633Comments
9634
9635TPM_RH_OWNER
9636
9637Storage hierarchy
9638
9639TPM_RH_PLATFORM
9640
9641Platform hierarchy
9642
9643TPM_RH_ENDORSEMENT
9644
9645Endorsement hierarchy
9646
9647+TPM_RH_NULL
9648
9649no hierarchy
9650
9651#TPM_RC_VALUE
9652
9653response code returned when the unmarshaling of this type fails
9654
96559.12 TPMI_RH_ENABLES
9656The TPMI_RH_ENABLES interface type is used as the type of a handle in a command when the handle
9657is required to be one of the hierarchy or NV enables.
9658Table 47 — Definition of (TPM_HANDLE) TPMI_RH_ENABLES Type
9659Values
9660
9661Comments
9662
9663TPM_RH_OWNER
9664
9665Storage hierarchy
9666
9667TPM_RH_PLATFORM
9668
9669Platform hierarchy
9670
9671TPM_RH_ENDORSEMENT
9672
9673Endorsement hierarchy
9674
9675TPM_RH_PLATFORM_NV
9676
9677Platform NV
9678
9679+TPM_RH_NULL
9680
9681no hierarchy
9682
9683#TPM_RC_VALUE
9684
9685response code returned when the unmarshaling of this type fails
9686
9687Family “2.0”
9688Level 00 Revision 00.99
9689
9690Published
9691Copyright © TCG 2006-2013
9692
9693Page 73
9694October 31, 2013
9695
9696Part 2: Structures
9697
9698Trusted Platform Module Library
9699
97009.13 TPMI_RH_HIERARCHY_AUTH
9701This interface type is used as the type of a handle in a command when the handle is required to be one of
9702the hierarchy selectors or the Lockout Authorization.
9703Table 48 — Definition of (TPM_HANDLE) TPMI_RH_HIERARCHY_AUTH Type <IN>
9704Values
9705
9706Comments
9707
9708TPM_RH_OWNER
9709
9710Storage hierarchy
9711
9712TPM_RH_PLATFORM
9713
9714Platform hierarchy
9715
9716TPM_RH_ENDORSEMENT
9717
9718Endorsement hierarchy
9719
9720TPM_RH_LOCKOUT
9721
9722Lockout Authorization
9723
9724#TPM_RC_VALUE
9725
9726response code returned when the unmarshaling of this type fails
9727
97289.14 TPMI_RH_PLATFORM
9729The TPMI_RH_PLATFORM interface type is used as the type of a handle in a command when the only
9730allowed handle is TPM_RH_PLATFORM indicating that platformAuth is required.
9731Table 49 — Definition of (TPM_HANDLE) TPMI_RH_PLATFORM Type <IN>
9732Values
9733
9734Comments
9735
9736TPM_RH_PLATFORM
9737
9738Platform hierarchy
9739
9740#TPM_RC_VALUE
9741
9742response code returned when the unmarshaling of this type fails
9743
97449.15 TPMI_RH_OWNER
9745This interface type is used as the type of a handle in a command when the only allowed handle is
9746TPM_RH_OWNER indicating that ownerAuth is required.
9747Table 50 — Definition of (TPM_HANDLE) TPMI_RH_OWNER Type <IN>
9748Values
9749
9750Comments
9751
9752TPM_RH_OWNER
9753
9754Owner hierarchy
9755
9756+TPM_RH_NULL
9757
9758may allow the null handle
9759
9760#TPM_RC_VALUE
9761
9762response code returned when the unmarshaling of this type fails
9763
9764Page 74
9765October 31, 2013
9766
9767Published
9768Copyright © TCG 2006-2013
9769
9770Family “2.0”
9771Level 00 Revision 00.99
9772
9773Trusted Platform Module Library
9774
9775Part 2: Structures
9776
97779.16 TPMI_RH_ENDORSEMENT
9778This interface type is used as the type of a handle in a command when the only allowed handle is
9779TPM_RH_ENDORSEMENT indicating that endorsementAuth is required.
9780Table 51 — Definition of (TPM_HANDLE) TPMI_RH_ENDORSEMENT Type <IN>
9781Values
9782
9783Comments
9784
9785TPM_RH_ENDORSEMENT
9786
9787Endorsement hierarchy
9788
9789+TPM_RH_NULL
9790
9791may allow the null handle
9792
9793#TPM_RC_VALUE
9794
9795response code returned when the unmarshaling of this type fails
9796
97979.17 TPMI_RH_PROVISION
9798The TPMI_RH_PROVISION interface type is used as the type of the handle in a command when the only
9799allowed handles are either TPM_RH_OWNER or TPM_RH_PLATFORM indicating that either
9800platformAuth or ownerAuth are allowed.
9801In most cases, either platformAuth or ownerAuth may be used to authorize the commands used for
9802management of the resources of the TPM and this interface type will be used.
9803Table 52 — Definition of (TPM_HANDLE) TPMI_RH_PROVISION Type <IN>
9804Value
9805
9806Comments
9807
9808TPM_RH_OWNER
9809
9810handle for ownerAuth
9811
9812TPM_RH_PLATFORM
9813
9814handle for platformAuth
9815
9816#TPM_RC_VALUE
9817
9818response code returned when the unmarshaling of this type fails
9819
98209.18 TPMI_RH_CLEAR
9821The TPMI_RH_CLEAR interface type is used as the type of the handle in a command when the only
9822allowed handles are either TPM_RH_LOCKOUT or TPM_RH_PLATFORM indicating that either
9823platformAuth or lockoutAuth are allowed.
9824This interface type is normally used for performing or controlling TPM2_Clear().
9825Table 53 — Definition of (TPM_HANDLE) TPMI_RH_CLEAR Type <IN>
9826Value
9827
9828Comments
9829
9830TPM_RH_LOCKOUT
9831
9832handle for lockoutAuth
9833
9834TPM_RH_PLATFORM
9835
9836handle for platformAuth
9837
9838#TPM_RC_VALUE
9839
9840response code returned when the unmarshaling of this type fails
9841
9842Family “2.0”
9843Level 00 Revision 00.99
9844
9845Published
9846Copyright © TCG 2006-2013
9847
9848Page 75
9849October 31, 2013
9850
9851Part 2: Structures
9852
9853Trusted Platform Module Library
9854
98559.19 TPMI_RH_NV_AUTH
9856This interface type is used to identify the source of the authorization for access to an NV location. The
9857handle value of a TPMI_RH_NV_AUTH shall indicate that the authorization value is either platformAuth,
9858ownerAuth, or the authValue. This type is used in the commands that access an NV Index (commands of
9859the form TPM2_NV_xxx) other than TPM2_NV_DefineSpace() and TPM2_NV_UndefineSpace().
9860Table 54 — Definition of (TPM_HANDLE) TPMI_RH_NV_AUTH Type <IN>
9861Value
9862
9863Comments
9864
9865TPM_RH_PLATFORM
9866
9867platformAuth is allowed
9868
9869TPM_RH_OWNER
9870
9871ownerAuth is allowed
9872
9873{NV_INDEX_FIRST:NV_INDEX_LAST}
9874
9875range for NV locations
9876
9877#TPM_RC_VALUE
9878
9879response code returned when unmarshaling of this type fails
9880
98819.20 TPMI_RH_LOCKOUT
9882The TPMI_RH_LOCKOUT interface type is used as the type of a handle in a command when the only
9883allowed handle is TPM_RH_LOCKOUT indicating that lockoutAuth is required.
9884Table 55 — Definition of (TPM_HANDLE) TPMI_RH_LOCKOUT Type <IN>
9885Value
9886
9887Comments
9888
9889TPM_RH_LOCKOUT
9890#TPM_RC_VALUE
9891
9892response code returned when the unmarshaling of this type fails
9893
98949.21 TPMI_RH_NV_INDEX
9895This interface type is used to identify an NV location. This type is used in the NV commands.
9896Table 56 — Definition of (TPM_HANDLE) TPMI_RH_NV_INDEX Type <IN/OUT>
9897Value
9898
9899Comments
9900
9901{NV_INDEX_FIRST:NV_INDEX_LAST}
9902
9903Range of NV Indexes
9904
9905#TPM_RC_VALUE
9906
9907error returned if the handle is out of range
9908
9909Page 76
9910October 31, 2013
9911
9912Published
9913Copyright © TCG 2006-2013
9914
9915Family “2.0”
9916Level 00 Revision 00.99
9917
9918Trusted Platform Module Library
9919
9920Part 2: Structures
9921
99229.22 TPMI_ALG_HASH
9923A TPMI_ALG_HASH is an interface type of all the hash algorithms implemented on a specific TPM. Table
992457 is a list of the hash algorithms that have an algorithm ID assigned by the TCG and does not indicate
9925the algorithms that will be accepted by a TPM.
9926NOTE
9927
9928An implementation would modify this table according to the implemented algorithms, changing the values
9929that are accepted as hash algorithms.
9930
9931Table 57 — Definition of (TPM_ALG_ID) TPMI_ALG_HASH Type
9932Values
9933
9934Comments
9935
9936TPM_ALG_SHA1
9937
9938example
9939
9940TPM_ALG_SHA256
9941
9942example
9943
9944TPM_ALG_SM3_256
9945
9946example
9947
9948TPM_ALG_SHA384
9949
9950example
9951
9952TPM_ALG_SHA512
9953
9954example
9955
9956+TPM_ALG_NULL
9957#TPM_RC_HASH
9958
99599.23 TPMI_ALG_ASYM (Asymmetric Algorithms)
9960A TPMI_ALG_ASYM is an interface type of all the asymmetric algorithms implemented on a specific TPM.
9961Table 58 lists each of the asymmetric algorithms that have an algorithm ID assigned by the TCG.
9962Table 58 — Definition of (TPM_ALG_ID) TPMI_ALG_ASYM Type
9963Values
9964
9965Comments
9966
9967TPM_ALG_RSA
9968TPM_ALG_ECC
9969+TPM_ALG_NULL
9970#TPM_RC_ASYMMETRIC
9971
9972Family “2.0”
9973Level 00 Revision 00.99
9974
9975Published
9976Copyright © TCG 2006-2013
9977
9978Page 77
9979October 31, 2013
9980
9981Part 2: Structures
9982
9983Trusted Platform Module Library
9984
99859.24 TPMI_ALG_SYM (Symmetric Algorithms)
9986A TPMI_ALG_SYM is an interface type of all the symmetric algorithms that have an algorithm ID assigned
9987by the TCG and are implemented on the TPM.
9988The list in the table below is illustrative and will change according to the implementation. The validation
9989code will only accept the subset of algorithms implemented on a TPM.
9990NOTE
9991
9992The validation code produced by an example script will produce a CASE statement with a case for each of
9993the values in the “Values” column. The case for a value is delimited by a #ifdef/#endif pair so that if the
9994algorithm is not implemented on the TPM, then the case for the algorithm is not generated, and use of the
9995algorithm will cause a TPM error (TPM_RC_SYMMETRIC).
9996
9997Table 59 — Definition of (TPM_ALG_ID) TPMI_ALG_SYM Type
9998Values
9999
10000Comments
10001
10002TPM_ALG_AES
10003
10004example
10005
10006TPM_ALG_SM4
10007
10008example
10009
10010TPM_ALG_XOR
10011
10012example
10013
10014+TPM_ALG_NULL
10015
10016required to be present in all versions of this table
10017
10018#TPM_RC_SYMMETRIC
10019
100209.25 TPMI_ALG_SYM_OBJECT
10021A TPMI_ALG_SYM_OBJECT is an interface type of all the TCG-defined symmetric algorithms that may
10022be used as companion symmetric encryption algorithm for an asymmetric object. All algorithms in this list
10023shall be block ciphers usable in Cipher Feedback (CFB).
10024Table 60 is illustrative. It would be modified to indicate the algorithms of the TPM.
10025NOTE
10026
10027TPM_ALG_XOR is not allowed in this list.
10028
10029Table 60 — Definition of (TPM_ALG_ID) TPMI_ALG_SYM_OBJECT Type
10030Values
10031
10032Comments
10033
10034TPM_ALG_AES
10035
10036example
10037
10038TPM_ALG_SM4
10039
10040example
10041
10042+TPM_ALG_NULL
10043
10044required to be present in all versions of this table
10045
10046#TPM_RC_SYMMETRIC
10047
10048Page 78
10049October 31, 2013
10050
10051Published
10052Copyright © TCG 2006-2013
10053
10054Family “2.0”
10055Level 00 Revision 00.99
10056
10057Trusted Platform Module Library
10058
10059Part 2: Structures
10060
100619.26 TPMI_ALG_SYM_MODE
10062A TPMI_ALG_SYM_MODE is an interface type of all the TCG-defined block-cipher modes of operation.
10063This version of the table is not expected to be the table checked by the validation code. Rather, the table
10064would be replaced by one containing the algorithms implemented on the TPM and that the values in that
10065table would be checked by the input validation code.
10066Table 61 — Definition of (TPM_ALG_ID) TPMI_ALG_SYM_MODE Type
10067Values
10068
10069Comments
10070
10071TPM_ALG_CTR
10072
10073IV will be determined by use.
10074If the outside provides the nonce and initial counter, then the caller can
10075know what IV to provide for chaining.
10076
10077TPM_ALG_OFB
10078
10079XOR last cipher text block with last plaintext to create IV for next block
10080
10081TPM_ALG_CBC
10082
10083IV will be determined by use.
10084indefinite chaining using previous output block as IV for next block
10085
10086TPM_ALG_CFB
10087
10088shall be implemented in all TPM compliant with this specification
10089IV will be determined by use.
10090indefinite chaining using previous cipher text as IV
10091
10092TPM_ALG_ECB
10093
10094no IV or chaining value required
10095
10096+TPM_ALG_NULL
10097#TPM_RC_MODE
10098
100999.27 TPMI_ALG_KDF (Key and Mask Generation Functions)
10100A TPMI_ALG_KDF is an interface type of all the key derivation functions implemented on a specific TPM.
10101Table 62 is exemplary and would change based on the algorithms implemented in a TPM.
10102Table 62 — Definition of (TPM_ALG_ID) TPMI_ALG_KDF Type
10103Values
10104
10105Comments
10106
10107TPM_ALG_MGF1
10108TPM_ALG_KDF1_SP800_108
10109TPM_ALG_KDF1_SP800_56a
10110TPM_ALG_KDF2
10111+TPM_ALG_NULL
10112#TPM_RC_KDF
10113
10114Family “2.0”
10115Level 00 Revision 00.99
10116
10117Published
10118Copyright © TCG 2006-2013
10119
10120Page 79
10121October 31, 2013
10122
10123Part 2: Structures
10124
10125Trusted Platform Module Library
10126
101279.28 TPMI_ALG_SIG_SCHEME
10128This is the definition of the interface type for a signature scheme. This table would change according to
10129the algorithms implemented on the TPM.
10130Table 63 — Definition of (TPM_ALG_ID) TPMI_ALG_SIG_SCHEME Type
10131Values
10132
10133Comments
10134
10135TPM_ALG_RSASSA
10136
10137requires that RSA be implemented
10138
10139TPM_ALG_RSAPSS
10140
10141requires that RSA be implemented
10142
10143TPM_ALG_ECDSA
10144
10145requires that ECC be implemented
10146
10147TPM_ALG_ECDAA
10148
10149requires that ECC and ECDAA be implemented
10150
10151TPM_ALG_ECSCHNORR
10152TPM_ALG_SM2
10153
10154requires that ECC be implemented
10155
10156TPM_ALG_HMAC
10157
10158present on all TPM
10159
10160+TPM_ALG_NULL
10161#TPM_RC_SCHEME
10162
10163response code when a signature scheme is not correct
10164
101659.29 TPMI_ECC_KEY_EXCHANGE
10166This is the definition of the interface type for an ECC key exchange scheme. This table would change
10167according to the algorithms implemented on the TPM.
10168Table 64 — Definition of (TPM_ALG_ID) TPMI_ECC_KEY_EXCHANGE Type
10169Values
10170
10171Comments
10172
10173TPM_ALG_ECDH
10174
10175used for single and two phase key exchange
10176
10177TPM_ALG_ECMQV
10178TPM_ALG_SM2
10179
10180requires that ECC be implemented
10181
10182+TPM_ALG_NULL
10183#TPM_RC_SCHEME
10184
10185response code when a key exchange scheme is not correct
10186
101879.30 TPMI_ST_COMMAND_TAG
10188This interface type is used for the command tags.
10189The response code for a bad command tag has the same value as the TPM 1.2 response code
10190(TPM_BAD_TAG). This value is used in case the software is not compatible with this specification and an
10191unexpected response code might have unexpected side effects.
10192Table 65 — Definition of (TPM_ST) TPMI_ST_COMMAND_TAG Type
10193Values
10194
10195Comments
10196
10197TPM_ST_NO_SESSIONS
10198TPM_ST_SESSIONS
10199#TPM_RC_BAD_TAG
10200
10201Page 80
10202October 31, 2013
10203
10204Published
10205Copyright © TCG 2006-2013
10206
10207Family “2.0”
10208Level 00 Revision 00.99
10209
10210Trusted Platform Module Library
10211
10212Part 2: Structures
10213
1021410 Structure Definitions
1021510.1 TPMS_ALGORITHM_DESCRIPTION
10216This structure is a return value for a TPM2_GetCapability() that reads the installed algorithms.
10217Table 66 — Definition of TPMS_ALGORITHM_DESCRIPTION Structure <OUT>
10218Parameter
10219
10220Type
10221
10222Description
10223
10224alg
10225
10226TPM_ALG_ID
10227
10228an algorithm
10229
10230attributes
10231
10232TPMA_ALGORITHM
10233
10234the attributes of the algorithm
10235
1023610.2 Hash/Digest Structures
1023710.2.1 TPMU_HA (Hash)
10238A TPMU_HA is a union of all the hash algorithms implemented on a TPM. Table 67 is exemplary and
10239would change based on the algorithms implemented in a TPM.
10240NOTE
10241
10242If processed by an automated tool, each entry of the table should be qualified (with #ifdef/#endif) so that if
10243the hash algorithm is not implemented on the TPM, the parameter associated with that hash is not
10244present. This will keep the union from being larger than the largest digest of a hash implemented on that
10245TPM.
10246
10247Table 67 — Definition of TPMU_HA Union <IN/OUT, S>
10248Parameter
10249
10250Type
10251
10252Selector
10253
10254sha1 [SHA1_DIGEST_SIZE]
10255
10256BYTE
10257
10258TPM_ALG_SHA1
10259
10260sha256 [SHA256_DIGEST_SIZE]
10261
10262BYTE
10263
10264TPM_ALG_SHA256
10265
10266sm3_256 [SM3_256_DIGEST_SIZE]
10267
10268BYTE
10269
10270TPM_ALG_SM3_256
10271
10272sha384 [SHA384_DIGEST_SIZE]
10273
10274BYTE
10275
10276TPM_ALG_SHA384
10277
10278sha512 [SHA512_DIGEST_SIZE]
10279
10280BYTE
10281
10282TPM_ALG_SHA512
10283
10284null
10285
10286Family “2.0”
10287Level 00 Revision 00.99
10288
10289Description
10290
10291TPM_ALG_NULL
10292
10293Published
10294Copyright © TCG 2006-2013
10295
10296Page 81
10297October 31, 2013
10298
10299Part 2: Structures
10300
10301Trusted Platform Module Library
10302
1030310.2.2 TPMT_HA
10304Table 68 shows the basic hash-agile structure used in this specification. To handle hash agility, this
10305structure uses the hashAlg parameter to indicate the algorithm used to compute the digest and, by
10306implication, the size of the digest.
10307When transmitted, only the number of octets indicated by hashAlg is sent.
10308NOTE
10309
10310In the exemplary code, when a TPMT_HA is allocated, the digest field is large enough to support the
10311largest hash algorithm in the TPMU_HA union.
10312
10313Table 68 — Definition of TPMT_HA Structure <IN/OUT>
10314Parameter
10315
10316Type
10317
10318Description
10319
10320hashAlg
10321
10322+TPMI_ALG_HASH
10323
10324selector of the hash contained in the digest that implies the
10325size of the digest
10326NOTE
10327
10328[hashAlg]digest
10329
10330TPMU_HA
10331
10332The leading “+” on the type indicates that this structure
10333should pass an indication to the unmarshaling function for
10334TPMI_ALG_HASH so that TPM_ALG_NULL will be
10335allowed if a use of a TPMT_HA allows TPM_ALG_NULL.
10336
10337the digest data
10338
1033910.3 Sized Buffers
1034010.3.1 Introduction
10341The “TPM2B_” prefix is used for a structure that has a size field followed by a data buffer with the
10342indicated number of octets. The size field is 16 bits.
10343When the type of the second parameter in a TPM2B_ structure is BYTE, the TPM shall unmarshal the
10344indicated number of octets, which may be zero.
10345When the type of the second parameter in the TPM2B_ structure is not BYTE, the value of the size field
10346shall either be zero indicating that no structure is to be unmarshaled; or it shall be identical to the number
10347of octets unmarshaled for the second parameter.
10348NOTE 1
10349
10350If the TPM2B_ defines a structure and not an array of octets, then the structure is self-describing and the
10351TPM will be able to determine how many octets are in the structure when it is unmarshaled. If that number
10352of octets is not equal to the size parameter, then it is an error.
10353
10354NOTE 2
10355
10356The reason that a structure may be put into a TPM2B_ is that the parts of the structure may be handled
10357as separate opaque blocks by the application/system software. Rather than require that all of the
10358structures in a command or response be marshaled or unmarshaled sequentially, the size field allows the
10359structure to be manipulated as an opaque block. Placing a structure in a TPM2B_ also makes it possible
10360to use parameter encryption on the structure.
10361
10362If a TPM2B_ is encrypted, the TPM will encrypt/decrypt the data field of the TPM2B_ but not the size
10363parameter. The TPM will encrypt/decrypt the number of octets indicated by the size field.
10364NOTE 3
10365
10366In the reference implementation, a TPM2B type is defined that is a 16-bit size field followed by a single
10367byte of data. The TPM2B_ is then defined as a union that contains a TPM2B (union member ‘b’) and the
10368structure in the definition table (union member ‘t’). This union is used for internally generated structures
10369so that there is a way to define a structure of the correct size (forced by the ‘t’ member) while giving a way
10370to pass the structure generically as a ‘b’. Most function calls use the 't' member so that the compiler will
10371generate a warning if there is a type error (a TPM2B_ of the wrong type). Having the type checked helps
10372avoid many issues with buffer overflow caused by a too small buffer being passed to a function.
10373
10374Page 82
10375October 31, 2013
10376
10377Published
10378Copyright © TCG 2006-2013
10379
10380Family “2.0”
10381Level 00 Revision 00.99
10382
10383Trusted Platform Module Library
10384
10385Part 2: Structures
10386
1038710.3.2 TPM2B_DIGEST
10388This structure is used for a sized buffer that cannot be larger than the largest digest produced by any
10389hash algorithm implemented on the TPM.
10390As with all sized buffers, the size is checked to see if it is within the prescribed range. If not, the response
10391code is TPM_RC_SIZE.
10392NOTE
10393
10394For any structure, like the one below, that contains an implied size check, it is implied that TPM_RC_SIZE
10395is a possible response code and the response code will not be listed in the table.
10396
10397Table 69 — Definition of TPM2B_DIGEST Structure
10398Parameter
10399
10400Type
10401
10402Description
10403
10404size
10405
10406UINT16
10407
10408size in octets of the buffer field; may be 0
10409
10410buffer [size] {:sizeof(TPMU_HA)}
10411
10412BYTE
10413
10414the buffer area that can be no larger than a digest
10415
1041610.3.3 TPM2B_DATA
10417This structure is used for a data buffer that is required to be no larger than the size of the Name of an
10418object. This size limit includes the algorithm ID of the hash and the hash data.
10419Table 70 — Definition of TPM2B_DATA Structure
10420Parameter
10421
10422Type
10423
10424Description
10425
10426size
10427
10428UINT16
10429
10430size in octets of the buffer field; may be 0
10431
10432buffer [size] {:sizeof(TPMT_HA)}
10433
10434BYTE
10435
10436the buffer area that contains the algorithm ID and the
10437digest
10438
1043910.3.4 TPM2B_NONCE
10440Table 71 — Definition of Types for TPM2B_NONCE
10441Type
10442
10443Name
10444
10445Description
10446
10447TPM2B_DIGEST
10448
10449TPM2B_NONCE
10450
10451size limited to the same as the digest structure
10452
1045310.3.5 TPM2B_AUTH
10454This structure is used for an authorization value and limits an authValue to being no larger than the
10455largest digest produced by a TPM. In order to ensure consistency within an object, the authValue may be
10456no larger than the size of the digest produced by the object’s nameAlg. This ensures that any TPM that
10457can load the object will be able to handle the authValue of the object.
10458Table 72 — Definition of Types for TPM2B_AUTH
10459Type
10460
10461Name
10462
10463Description
10464
10465TPM2B_DIGEST
10466
10467TPM2B_AUTH
10468
10469size limited to the same as the digest structure
10470
10471Family “2.0”
10472Level 00 Revision 00.99
10473
10474Published
10475Copyright © TCG 2006-2013
10476
10477Page 83
10478October 31, 2013
10479
10480Part 2: Structures
10481
10482Trusted Platform Module Library
10483
1048410.3.6 TPM2B_OPERAND
10485This type is a sized buffer that can hold an operand for a comparison with an NV Index location. The
10486maximum size of the operand is implementation dependent but a TPM is required to support an operand
10487size that is at least as big as the digest produced by any of the hash algorithms implemented on the TPM.
10488Table 73 — Definition of Types for TPM2B_OPERAND
10489Type
10490
10491Name
10492
10493Description
10494
10495TPM2B_DIGEST
10496
10497TPM2B_OPERAND
10498
10499size limited to the same as the digest structure
10500
1050110.3.7 TPM2B_EVENT
10502This type is a sized buffer that can hold event data.
10503Table 74 — Definition of TPM2B_EVENT Structure
10504Parameter
10505
10506Type
10507
10508Description
10509
10510size
10511
10512UINT16
10513
10514size of the operand buffer
10515
10516buffer [size] {:1024}
10517
10518BYTE
10519
10520the operand
10521
1052210.3.8 TPM2B_MAX_BUFFER
10523This type is a sized buffer that can hold a maximally sized buffer for commands that use a large data
10524buffer
10525such
10526as
10527TPM2_PCR_Event(),
10528TPM2_Hash(),
10529TPM2_SequenceUpdate(),
10530or
10531TPM2_FieldUpgradeData().
10532NOTE
10533
10534The above list is not comprehensive and other commands may use this buffer type.
10535
10536Table 75 — Definition of TPM2B_MAX_BUFFER Structure
10537Parameter
10538
10539Type
10540
10541Description
10542
10543size
10544
10545UINT16
10546
10547size of the buffer
10548
10549buffer [size] {:MAX_DIGEST_BUFFER}
10550
10551BYTE
10552
10553the operand
10554NOTE
10555MAX_DIGEST_BUFFER
10556is
10557TPMdependent but is required to be at least 1,024.
10558
1055910.3.9 TPM2B_MAX_NV_BUFFER
10560This type is a sized buffer that can hold a maximally sized buffer for NV data commands such as
10561TPM2_NV_Read(), TPM2_NV_Write(), and TPM2_NV_Certify().
10562Table 76 — Definition of TPM2B_MAX_NV_BUFFER Structure
10563Parameter
10564
10565Type
10566
10567Description
10568
10569size
10570
10571UINT16
10572
10573size of the buffer
10574
10575buffer [size] {:MAX_NV_BUFFER_SIZE}
10576
10577BYTE
10578
10579the operand
10580NOTE
10581MAX_NV_BUFFER_SIZE
10582dependent
10583
10584Page 84
10585October 31, 2013
10586
10587Published
10588Copyright © TCG 2006-2013
10589
10590is
10591
10592TPM-
10593
10594Family “2.0”
10595Level 00 Revision 00.99
10596
10597Trusted Platform Module Library
10598
10599Part 2: Structures
10600
1060110.3.10 TPM2B_TIMEOUT
10602This TPM-dependent structure is used to provide the timeout value for an authorization.
10603Table 77 — Definition of TPM2B_TIMEOUT Structure <IN/OUT>
10604Parameter
10605
10606Type
10607
10608Description
10609
10610size
10611
10612UINT16
10613
10614size of the timeout value
10615This value is fixed for a TPM implementation.
10616
10617buffer [size] {:sizeof(UINT64)}
10618
10619BYTE
10620
10621the timeout value
10622
1062310.3.11 TPM2B_IV
10624This structure is used for passing an initial value for a symmetric block cipher to or from the TPM. The
10625size is set to be the largest block size of any implemented symmetric cipher implemented on the TPM.
10626Table 78 — Definition of TPM2B_IV Structure <IN/OUT>
10627Parameter
10628
10629Type
10630
10631Description
10632
10633size
10634
10635UINT16
10636
10637size of the timeout value
10638This value is fixed for a TPM implementation.
10639
10640buffer [size] {:MAX_SYM_BLOCK_SIZE}
10641
10642BYTE
10643
10644the timeout value
10645
1064610.4 Names
1064710.4.1 Introduction
10648The Name of an entity is used in place of the handle in authorization computations. The substitution
10649occurs in cpHash and policyHash computations.
10650For an entity that is defined by a public area (objects and NV Indexes), the Name is the hash of the public
10651structure that defines the entity. The hash is done using the nameAlg of the entity.
10652NOTE
10653
10654For an object, a TPMT_PUBLIC defines the entity. For an NV Index, a TPMS_NV_PUBLIC defines the
10655entity.
10656
10657For entities not defined by a public area, the Name is the handle that is used to refer to the entity.
1065810.4.2 TPMU_NAME
10659Table 79 — Definition of TPMU_NAME Union <>
10660Parameter
10661
10662Type
10663
10664digest
10665
10666TPMT_HA
10667
10668when the Name is a digest
10669
10670handle
10671
10672TPM_HANDLE
10673
10674when the Name is a handle
10675
10676Family “2.0”
10677Level 00 Revision 00.99
10678
10679Selector
10680
10681Description
10682
10683Published
10684Copyright © TCG 2006-2013
10685
10686Page 85
10687October 31, 2013
10688
10689Part 2: Structures
10690
10691Trusted Platform Module Library
10692
1069310.4.3 TPM2B_NAME
10694This buffer holds a Name for any entity type.
10695The type of Name in the structure is determined by context and the size parameter. If size is four, then
10696the Name is a handle. If size is zero, then no Name is present. Otherwise, the size shall be the size of a
10697TPM_ALG_ID plus the size of the digest produced by the indicated hash algorithm.
10698Table 80 — Definition of TPM2B_NAME Structure
10699Parameter
10700
10701Type
10702
10703Description
10704
10705size
10706
10707UINT16
10708
10709size of the Name structure
10710
10711name [size] {:sizeof(TPMU_NAME)}
10712
10713BYTE
10714
10715the Name structure
10716
1071710.5 PCR Structures
1071810.5.1 TPMS_PCR_SELECT
10719This structure provides a standard method of specifying a list of PCR.
10720PCR numbering starts at zero.
10721PcrSelect is an array of octets. The octet containing the bit corresponding to a specific PCR is found by
10722dividing the PCR number by 8.
10723EXAMPLE 1
10724
10725The bit in pcrSelect corresponding to PCR 19 is in pcrSelect [2] (19/8 = 2).
10726
10727The least significant bit in a octet is bit number 0. The bit in the octet associated with a PCR is the
10728remainder after division by 8.
10729EXAMPLE 2
10730
10731The bit in pcrSelect [2] corresponding to PCR 19 is bit 3 (19 mod 8). If sizeofSelect is 3, then the
10732pcrSelect array that would specify PCR 19 and no other PCR is 00 00 08 16.
10733
10734Each bit in pcrSelect indicates whether the corresponding PCR is selected (1) or not (0). If the pcrSelect
10735is all zero bits, then no PCR is selected.
10736SizeofSelect indicates the number of octets in pcrSelect. The allowable values for sizeofSelect is
10737determined by the number of PCR required by the applicable platform-specific specification and the
10738number of PCR implemented in the TPM. The minimum value for sizeofSelect is:
10739PCR_SELECT_MIN ≔ (PLATFORM_PCR + 7) / 8
10740
10741(1)
10742
10743where
10744PLATFORM_PCR
10745
10746the number of PCR required by the platform-specific specification
10747
10748The maximum value for sizeofSelect is:
10749PCR_SELECT_MAX ≔ (IMPLEMENTATION_PCR + 7) / 8
10750
10751(2)
10752
10753where
10754IMPLEMENTATION_PCR
10755
10756Page 86
10757October 31, 2013
10758
10759the number of PCR implemented on the TPM
10760
10761Published
10762Copyright © TCG 2006-2013
10763
10764Family “2.0”
10765Level 00 Revision 00.99
10766
10767Trusted Platform Module Library
10768
10769Part 2: Structures
10770
10771If the TPM implements more PCR than there are bits in pcrSelect, the additional PCR are not selected.
10772EXAMPLE 3
10773
10774If the applicable platform-specific specification requires that the TPM have a minimum of 24 PCR but the
10775TPM implements 32, then a PCR select of 3 octets would imply that PCR 24-31 are not selected.
10776
10777Table 81 — Definition of TPMS_PCR_SELECT Structure
10778Parameter
10779
10780Type
10781
10782Description
10783
10784sizeofSelect {PCR_SELECT_MIN:}
10785
10786UINT8
10787
10788the size in octets of the pcrSelect array
10789
10790pcrSelect [sizeofSelect] {:PCR_SELECT_MAX}
10791
10792BYTE
10793
10794the bit map of selected PCR
10795
10796#TPM_RC_VALUE
10797
1079810.5.2 TPMS_PCR_SELECTION
10799Table 82 — Definition of TPMS_PCR_SELECTION Structure
10800Parameter
10801
10802Type
10803
10804Description
10805
10806hash
10807
10808TPMI_ALG_HASH
10809
10810the hash algorithm associated with the
10811selection
10812
10813sizeofSelect {PCR_SELECT_MIN:}
10814
10815UINT8
10816
10817the size in octets of the pcrSelect array
10818
10819pcrSelect [sizeofSelect] {:PCR_SELECT_MAX}
10820
10821BYTE
10822
10823the bit map of selected PCR
10824
10825#TPM_RC_VALUE
10826
1082710.6 Tickets
1082810.6.1 Introduction
10829Tickets are evidence that the TPM has previously processed some information. A ticket is an HMAC over
10830the data using a secret key known only to the TPM. A ticket is a way to expand the state memory of the
10831TPM. A ticket is only usable by the TPM that produced it.
10832The formulations for tickets shown in this clause are to be used by a TPM that is compliant with this
10833specification.
10834The method of creating the ticket data is:
10835
10836HMACcontexAlg(proof, (ticketType || param { || param {…}))
10837
10838(3)
10839
10840where
10841
10842HMACcontexAlg()
10843
10844an HMAC using the hash used for context integrity
10845
10846proof
10847
10848a TPM secret value (depends on hierarchy)
10849
10850ticketType
10851
10852a value to differentiate the tickets
10853
10854param
10855
10856one or more values that were checked by the TPM
10857
10858Family “2.0”
10859Level 00 Revision 00.99
10860
10861Published
10862Copyright © TCG 2006-2013
10863
10864Page 87
10865October 31, 2013
10866
10867Part 2: Structures
10868
10869Trusted Platform Module Library
10870
10871The proof value used for each hierarchy is shown in Table 83.
10872Table 83 — Values for proof Used in Tickets
10873Hierarchy
10874
10875proof
10876
10877Description
10878
10879None
10880
10881Empty Buffer
10882
10883Platform
10884
10885phProof
10886
10887a value that changes with each change of the PPS
10888
10889Owner
10890
10891shProof
10892
10893a value that changes with each change of the SPS
10894
10895Endorsement
10896
10897ehProof
10898
10899a value that changes with each change of either the EPS or SPS
10900
10901The format for a ticket is shown in Table 84. This is a template for the tickets shown in the remainder of
10902this clause.
10903Table 84 — General Format of a Ticket
10904Parameter
10905
10906Type
10907
10908Description
10909
10910tag
10911
10912TPM_ST
10913
10914structure tag indicating the type of the ticket
10915
10916hierarchy
10917
10918TPMI_RH_HIERARCHY+
10919
10920the hierarchy of the proof value
10921
10922digest
10923
10924TPM2B_DIGEST
10925
10926the HMAC over the ticket-specific data
10927
1092810.6.2 A NULL Ticket
10929When a command requires a ticket and no ticket is available, the caller is required to provide a structure
10930with a ticket tag that is correct for the context. The hierarchy shall be set to TPM_RH_NULL, and digest
10931shall be the Empty Buffer (a buffer with a size field of zero). This construct is the NULL Ticket. When a
10932response indicates that a ticket is returned, the TPM may return a NULL Ticket.
10933NOTE
10934
10935Because each use of a ticket requires that the structure tag for the ticket be appropriate for the use, t here
10936is no single representation of a NULL Ticket that will work in all circumstances. Minimally, a NULL ticket
10937will have a structure type that is appropriate for the context.
10938
10939Page 88
10940October 31, 2013
10941
10942Published
10943Copyright © TCG 2006-2013
10944
10945Family “2.0”
10946Level 00 Revision 00.99
10947
10948Trusted Platform Module Library
10949
10950Part 2: Structures
10951
1095210.6.3 TPMT_TK_CREATION
10953This ticket is produced by TPM2_Create() or TPM2_CreatePrimary(). It is used to bind the creation data
10954to the object to which it applies. The ticket is computed by
10955
10956HMACcontextAlg(proof, (TPM_ST_CREATION || name || HnameAlg(TPMS_CREATION_DATA)))
10957
10958(4)
10959
10960where
10961
10962HMACcontextAlg()
10963
10964an HMAC using the context integrity hash algorithm
10965
10966proof
10967
10968a TPM secret value associated with the hierarchy associated with name
10969
10970TPM_ST_CREATION
10971
10972a value used to ensure that the ticket is properly used
10973
10974name
10975
10976the Name of the object to which the creation data is to be associated
10977
10978HnameAlg()
10979
10980hash using the nameAlg of the created object
10981
10982TPMS_CREATION_DATA the creation data structure associated with name
10983Table 85 — Definition of TPMT_TK_CREATION Structure
10984Parameter
10985
10986Type
10987
10988Description
10989
10990tag {TPM_ST_CREATION}
10991
10992TPM_ST
10993
10994ticket structure tag
10995error returned when tag is not TPM_ST_CREATION
10996
10997#TPM_RC_TAG
10998hierarchy
10999
11000TPMI_RH_HIERARCHY+
11001
11002the hierarchy containing name
11003
11004digest
11005
11006TPM2B_DIGEST
11007
11008This shall be the HMAC produced using a proof value
11009of hierarchy.
11010
11011EXAMPLE
11012
11013A NULL Creation Ticket is the tuple <TPM_ST_CREATION, TPM_RH_NULL, 0x0000>.
11014
11015Family “2.0”
11016Level 00 Revision 00.99
11017
11018Published
11019Copyright © TCG 2006-2013
11020
11021Page 89
11022October 31, 2013
11023
11024Part 2: Structures
11025
11026Trusted Platform Module Library
11027
1102810.6.4 TPMT_TK_VERIFIED
11029This ticket is produced by TPM2_VerifySignature(). This formulation is used for multiple ticket uses. The
11030ticket provides evidence that the TPM has validated that a digest was signed by a key with the Name of
11031keyName. The ticket is computed by
11032
11033HMACcontextAlg(proof, (TPM_ST_VERIFIED || digest || keyName))
11034
11035(5)
11036
11037where
11038
11039HMACcontextAlg()
11040
11041an HMAC using the context integrity hash
11042
11043proof
11044
11045a TPM secret value associated with the hierarchy associated with
11046
11047TPM_ST_VERIFIED
11048
11049a value used to ensure that the ticket is properly used
11050
11051digest
11052
11053the signed digest
11054
11055keyName
11056
11057Name of the key that signed digest
11058
11059keyName
11060
11061Table 86 — Definition of TPMT_TK_VERIFIED Structure
11062Parameter
11063
11064Type
11065
11066Description
11067
11068tag {TPM_ST_VERIFIED}
11069
11070TPM_ST
11071
11072ticket structure tag
11073error returned when tag is not TPM_ST_VERIFIED
11074
11075#TPM_RC_TAG
11076hierarchy
11077
11078TPMI_RH_HIERARCHY+
11079
11080the hierarchy containing keyName
11081
11082digest
11083
11084TPM2B_DIGEST
11085
11086This shall be the HMAC produced using a proof value
11087of hierarchy.
11088
11089EXAMPLE
11090
11091A NULL Verified Ticket is the tuple <TPM_ST_VERIFIED, TPM_RH_NULL, 0x0000>.
11092
11093Page 90
11094October 31, 2013
11095
11096Published
11097Copyright © TCG 2006-2013
11098
11099Family “2.0”
11100Level 00 Revision 00.99
11101
11102Trusted Platform Module Library
11103
11104Part 2: Structures
11105
1110610.6.5 TPMT_TK_AUTH
11107This ticket is produced by TPM2_PolicySigned() and TPM2_PolicySecret() when the authorization has an
11108expiration time. The ticket is computed by
11109
11110HMACcontextAlg(proof, (TPM_ST_AUTH_xxx || timeout || cpHash || policyRef || keyName))
11111
11112(6)
11113
11114where
11115
11116HMACcontextAlg()
11117
11118an HMAC using the context integrity hash
11119
11120proof
11121
11122a TPM secret value associated with the hierarchy of the key associated
11123with keyName
11124
11125TPM_ST_AUTH_xxx
11126
11127either TPM_ST_AUTH_SIGNED or TPM_ST_AUTH_SECRET; used to
11128ensure that the ticket is properly used
11129
11130timeout
11131
11132implementation-specific value indicating when the authorization expires
11133
11134cpHash
11135
11136optional hash of the authorized command
11137
11138policyRef
11139
11140optional reference to a policy value
11141
11142keyName
11143
11144Name of the key that signed the authorization
11145Table 87 — Definition of TPMT_TK_AUTH Structure
11146
11147Parameter
11148
11149Type
11150
11151Description
11152
11153tag {TPM_ST_AUTH_SIGNED, TPM_ST_AUTH_SECRET}
11154
11155TPM_ST
11156
11157ticket structure tag
11158
11159#TPM_RC_TAG
11160
11161error returned when tag is
11162not TPM_ST_AUTH
11163
11164hierarchy
11165
11166TPMI_RH_HIERARCHY+
11167
11168the hierarchy of the object
11169used to produce the ticket
11170
11171digest
11172
11173TPM2B_DIGEST
11174
11175This shall be the HMAC
11176produced using a proof
11177value of hierarchy.
11178
11179EXAMPLE
11180
11181A NULL Auth Ticket is the tuple <TPM_ST_AUTH_SIGNED, TPM_RH_NULL, 0x0000> or the tuple
11182<TPM_ST_AUTH_SIGNED, TPM_RH_NULL, 0x0000>
11183
11184Family “2.0”
11185Level 00 Revision 00.99
11186
11187Published
11188Copyright © TCG 2006-2013
11189
11190Page 91
11191October 31, 2013
11192
11193Part 2: Structures
11194
11195Trusted Platform Module Library
11196
1119710.6.6 TPMT_TK_HASHCHECK
11198This ticket is produced by TPM2_SequenceComplete() when the message that was digested did not start
11199with TPM_GENERATED_VALUE. The ticket is computed by
11200
11201HMACcontexAlg(proof, (TPM_ST_HASHCHECK || digest))
11202
11203(7)
11204
11205where
11206
11207HMACcontexAlg ()
11208
11209an HMAC using the context integrity hash
11210
11211proof
11212
11213a TPM secret value associated with the hierarchy indicated by the
11214command
11215
11216TPM_ST_HASHCHECK
11217
11218a value used to ensure that the ticket is properly used
11219
11220digest
11221
11222the digest of the data
11223Table 88 — Definition of TPMT_TK_HASHCHECK Structure
11224
11225Parameter
11226
11227Type
11228
11229Description
11230
11231tag {TPM_ST_HASHCHECK}
11232
11233TPM_ST
11234
11235ticket structure tag
11236
11237#TPM_RC_TAG
11238
11239error returned when is not TPM_ST_HASHCHECK
11240
11241hierarchy
11242
11243TPMI_RH_HIERARCHY+
11244
11245the hierarchy
11246
11247digest
11248
11249TPM2B_DIGEST
11250
11251This shall be the HMAC produced using a proof value
11252of hierarchy.
11253
1125410.7 Property Structures
1125510.7.1 TPMS_ALG_PROPERTY
11256This structure is used to report the properties of an algorithm identifier. It is returned in response to a
11257TPM2_GetCapability() with capability = TPM_CAP_ALG.
11258Table 89 — Definition of TPMS_ALG_PROPERTY Structure <OUT>
11259Parameter
11260
11261Type
11262
11263Description
11264
11265alg
11266
11267TPM_ALG_ID
11268
11269an algorithm identifier
11270
11271algProperties
11272
11273TPMA_ALGORITHM
11274
11275the attributes of the algorithm
11276
1127710.7.2 TPMS_TAGGED_PROPERTY
11278This structure is used to report the properties that are UINT32 values. It is returned in response to a
11279TPM2_GetCapability().
11280Table 90 — Definition of TPMS_TAGGED_PROPERTY Structure <OUT>
11281Parameter
11282
11283Type
11284
11285Description
11286
11287property
11288
11289TPM_PT
11290
11291a property identifier
11292
11293value
11294
11295UINT32
11296
11297the value of the property
11298
11299Page 92
11300October 31, 2013
11301
11302Published
11303Copyright © TCG 2006-2013
11304
11305Family “2.0”
11306Level 00 Revision 00.99
11307
11308Trusted Platform Module Library
11309
11310Part 2: Structures
11311
1131210.7.3 TPMS_TAGGED_PCR_SELECT
11313This structure is used in TPM2_GetCapability() to return the attributes of the PCR.
11314Table 91 — Definition of TPMS_TAGGED_PCR_SELECT Structure <OUT>
11315Parameter
11316
11317Type
11318
11319Description
11320
11321tag
11322
11323TPM_PT
11324
11325the property identifier
11326
11327sizeofSelect {PCR_SELECT_MIN:}
11328
11329UINT8
11330
11331the size in octets of the pcrSelect array
11332
11333pcrSelect [sizeofSelect] {:PCR_SELECT_MAX}
11334
11335BYTE
11336
11337the bit map of PCR with the identified property
11338
1133910.8 Lists
1134010.8.1 TPML_CC
11341A list of command codes may be input to the TPM or returned by the TPM depending on the command.
11342Table 92 — Definition of TPML_CC Structure
11343Parameter
11344
11345Type
11346
11347Description
11348
11349count
11350
11351UINT32
11352
11353number of commands in the commandCode list;
11354may be 0
11355
11356commandCodes [count] {:MAX_CAP_CC}
11357
11358TPM_CC
11359
11360a list of command codes
11361The maximum only applies to a command code
11362list in a command. The response size is limited
11363only by the size of the parameter buffer.
11364
11365#TPM_RC_SIZE
11366
11367Family “2.0”
11368Level 00 Revision 00.99
11369
11370response code when count is greater than the
11371maximum allowed list size
11372
11373Published
11374Copyright © TCG 2006-2013
11375
11376Page 93
11377October 31, 2013
11378
11379Part 2: Structures
11380
11381Trusted Platform Module Library
11382
1138310.8.2 TPML_CCA
11384This list is only used in TPM2_GetCapability(capability = TPM_CAP_COMMANDS).
11385The values in the list are returned in commandIndex order with vendor-specific commands returned after
11386other commands. Because of the other attributes, the commands may not be returned in strict numerical
11387order. They will be in commandIndex order.
11388Table 93 — Definition of TPML_CCA Structure <OUT>
11389Parameter
11390
11391Type
11392
11393Description
11394
11395count
11396
11397UINT32
11398
11399number of values in the commandAttributes list;
11400may be 0
11401
11402commandAttributes [count] {:MAX_CAP_CC}
11403
11404TPMA_CC
11405
11406a list of command codes attributes
11407
1140810.8.3 TPML_ALG
11409This list is returned by TPM2_IncrementalSelfTest().
11410Table 94 — Definition of TPML_ALG Structure
11411Parameter
11412
11413Type
11414
11415Description
11416
11417count
11418
11419UINT32
11420
11421number of algorithms in the algorithms list; may be 0
11422
11423algorithms [count] {:MAX_ALG_LIST_SIZE}
11424
11425TPM_ALG_ID
11426
11427 a list of algorithm IDs
11428The maximum only applies to an algorithm list in a
11429command. The response size is limited only by the
11430size of the parameter buffer.
11431response code when count is greater than the
11432maximum allowed list size
11433
11434#TPM_RC_SIZE
11435
1143610.8.4 TPML_HANDLE
11437This structure is used when the TPM returns a list of loaded handles when the capability in
11438TPM2_GetCapability() is TPM_CAP_HANDLE.
11439NOTE
11440
11441This list is not used as input to the TPM.
11442
11443Table 95 — Definition of TPML_HANDLE Structure <OUT>
11444Name
11445
11446Type
11447
11448Description
11449
11450count
11451
11452UINT32
11453
11454the number of handles in the list
11455may have a value of 0
11456
11457handle [count] {:MAX_CAP_HANDLES}
11458
11459TPM_HANDLE
11460
11461an array of handles
11462
11463#TPM_RC_SIZE
11464
11465Page 94
11466October 31, 2013
11467
11468response code when count is greater than the
11469maximum allowed list size
11470
11471Published
11472Copyright © TCG 2006-2013
11473
11474Family “2.0”
11475Level 00 Revision 00.99
11476
11477Trusted Platform Module Library
11478
11479Part 2: Structures
11480
1148110.8.5 TPML_DIGEST
11482This list is used to convey a list of digest values. This type is used in TPM2_PolicyOR() and in
11483TPM2_PCR_Read().
11484Table 96 — Definition of TPML_DIGEST Structure
11485Parameter
11486
11487Type
11488
11489Description
11490
11491count {2:}
11492
11493UINT32
11494
11495number of digests in the list, minimum is two for
11496TPM2_PolicyOR().
11497
11498digests [count] {:8}
11499
11500TPM2B_DIGEST
11501
11502 a list of digests
11503For TPM2_PolicyOR(), all digests will have been
11504computed using the digest of the policy session. For
11505TPM2_PCR_Read(), each digest will be the size of the
11506digest for the bank containing the PCR.
11507
11508#TPM_RC_SIZE
11509
11510response code when count is not at least two or is
11511greater than eight
11512
1151310.8.6 TPML_DIGEST_VALUES
11514This list is used to convey a list of digest values. This type is returned by TPM2_Event() and
11515TPM2_SequenceComplete() and is an input for TPM2_PCR_Extend().
11516NOTE 1
11517
11518This construct limits the number of hashes in the list to the number of digests implemented in the TPM
11519rather than the number of PCR banks. This allows extra values to appear in a call t o
11520TPM2_PCR_Extend().
11521
11522NOTE 2
11523
11524The digest for an unimplemented hash algorithm may not be in a list because the TPM may not recognize
11525the algorithm as being a hash and it may not know the digest size.
11526
11527Table 97 — Definition of TPML_DIGEST_VALUES Structure
11528Parameter
11529
11530Type
11531
11532Description
11533
11534count
11535
11536UINT32
11537
11538number of digests in the list
11539
11540digests [count] {:HASH_COUNT}
11541
11542TPMT_HA
11543
11544a list of tagged digests
11545response code when count is greater than the possible
11546number of banks
11547
11548#TPM_RC_SIZE
11549
1155010.8.7 TPM2B_DIGEST_VALUES
11551Digest list in a sized buffer. This list is returned by TPM2_PCR_SequenceComplete().
11552Table 98 — Definition of TPM2B_DIGEST_VALUES Structure
11553Parameter
11554
11555Type
11556
11557Description
11558
11559size
11560
11561UINT16
11562
11563size of the operand buffer
11564
11565buffer [size] {:sizeof(TPML_DIGEST_VALUES)}
11566
11567BYTE
11568
11569the operand
11570
11571Family “2.0”
11572Level 00 Revision 00.99
11573
11574Published
11575Copyright © TCG 2006-2013
11576
11577Page 95
11578October 31, 2013
11579
11580Part 2: Structures
11581
11582Trusted Platform Module Library
11583
1158410.8.8 TPML_PCR_SELECTION
11585This list is used to indicate the PCR that are included in a selection when more than one PCR value may
11586be selected.
11587This structure is an input parameter to TPM2_PolicyPCR() to indicate the PCR that will be included in the
11588digest of PCR for the authorization. The structure is used in TPM2_PCR_Read() command to indicate the
11589PCR values to be returned and in the response to indicate which PCR are included in the list of returned
11590digests. The structure is an output parameter from TPM2_Create() and indicates the PCR used in the
11591digest of the PCR state when the object was created. The structure is also contained in the attestation
11592structure of TPM2_Quote().
11593When this structure is used to select PCR to be included in a digest, the selected PCR are concatenated
11594to create a “message” containing all of the PCR, and then the message is hashed using the contextspecific hash algorithm.
11595Table 99 — Definition of TPML_PCR_SELECTION Structure
11596Parameter
11597
11598Type
11599
11600Description
11601
11602count
11603
11604UINT32
11605
11606number of selection structures
11607A value of zero is allowed.
11608
11609pcrSelections [count] {:HASH_COUNT}
11610
11611TPMS_PCR_SELECTION
11612
11613list of selections
11614response code when count is greater
11615than the possible number of banks
11616
11617#TPM_RC_SIZE
11618
1161910.8.9 TPML_ALG_PROPERTY
11620This list is used to report on a list of algorithm attributes. It is returned in a TPM2_GetCapability().
11621Table 100 — Definition of TPML_ALG_PROPERTY Structure <OUT>
11622Parameter
11623
11624Type
11625
11626Description
11627
11628count
11629
11630UINT32
11631
11632number of algorithm properties structures
11633A value of zero is allowed.
11634
11635algProperties [count] {:MAX_CAP_ALGS}
11636
11637TPMS_ALG_PROPERTY
11638
11639list of properties
11640
1164110.8.10 TPML_TAGGED_TPM_PROPERTY
11642This list is used to report on a list of properties that are TPMS_TAGGED_PROPERTY values. It is
11643returned by a TPM2_GetCapability().
11644Table 101 — Definition of TPML_TAGGED_TPM_PROPERTY Structure <OUT>
11645Parameter
11646
11647Type
11648
11649Description
11650
11651count
11652
11653UINT32
11654
11655number of properties
11656A value of zero is allowed.
11657
11658tpmProperty [count] {:MAX_TPM_PROPERTIES}
11659
11660TPMS_TAGGED_PROPERTY
11661
11662Page 96
11663October 31, 2013
11664
11665Published
11666Copyright © TCG 2006-2013
11667
11668an array of tagged properties
11669
11670Family “2.0”
11671Level 00 Revision 00.99
11672
11673Trusted Platform Module Library
11674
11675Part 2: Structures
11676
1167710.8.11 TPML_TAGGED_PCR_PROPERTY
11678This list is used to report on a list of properties that are TPMS_PCR_SELECT values. It is returned by a
11679TPM2_GetCapability().
11680Table 102 — Definition of TPML_TAGGED_PCR_PROPERTY Structure <OUT>
11681Parameter
11682
11683Type
11684
11685Description
11686
11687count
11688
11689UINT32
11690
11691number of properties
11692A value of zero is allowed.
11693
11694pcrProperty [count] {:MAX_PCR_PROPERTIES}
11695
11696TPMS_TAGGED_PCR_SELECT
11697
11698 a tagged PCR selection
11699
1170010.8.12 TPML_ECC_CURVE
11701This list is used to report the ECC curve ID values supported by the TPM. It is returned by a
11702TPM2_GetCapability().
11703Table 103 — Definition of {ECC} TPML_ECC_CURVE Structure <OUT>
11704Parameter
11705
11706Type
11707
11708Description
11709
11710count
11711
11712UINT32
11713
11714number of curves
11715A value of zero is allowed.
11716
11717eccCurves [count] {:MAX_ECC_CURVES}
11718
11719TPM_ECC_CURVE
11720
11721array of ECC curve identifiers
11722
1172310.9 Capabilities Structures
1172410.9.1 TPMU_CAPABILITIES
11725Table 104 — Definition of TPMU_CAPABILITIES Union <OUT>
11726Parameter
11727
11728Type
11729
11730Selector
11731
11732algorithms
11733
11734TPML_ALG_PROPERTY
11735
11736TPM_CAP_ALGS
11737
11738handles
11739
11740TPML_HANDLE
11741
11742TPM_CAP_HANDLES
11743
11744command
11745
11746TPML_CCA
11747
11748TPM_CAP_COMMANDS
11749
11750ppCommands
11751
11752TPML_CC
11753
11754TPM_CAP_PP_COMMANDS
11755
11756auditCommands
11757
11758TPML_CC
11759
11760TPM_CAP_AUDIT_COMMANDS
11761
11762assignedPCR
11763
11764TPML_PCR_SELECTION
11765
11766TPM_CAP_PCRS
11767
11768tpmProperties
11769
11770TPML_TAGGED_TPM_PROPERTY
11771
11772TPM_CAP_TPM_PROPERTIES
11773
11774pcrProperties
11775
11776TPML_TAGGED_PCR_PROPERTY
11777
11778TPM_CAP_PCR_PROPERTIES
11779
11780eccCurves
11781
11782TPML_ECC_CURVE
11783
11784TPM_CAP_ECC_CURVES
11785
11786Family “2.0”
11787Level 00 Revision 00.99
11788
11789Published
11790Copyright © TCG 2006-2013
11791
11792Description
11793
11794TPM_ALG_ECC
11795
11796Page 97
11797October 31, 2013
11798
11799Part 2: Structures
11800
11801Trusted Platform Module Library
11802
1180310.9.2 TPMS_CAPABILITY_DATA
11804This data area is returned in response to a TPM2_GetCapability().
11805Table 105 — Definition of TPMS_CAPABILITY_DATA Structure <OUT>
11806Parameter
11807
11808Type
11809
11810Description
11811
11812capability
11813
11814TPM_CAP
11815
11816the capability
11817
11818[capability]data
11819
11820TPMU_CAPABILITIES
11821
11822the capability data
11823
1182410.10 Clock/Counter Structures
1182510.10.1 TPMS_CLOCK_INFO
11826This structure is used in each of the attestation commands.
11827Table 106 — Definition of TPMS_CLOCK_INFO Structure
11828Parameter
11829
11830Type
11831
11832Description
11833
11834clock
11835
11836UINT64
11837
11838time in milliseconds during which the TPM has been powered
11839This structure element is used to report on the TPM's Clock value.
11840The value of Clock shall be recorded in non-volatile memory no
1184122
11842less often than once per 2 milliseconds (~69.9 minutes) of TPM
11843operation. The reference for the millisecond timer is the TPM
11844oscillator.
11845This value is reset to zero when the Storage Primary Seed is
11846changed (TPM2_Clear()).
11847This value may be advanced by TPM2_AdvanceClock().
11848
11849resetCount
11850
11851UINT32
11852
11853number of occurrences of TPM Reset since the last TPM2_Clear()
11854
11855restartCount
11856
11857UINT32
11858
11859number of times that TPM2_Shutdown() or _TPM_Hash_Start have
11860occurred since the last TPM Reset or TPM2_Clear().
11861
11862safe
11863
11864TPMI_YES_NO
11865
11866no value of Clock greater than the current value of Clock has been
11867previously reported by the TPM. Set to YES on TPM2_Clear().
11868
1186910.10.2 Clock
11870Clock is a monotonically increasing counter that advances whenever power is applied to the TPM. The
11871value of Clock may be set forward with TPM2_ClockSet() if ownerAuth or platformAuth is provided. The
11872value of Clock is incremented each millisecond.
11873TPM2_Clear() will set Clock to zero.
11874Clock will be non-volatile but may have a volatile component that is updated every millisecond with the
11875non-volatile component updated at a lower rate. If the implementation uses a volatile component, the non22
11876volatile component shall be updated no less frequently than every 2 milliseconds (~69.9 minutes). The
11877update rate of the non-volatile portion of Clock shall be reported by a TPM2_GetCapability() with
11878capability = TPM_CAP_TPM_PROPERTIES and property = TPM_PT_CLOCK_UPDATE.
1187910.10.3 ResetCount
11880This counter shall increment on each TPM Reset. This counter shall be reset to zero by TPM2_Clear().
11881
11882Page 98
11883October 31, 2013
11884
11885Published
11886Copyright © TCG 2006-2013
11887
11888Family “2.0”
11889Level 00 Revision 00.99
11890
11891Trusted Platform Module Library
11892
11893Part 2: Structures
11894
1189510.10.4 RestartCount
11896This counter shall increment by one for each TPM Restart or TPM Resume. The restartCount shall be
11897reset to zero on a TPM Reset or TPM2_Clear().
1189810.10.5 Safe
11899This parameter is set to YES when the value reported in Clock is guaranteed to be unique for the current
11900Owner. It is set to NO when the value of Clock may have been reported in a previous attestation or
11901access.
11902This parameter will be YES if a TPM2_Startup() was preceded by TPM2_Shutdown() with no intervening
11903commands. It will also be YES after an update of the non-volatile bits of Clock have been updated at the
11904end of an update interval.
11905If a TPM implementation does not implement
11906TPMS_CLOCK_INFO.clock shall always be zero.
11907
11908Clock,
11909
11910Safe
11911
11912shall
11913
11914always
11915
11916be
11917
11918NO
11919
11920and
11921
11922This parameter will be set to YES by TPM2_Clear().
1192310.10.6 TPMS_TIME_INFO
11924This structure is used in the TPM2_TICK attestation.
11925The Time value reported in this structure is reset whenever the TPM is reset. An implementation may
11926reset the value of Time any time after _TPM_Init and before the TPM returns after TPM2_Start(). The
11927value of Time shall increment continuously while power is applied to the TPM.
11928Table 107 — Definition of TPMS_TIME_INFO Structure
11929Parameter
11930
11931Type
11932
11933Description
11934
11935time
11936
11937UINT64
11938
11939time in milliseconds since the last _TPM_Init() or TPM2_Startup()
11940This structure element is used to report on the TPM's Time value.
11941
11942clockInfo
11943
11944TPMS_CLOCK_INFO
11945
11946a structure containing the clock information
11947
11948Family “2.0”
11949Level 00 Revision 00.99
11950
11951Published
11952Copyright © TCG 2006-2013
11953
11954Page 99
11955October 31, 2013
11956
11957Part 2: Structures
11958
11959Trusted Platform Module Library
11960
1196110.11 TPM Attestation Structures
1196210.11.1 Introduction
11963This clause describes the structures that are used when a TPM creates a structure to be signed. The
11964signing structures follow a standard format TPM2B_ATTEST with case-specific information embedded.
1196510.11.2 TPMS_TIME_ATTEST_INFO
11966This structure is used when the TPM performs TPM2_GetClock.
11967Table 108 — Definition of TPMS_TIME_ATTEST_INFO Structure <OUT>
11968Parameter
11969
11970Type
11971
11972Description
11973
11974time
11975
11976TPMS_TIME_INFO
11977
11978the Time, clock, resetCount, restartCount, and Safe indicator
11979
11980firmwareVersion
11981
11982UINT64
11983
11984a vendor-specific value indicating the version number of the
11985firmware
11986
1198710.11.3 TPMS_CERTIFY_INFO
11988This is the attested data for TPM2_Certify().
11989Table 109 — Definition of TPMS_CERTIFY_INFO Structure <OUT>
11990Parameter
11991
11992Type
11993
11994Description
11995
11996name
11997
11998TPM2B_NAME
11999
12000Name of the certified object
12001
12002qualifiedName
12003
12004TPM2B_NAME
12005
12006Qualified Name of the certified object
12007
1200810.11.1 TPMS_QUOTE_INFO
12009This is the attested data for TPM2_Quote().
12010Table 110 — Definition of TPMS_QUOTE_INFO Structure <OUT>
12011Parameter
12012
12013Type
12014
12015Description
12016
12017pcrSelect
12018
12019TPML_PCR_SELECTION
12020
12021information on algID, PCR selected and digest
12022
12023pcrDigest
12024
12025TPM2B_DIGEST
12026
12027digest of the selected PCR using the hash of the signing key
12028
12029Page 100
12030October 31, 2013
12031
12032Published
12033Copyright © TCG 2006-2013
12034
12035Family “2.0”
12036Level 00 Revision 00.99
12037
12038Trusted Platform Module Library
12039
12040Part 2: Structures
12041
1204210.11.2 TPMS_COMMAND_AUDIT_INFO
12043This is the attested data for TPM2_GetCommandAuditDigest().
12044Table 111 — Definition of TPMS_COMMAND_AUDIT_INFO Structure <OUT>
12045Parameter
12046
12047Type
12048
12049Description
12050
12051auditCounter
12052
12053UINT64
12054
12055the monotonic audit counter
12056
12057digestAlg
12058
12059TPM_ALG_ID
12060
12061hash algorithm used for the command audit
12062
12063auditDigest
12064
12065TPM2B_DIGEST
12066
12067the current value of the audit digest
12068
12069commandDigest
12070
12071TPM2B_DIGEST
12072
12073digest of the command codes being audited using digestAlg
12074
1207510.11.3 TPMS_SESSION_AUDIT_INFO
12076This is the attested data for TPM2_GetSessionAuditDigest().
12077Table 112 — Definition of TPMS_SESSION_AUDIT_INFO Structure <OUT>
12078Parameter
12079
12080Type
12081
12082Description
12083
12084exclusiveSession
12085
12086TPMI_YES_NO
12087
12088current exclusive status of the session
12089TRUE if all of the commands recorded in the sessionDigest were
12090executed without any intervening TPM command that did not use
12091this transport session
12092
12093sessionDigest
12094
12095TPM2B_DIGEST
12096
12097the current value of the session audit digest
12098
1209910.11.4 TPMS_CREATION_INFO
12100This is the attested data for TPM2_CertifyCreation().
12101Table 113 — Definition of TPMS_CREATION_INFO Structure <OUT>
12102Parameter
12103
12104Type
12105
12106Description
12107
12108objectName
12109
12110TPM2B_NAME
12111
12112Name of the object
12113
12114creationHash
12115
12116TPM2B_DIGEST
12117
12118creationHash
12119
1212010.11.5 TPMS_NV_CERTIFY_INFO
12121This structure contains the Name and contents of the selected NV Index that is certified by
12122TPM2_NV_Certify().
12123Table 114 — Definition of TPMS_NV_CERTIFY_INFO Structure <OUT>
12124Parameter
12125
12126Type
12127
12128Description
12129
12130indexName
12131
12132TPM2B_NAME
12133
12134Name of the NV Index
12135
12136offset
12137
12138UINT16
12139
12140the offset parameter of TPM2_NV_Certify()
12141
12142nvContents
12143
12144TPM2B_MAX_NV_BUFFER
12145
12146contents of the NV Index
12147
12148Family “2.0”
12149Level 00 Revision 00.99
12150
12151Published
12152Copyright © TCG 2006-2013
12153
12154Page 101
12155October 31, 2013
12156
12157Part 2: Structures
12158
12159Trusted Platform Module Library
12160
1216110.11.6 TPMI_ST_ATTEST
12162Table 115 — Definition of (TPM_ST) TPMI_ST_ATTEST Type <OUT>
12163Value
12164
12165Description
12166
12167TPM_ST_ATTEST_CERTIFY
12168
12169generated by TPM2_Certify()
12170
12171TPM_ST_ATTEST_QUOTE
12172
12173generated by TPM2_Quote()
12174
12175TPM_ST_ATTEST_SESSION_AUDIT
12176
12177generated by TPM2_GetSessionAuditDigest()
12178
12179TPM_ST_ATTEST_COMMAND_AUDIT
12180
12181generated by TPM2_GetCommandAuditDigest()
12182
12183TPM_ST_ATTEST_TIME
12184
12185generated by TPM2_GetTime()
12186
12187TPM_ST_ATTEST_CREATION
12188
12189generated by TPM2_CertifyCreation()
12190
12191TPM_ST_ATTEST_NV
12192
12193generated by TPM2_NV_Certify()
12194
1219510.11.7 TPMU_ATTEST
12196Table 116 — Definition of TPMU_ATTEST Union <OUT>
12197Parameter
12198
12199Type
12200
12201Selector
12202
12203certify
12204
12205TPMS_CERTIFY_INFO
12206
12207TPM_ST_ATTEST_CERTIFY
12208
12209creation
12210
12211TPMS_CREATION_INFO
12212
12213TPM_ST_ATTEST_CREATION
12214
12215quote
12216
12217TPMS_QUOTE_INFO
12218
12219TPM_ST_ATTEST_QUOTE
12220
12221commandAudit
12222
12223TPMS_COMMAND_AUDIT_INFO
12224
12225TPM_ST_ATTEST_COMMAND_AUDIT
12226
12227sessionAudit
12228
12229TPMS_SESSION_AUDIT_INFO
12230
12231TPM_ST_ATTEST_SESSION_AUDIT
12232
12233time
12234
12235TPMS_TIME_ATTEST_INFO
12236
12237TPM_ST_ATTEST_TIME
12238
12239nv
12240
12241TPMS_NV_CERTIFY_INFO
12242
12243TPM_ST_ATTEST_NV
12244
12245Page 102
12246October 31, 2013
12247
12248Published
12249Copyright © TCG 2006-2013
12250
12251Family “2.0”
12252Level 00 Revision 00.99
12253
12254Trusted Platform Module Library
12255
12256Part 2: Structures
12257
1225810.11.8 TPMS_ATTEST
12259This structure is used on each TPM-generated signed structure. The signature is over this structure.
12260When the structure is signed by a key in the Storage hierarchy, the values of clockInfo.resetCount,
12261clockInfo.restartCount, and firmwareVersion are obfuscated with a per-key obfuscation value.
12262Table 117 — Definition of TPMS_ATTEST Structure <OUT>
12263Parameter
12264
12265Type
12266
12267Description
12268
12269magic
12270
12271TPM_GENERATED
12272
12273the indication that this structure was created by a TPM (always
12274TPM_GENERATED_VALUE)
12275
12276type
12277
12278TPMI_ST_ATTEST
12279
12280type of the attestation structure
12281
12282qualifiedSigner
12283
12284TPM2B_NAME
12285
12286Qualified Name of the signing key
12287
12288extraData
12289
12290TPM2B_DATA
12291
12292external information supplied by caller
12293NOTE
12294
12295A TPM2B_DATA structure provides room for a digest and a
12296method indicator to indicate the components of the digest.
12297The definition of this method indicator is outside the scope
12298of this specification.
12299
12300clockInfo
12301
12302TPMS_CLOCK_INFO
12303
12304Clock, resetCount, restartCount, and Safe
12305
12306firmwareVersion
12307
12308UINT64
12309
12310TPM-vendor-specific field identifying the firmware on the TPM
12311
12312[type]attested
12313
12314TPMU_ATTEST
12315
12316the type-specific attestation information
12317
1231810.11.9 TPM2B_ATTEST
12319This sized buffer to contain the signed structure. The attestationData is the signed portion of the structure.
12320The size parameter is not signed.
12321Table 118 — Definition of TPM2B_ATTEST Structure <OUT>
12322Parameter
12323
12324Type
12325
12326Description
12327
12328size
12329
12330UINT16
12331
12332size of the attestationData structure
12333
12334attestationData [size] {:sizeof(TPMS_ATTEST)}
12335
12336BYTE
12337
12338the signed structure
12339
12340Family “2.0”
12341Level 00 Revision 00.99
12342
12343Published
12344Copyright © TCG 2006-2013
12345
12346Page 103
12347October 31, 2013
12348
12349Part 2: Structures
12350
12351Trusted Platform Module Library
12352
1235310.12 Authorization Structures
12354The structures in this clause are used for all authorizations. One or more of these structures will be
12355present in a command or response that has a tag of TPM_ST_SESSIONS.
1235610.12.1 TPMS_AUTH_COMMAND
12357This is the format used for each of the authorizations in the session area of a command.
12358Table 119 — Definition of TPMS_AUTH_COMMAND Structure <IN>
12359Parameter
12360
12361Type
12362
12363Description
12364
12365sessionHandle
12366
12367TPMI_SH_AUTH_SESSION+
12368
12369the session handle
12370
12371nonce
12372
12373TPM2B_NONCE
12374
12375the session nonce, may be the Empty Buffer
12376
12377sessionAttributes
12378
12379TPMA_SESSION
12380
12381the session attributes
12382
12383hmac
12384
12385TPM2B_AUTH
12386
12387either an HMAC, a password, or an EmptyAuth
12388
1238910.12.2 TPMS_AUTH_RESPONSE
12390This is the format for each of the authorizations in the session area of the response. If the TPM returns
12391TPM_RC_SUCCESS, then the session area of the response contains the same number of authorizations
12392as the command and the authorizations are in the same order.
12393Table 120 — Definition of TPMS_AUTH_RESPONSE Structure <OUT>
12394Parameter
12395
12396Type
12397
12398Description
12399
12400nonce
12401
12402TPM2B_NONCE
12403
12404the session nonce, may be the Empty Buffer
12405
12406sessionAttributes
12407
12408TPMA_SESSION
12409
12410the session attributes
12411
12412hmac
12413
12414TPM2B_AUTH
12415
12416either an HMAC, a password, or an EmptyAuth
12417
12418Page 104
12419October 31, 2013
12420
12421Published
12422Copyright © TCG 2006-2013
12423
12424Family “2.0”
12425Level 00 Revision 00.99
12426
12427Trusted Platform Module Library
12428
12429Part 2: Structures
12430
1243111 Algorithm Parameters and Structures
1243211.1 Symmetric
1243311.1.1 Introduction
12434This clause defines the parameters and structures for describing symmetric algorithms.
1243511.1.2 TPMI_AES_KEY_BITS
12436This interface type defines the supported sizes for an AES key. This type is used to allow the
12437unmarshaling routine to generate the proper validation code for the supported key sizes. An
12438implementation that supports different key sizes would have a different set of selections.
12439When used in TPM2_StartAuthSession(), the mode parameter shall be TPM_ALG_CFB.
12440NOTE 1
12441
12442Key size is expressed in bits.
12443
12444NOTE 2
12445
12446The definition for AES_KEY_SIZES_BITS used in the reference implementation is found in Annex B
12447
12448Table 121 — Definition of {AES} (TPM_KEY_BITS) TPMI_AES_KEY_BITS Type
12449Parameter
12450
12451Description
12452
12453$AES_KEY_SIZES_BITS
12454
12455number of bits in the key
12456
12457#TPM_RC_VALUE
12458
12459error when key size is not supported
12460
1246111.1.3 TPMI_SM4_KEY_BITS
12462This interface type defines the supported sizes for an SM4 key. This type is used to allow the
12463unmarshaling routine to generate the proper validation code for the supported key sizes. An
12464implementation that supports different key sizes would have a different set of selections.
12465NOTE
12466
12467SM4 only supports a key size of 128 bits.
12468
12469Table 122 — Definition of {SM4} (TPM_KEY_BITS) TPMI_SM4_KEY_BITS Type
12470Parameter
12471
12472Description
12473
12474$SM4_KEY_SIZES_BITS
12475
12476number of bits in the key
12477
12478#TPM_RC_VALUE
12479
12480Family “2.0”
12481Level 00 Revision 00.99
12482
12483Published
12484Copyright © TCG 2006-2013
12485
12486Page 105
12487October 31, 2013
12488
12489Part 2: Structures
12490
12491Trusted Platform Module Library
12492
1249311.1.4 TPMU_SYM_KEY_BITS
12494This union is used to collect the symmetric encryption key sizes.
12495The xor entry is a hash algorithms selector and not a key size in bits. This overload is used in order to
12496avoid an additional level of indirection with another union and another set of selectors.
12497The xor entry is only selected in a TPMT_SYM_DEF, which is used to select the parameter encryption
12498value.
12499Table 123 — Definition of TPMU_SYM_KEY_BITS Union
12500Parameter
12501
12502Type
12503
12504Selector
12505
12506aes
12507
12508TPMI_AES_KEY_BITS
12509
12510TPM_ALG_AES
12511
12512SM4
12513
12514TPMI_SM4_KEY_BITS
12515
12516TPM_ALG_SM4
12517
12518sym
12519
12520TPM_KEY_BITS
12521
12522xor
12523
12524TPMI_ALG_HASH
12525
12526Description
12527
12528when selector may be any of the
12529symmetric block ciphers
12530
12531overload for using xor
12532NOTE
12533
12534null
12535
12536
1253711.1.5 TPMU_SYM_MODE
12538This union allows the mode value in a TPMT_SYM_DEF or TPMT_SYM_DEF_OBJECT to be empty.
12539Table 124 — Definition of TPMU_SYM_MODE Union
12540Parameter
12541
12542Type
12543
12544Selector
12545
12546Description
12547
12548aes
12549
12550TPMI_ALG_SYM_MODE
12551
12552TPM_ALG_AES
12553
12554NOTE
12555
12556
12557SM4
12558
12559TPMI_ALG_SYM_MODE
12560
12561TPM_ALG_SM4
12562
12563NOTE
12564
12565sym
12566
12567TPMI_ALG_SYM_MODE
12568
12569when selector may be any of the
12570symmetric block ciphers
12571
12572no mode selector
12573
12574null
12575
12576TPM_ALG_NULL
12577
12578no mode selector
12579
12580Page 106
12581October 31, 2013
12582
12583Published
12584Copyright © TCG 2006-2013
12585
12586Family “2.0”
12587Level 00 Revision 00.99
12588
12589Trusted Platform Module Library
12590
12591Part 2: Structures
12592
1259311.1.6 TPMU_SYM_DETAILS
12594This union allows additional parameters to be added for a symmetric cipher. Currently, no additional
12595parameters are required for any of the symmetric algorithms.
12596NOTE
12597
12598The “x” character in the table title will suppress generation of this type as the parser is not, at this time,
12599able to generate the proper values (a union of all empty data types). When an algorithm is added that
12600requires additional parameterization, the Type column will contain a value and the “x” may be removed.
12601
12602Table 125 — xDefinition of TPMU_SYM_DETAILS Union
12603Parameter
12604
12605Type
12606
12607Selector
12608
12609aes
12610
12611TPM_ALG_AES
12612
12613SM4
12614
12615Description
12616
12617TPM_ALG_SM4
12618
12619sym
12620
12621when selector may be any of the
12622symmetric block ciphers
12623
12624xor
12625
12626TPM_ALG_XOR
12627
12628null
12629
12630TPM_ALG_NULL
12631
1263211.1.7 TPMT_SYM_DEF
12633The TPMT_SYM_DEF structure is used to select an algorithm to be used for parameter encryption in
12634those cases when different symmetric algorithms may be selected.
12635Table 126 — Definition of TPMT_SYM_DEF Structure
12636Parameter
12637
12638Type
12639
12640Description
12641
12642algorithm
12643
12644+TPMI_ALG_SYM
12645
12646indicates a symmetric algorithm
12647
12648[algorithm]keyBits
12649
12650TPMU_SYM_KEY_BITS
12651
12652a supported key size
12653
12654[algorithm]mode
12655
12656TPMU_SYM_MODE
12657
12658the mode for the key
12659
12660//[algorithm]details
12661
12662//TPMU_SYM_DETAILS
12663
12664contains additional algorithm details
12665NOTE
12666
12667This is commented out at this time as the parser
12668may not produce the proper code for a union if
12669none of the selectors produces any data.
12670
1267111.1.8 TPMT_SYM_DEF_OBJECT
12672This structure is used when different symmetric block cipher (not XOR) algorithms may be selected.
12673Table 127 — Definition of TPMT_SYM_DEF_OBJECT Structure
12674Parameter
12675
12676Type
12677
12678Description
12679
12680algorithm
12681
12682+TPMI_ALG_SYM_OBJECT
12683
12684selects a symmetric block cipher
12685
12686[algorithm]keyBits
12687
12688TPMU_SYM_KEY_BITS
12689
12690the key size
12691
12692[algorithm]mode
12693
12694TPMU_SYM_MODE
12695
12696default mode
12697
12698//[algorithm]details
12699
12700//TPMU_SYM_DETAILS
12701
12702contains the additional algorithm details, if any
12703NOTE
12704
12705Family “2.0”
12706Level 00 Revision 00.99
12707
12708This is commented out at this time as the parser
12709may not produce the proper code for a union if
12710none of the selectors produces any data.
12711
12712Published
12713Copyright © TCG 2006-2013
12714
12715Page 107
12716October 31, 2013
12717
12718Part 2: Structures
12719
12720Trusted Platform Module Library
12721
1272211.1.9 TPM2B_SYM_KEY
12723This structure is used to hold a symmetric key in the sensitive area of an asymmetric object.
12724The number of bits in the key is in keyBits in the public area. When keyBits is not an even multiple of 8
12725bits, the unused bits of buffer will be the most significant bits of buffer[0] and size will be rounded up to
12726the number of octets required to hold all bits of the key.
12727Table 128 — Definition of TPM2B_SYM_KEY Structure
12728Parameter
12729
12730Type
12731
12732Description
12733
12734size
12735
12736UINT16
12737
12738size, in octets, of the buffer containing the key; may be
12739zero
12740
12741buffer [size] {:MAX_SYM_KEY_BYTES}
12742
12743BYTE
12744
12745the key
12746
1274711.1.10 TPMS_SYMCIPHER_PARMS
12748This structure contains the parameters for a symmetric block cipher object.
12749Table 129 — Definition of TPMS_SYMCIPHER_PARMS Structure
12750Parameter
12751
12752Type
12753
12754Description
12755
12756sym
12757
12758TPMT_SYM_DEF_OBJECT
12759
12760a symmetric block cipher
12761
1276211.1.11 TPM2B_SENSITIVE_DATA
12763This buffer holds the secret data of a data object. It can hold as much as 128 octets of data.
12764MAX_SYM_DATA shall be 128.
12765NOTE
12766
12767A named value rather than a numeric is used to make coding clearer. A numeric value does not indicate
12768the reason that it has the specific value that is has.
12769
12770Table 130 — Definition of TPM2B_SENSITIVE_DATA Structure
12771Parameter
12772
12773Type
12774
12775size
12776
12777UINT16
12778
12779buffer [size] {:MAX_SYM_DATA}
12780
12781BYTE
12782
12783Page 108
12784October 31, 2013
12785
12786Description
12787
12788the keyed hash private data structure
12789
12790Published
12791Copyright © TCG 2006-2013
12792
12793Family “2.0”
12794Level 00 Revision 00.99
12795
12796Trusted Platform Module Library
12797
12798Part 2: Structures
12799
1280011.1.12 TPMS_SENSITIVE_CREATE
12801This structure defines the values to be placed in the sensitive area of a created object. This structure is
12802only used within a TPM2B_SENSITIVE_CREATE structure.
12803NOTE
12804
12805When sent to the TPM or unsealed, data is usually encrypted using parameter encryption.
12806
12807If data.size is not zero, and the object is not a keyedHash, data.size must match the size indicated in the
12808keySize of public.parameters. If the object is a keyedHash, data.size may be any value up to the
12809maximum allowed in a TPM2B_SENSITIVE_DATA.
12810For an asymmetric object, data shall be an Empty Buffer and sensitiveDataOrigin shall be SET.
12811Table 131 — Definition of TPMS_SENSITIVE_CREATE Structure <IN>
12812Parameter
12813
12814Type
12815
12816Description
12817
12818userAuth
12819
12820TPM2B_AUTH
12821
12822the USER auth secret value
12823
12824data
12825
12826TPM2B_SENSITIVE_DATA
12827
12828data to be sealed
12829
12830Family “2.0”
12831Level 00 Revision 00.99
12832
12833Published
12834Copyright © TCG 2006-2013
12835
12836Page 109
12837October 31, 2013
12838
12839Part 2: Structures
12840
12841Trusted Platform Module Library
12842
1284311.1.13 TPM2B_SENSITIVE_CREATE
12844This structure contains the sensitive creation data in a sized buffer. This structure is defined so that both
12845the userAuth and data values of the TPMS_SENSITIVE_CREATE may be passed as a single parameter
12846for parameter encryption purposes.
12847Table 132 — Definition of TPM2B_SENSITIVE_CREATE Structure <IN, S>
12848Parameter
12849
12850Type
12851
12852Description
12853
12854size=
12855
12856UINT16
12857
12858size of sensitive in octets (may not be zero)
12859NOTE
12860
12861sensitive
12862
12863TPMS_SENSITIVE_CREATE
12864
12865The userAuth and data parameters in this buffer
12866may both be zero length but the minimum size of
12867this parameter will be the sum of the size fields of
12868the
12869two
12870parameters
12871of
12872the
12873TPMS_SENSITIVE_CREATE.
12874
12875data to be sealed or a symmetric key value.
12876
1287711.1.14 TPMS_SCHEME_SIGHASH
12878This structure is the scheme data for schemes that only require a hash to complete the scheme definition.
12879Table 133 — Definition of TPMS_SCHEME_SIGHASH Structure
12880Parameter
12881
12882Type
12883
12884Description
12885
12886hashAlg
12887
12888TPMI_ALG_HASH
12889
12890the hash algorithm used to digest the message
12891
1289211.1.15 TPMI_ALG_HASH_SCHEME
12893This is the list of values that may appear in a keyedHash as the scheme parameter.
12894Table 134 — Definition of (TPM_ALG_ID) TPMI_ALG_KEYEDHASH_SCHEME Type
12895Values
12896
12897Comments
12898
12899TPM_ALG_HMAC
12900
12901the "signing" scheme
12902
12903TPM_ALG_XOR
12904
12905the "obfuscation" scheme
12906
12907+TPM_ALG_NULL
12908#TPM_RC_VALUE
12909
1291011.1.16 HMAC_SIG_SCHEME
12911Table 135 — Definition of Types for HMAC_SIG_SCHEME
12912Type
12913
12914Name
12915
12916TPMS_SCHEME_SIGHASH
12917
12918TPMS_SCHEME_HMAC
12919
12920Page 110
12921October 31, 2013
12922
12923Description
12924
12925Published
12926Copyright © TCG 2006-2013
12927
12928Family “2.0”
12929Level 00 Revision 00.99
12930
12931Trusted Platform Module Library
12932
12933Part 2: Structures
12934
1293511.1.17 TPMS_SCHEME_XOR
12936This structure is for the XOR encryption scheme.
12937Table 136 — Definition of TPMS_SCHEME_XOR Structure
12938Parameter
12939
12940Type
12941
12942Description
12943
12944hashAlg
12945
12946+TPMI_ALG_HASH
12947
12948the hash algorithm used to digest the message
12949
12950kdf
12951
12952TPMI_ALG_KDF
12953
12954the key derivation function
12955
1295611.1.18 TPMU_SCHEME_HMAC
12957Table 137 — Definition of TPMU_SCHEME_KEYEDHASH Union <IN/OUT, S>
12958Parameter
12959
12960Type
12961
12962Selector
12963
12964Description
12965
12966hmac
12967
12968TPMS_SCHEME_HMAC
12969
12970TPM_ALG_HMAC
12971
12972the "signing" scheme
12973
12974xor
12975
12976TPMS_SCHEME_XOR
12977
12978TPM_ALG_XOR
12979
12980the "obfuscation" scheme
12981
12982null
12983
12984TPM_ALG_NULL
12985
1298611.1.19 TPMT_KEYEDHASH_SCHEME
12987This structure is used for a hash signing object.
12988Table 138 — Definition of TPMT_KEYEDHASH_SCHEME Structure
12989Parameter
12990
12991Type
12992
12993Description
12994
12995scheme
12996
12997+TPMI_ALG_KEYEDHASH_SCHEME
12998
12999selects the scheme
13000
13001[scheme]details
13002
13003TPMU_SCHEME_KEYEDHASH
13004
13005the scheme parameters
13006
13007Family “2.0”
13008Level 00 Revision 00.99
13009
13010Published
13011Copyright © TCG 2006-2013
13012
13013Page 111
13014October 31, 2013
13015
13016Part 2: Structures
13017
13018Trusted Platform Module Library
13019
1302011.2 Asymmetric
1302111.2.1 Signing Schemes
1302211.2.1.1
13023
13024Introduction
13025
13026These structures are used to define the method in which the signature is to be created. These schemes
13027would appear in an object’s public area and in commands where the signing scheme is variable.
13028Every scheme is required to indicate a hash that is used in digesting the message.
1302911.2.1.2
13030
13031RSA_SIG_SCHEMES
13032
13033These are the RSA schemes that only need a hash algorithm as a scheme parameter.
13034For the TPM_ALG_RSAPSS signing scheme, the same hash algorithm is used for digesting TPMgenerated data (an attestation structure) and in the KDF used for the masking operation. The salt size is
13035always the largest salt value that will fit into the available space.
13036Table 139 — Definition of {RSA} Types for RSA_SIG_SCHEMES
13037Type
13038
13039Name
13040
13041Description
13042
13043TPMS_SCHEME_SIGHASH
13044TPMS_SCHEME_RSASSA
13045TPMS_SCHEME_SIGHASH
13046TPMS_SCHEME_RSAPSS
13047
1304811.2.1.3
13049
13050ECC_SIG_SCHEMES
13051
13052These are the ECC schemes that only need a hash algorithm as a controlling parameter.
13053Table 140 — Definition of {ECC} Types for ECC_SIG_SCHEMES
13054Type
13055
13056Name
13057
13058Description
13059
13060TPMS_SCHEME_SIGHASH
13061TPMS_SCHEME_ECDSA
13062TPMS_SCHEME_SIGHASH
13063TPMS_SCHEME_SM2
13064TPMS_SCHEME_SIGHASH
13065TPMS_SCHEME_ECSCHNORR
13066
1306711.2.1.4 TPMS_SCHEME_ECDAA
13068Table 141 — Definition of {ECC} TPMS_SCHEME_ECDAA Structure
13069Parameter
13070
13071Type
13072
13073Description
13074
13075hashAlg
13076
13077TPMI_ALG_HASH
13078
13079the hash algorithm used to digest the message
13080
13081count
13082
13083UINT16
13084
13085the counter value that is used between TPM2_Commit() and the sign
13086operation
13087
13088Page 112
13089October 31, 2013
13090
13091Published
13092Copyright © TCG 2006-2013
13093
13094Family “2.0”
13095Level 00 Revision 00.99
13096
13097Trusted Platform Module Library
1309811.2.1.5
13099
13100Part 2: Structures
13101
13102TPMU_SIG_SCHEME
13103Table 142 — Definition of TPMU_SIG_SCHEME Union <IN/OUT, S>
13104
13105Parameter
13106
13107Type
13108
13109Selector
13110
13111Description
13112
13113rsassa
13114
13115TPMS_SCHEME_RSASSA
13116
13117TPM_ALG_RSASSA
13118
13119the PKCS#1v1.5 scheme
13120
13121rsapss
13122
13123TPMS_SCHEME_RSAPSS
13124
13125TPM_ALG_RSAPSS
13126
13127the PKCS#1v2.1 PSS scheme
13128
13129ecdsa
13130
13131TPMS_SCHEME_ECDSA
13132
13133TPM_ALG_ECDSA
13134
13135the ECDSA scheme
13136
13137sm2
13138
13139TPMS_SCHEME_SM2
13140
13141TPM_ALG_SM2
13142
13143ECDSA from SM2
13144
13145ecdaa
13146
13147TPMS_SCHEME_ECDAA
13148
13149TPM_ALG_ECDAA
13150
13151the ECDAA scheme
13152
13153ecSchnorr
13154
13155TPMS_SCHEME_ECSCHNORR
13156
13157TPM_ALG_ECSCHNORR
13158
13159the EC Schnorr
13160
13161hmac
13162
13163TPMS_SCHEME_HMAC
13164
13165TPM_ALG_HMAC
13166
13167the HMAC scheme
13168
13169any
13170
13171TPMS_SCHEME_SIGHASH
13172
13173null
13174
1317511.2.1.6
13176
13177selector that allows access to
13178digest for any signing scheme
13179TPM_ALG_NULL
13180
13181no scheme or default
13182
13183TPMT_SIG_SCHEME
13184Table 143 — Definition of TPMT_SIG_SCHEME Structure
13185
13186Parameter
13187
13188Type
13189
13190Description
13191
13192scheme
13193
13194+TPMI_ALG_SIG_SCHEME
13195
13196scheme selector
13197
13198[scheme]details
13199
13200TPMU_SIG_SCHEME
13201
13202scheme parameters
13203
13204Family “2.0”
13205Level 00 Revision 00.99
13206
13207Published
13208Copyright © TCG 2006-2013
13209
13210Page 113
13211October 31, 2013
13212
13213Part 2: Structures
13214
13215Trusted Platform Module Library
13216
1321711.2.2 Encryption Schemes
1321811.2.2.1
13219
13220Introduction
13221
13222These structures are used to indicate the hash algorithm used for the encrypting process. These
13223schemes would appear in an object’s public area.
1322411.2.2.2
13225
13226TPMS_SCHEME_OAEP
13227Table 144 — Definition of {RSA} TPMS_SCHEME_OAEP Structure
13228
13229Parameter
13230
13231Type
13232
13233Description
13234
13235hashAlg
13236
13237+TPMI_ALG_HASH
13238
13239the hash algorithm used to digest the message
13240
1324111.2.2.3
13242
13243TPMS_SCHEME_ECDH
13244
13245For ECDH, KDFe is used for the key derivation function that only a hash algorithm is needed to complete
13246the definition.
13247Table 145 — Definition of {ECC} TPMS_SCHEME_ECDH Structure
13248Parameter
13249
13250Type
13251
13252Description
13253
13254hashAlg
13255
13256+TPMI_ALG_HASH
13257
13258the hash algorithm used in the KDF
13259
1326011.2.3 Key Derivation Schemes
1326111.2.3.1
13262
13263Introduction
13264
13265These structures are used to define the key derivation for symmetric secret sharing using asymmetric
13266methods. A secret shareing scheme is required in any asymmetric key with the decrypt attribute SET.
13267These schemes would appear in an object’s public area and in commands where the secret sharing
13268scheme is variable.
13269Each scheme includes a symmetric algorithm and a KDF selection.
1327011.2.3.2
13271
13272TPMS_SCHEME_MGF1
13273Table 146 — Definition of TPMS_SCHEME_MGF1 Structure
13274
13275Parameter
13276
13277Type
13278
13279Description
13280
13281hashAlg
13282
13283TPMI_ALG_HASH
13284
13285the hash algorithm used in the KDF
13286
1328711.2.3.3
13288
13289TPMS_SCHEME_KDF1_SP800_56a
13290Table 147 — Definition of {ECC} TPMS_SCHEME_KDF1_SP800_56a Structure
13291
13292Parameter
13293
13294Type
13295
13296Description
13297
13298hashAlg
13299
13300TPMI_ALG_HASH
13301
13302the hash algorithm used in the KDF
13303
13304Page 114
13305October 31, 2013
13306
13307Published
13308Copyright © TCG 2006-2013
13309
13310Family “2.0”
13311Level 00 Revision 00.99
13312
13313Trusted Platform Module Library
1331411.2.3.4
13315
13316Part 2: Structures
13317
13318TPMS_SCHEME_KDF2
13319Table 148 — Definition of TPMS_SCHEME_KDF2 Structure
13320
13321Parameter
13322
13323Type
13324
13325Description
13326
13327hashAlg
13328
13329TPMI_ALG_HASH
13330
13331the hash algorithm used in the KDF
13332
1333311.2.3.5
13334
13335TPMS_SCHEME_KDF1_SP800_108
13336Table 149 — Definition of TPMS_SCHEME_KDF1_SP800_108 Structure
13337
13338Parameter
13339
13340Type
13341
13342Description
13343
13344hashAlg
13345
13346TPMI_ALG_HASH
13347
13348the hash algorithm used in the KDF
13349
1335011.2.3.6
13351
13352TPMU_KDF_SCHEME
13353Table 150 — Definition of TPMU_KDF_SCHEME Union <IN/OUT, S>
13354
13355Parameter
13356
13357Type
13358
13359Selector
13360
13361mgf1
13362
13363TPMS_SCHEME_MGF1
13364
13365TPM_ALG_MGF1
13366
13367kdf1_SP800_56a
13368
13369TPMS_SCHEME_KDF1_SP800_56a
13370
13371TPM_ALG_KDF1_SP800_56a
13372
13373kdf2
13374
13375TPMS_SCHEME_KDF2
13376
13377TPM_ALG_KDF2
13378
13379kdf1_sp800_108
13380
13381TPMS_SCHEME_KDF1_SP800_108
13382
13383Description
13384
13385TPM_ALG_KDF1_SP800_108
13386
13387null
13388
1338911.2.3.7
13390
13391TPM_ALG_NULL
13392
13393TPMT_KDF_SCHEME
13394Table 151 — Definition of TPMT_KDF_SCHEME Structure
13395
13396Parameter
13397
13398Type
13399
13400Description
13401
13402scheme
13403
13404+TPMI_ALG_KDF
13405
13406scheme selector
13407
13408[scheme]details
13409
13410TPMU_KDF_SCHEME
13411
13412scheme parameters
13413
13414Family “2.0”
13415Level 00 Revision 00.99
13416
13417Published
13418Copyright © TCG 2006-2013
13419
13420Page 115
13421October 31, 2013
13422
13423Part 2: Structures
1342411.2.3.8
13425
13426Trusted Platform Module Library
13427
13428TPMI_ALG_ASYM_SCHEME
13429
13430List of all of the scheme types for any asymmetric algorithm. This is used to define the
13431TPMT_ASYM_SCHEME.
13432Table 152 — Definition of (TPM_ALG_ID) TPMI_ALG_ASYM_SCHEME Type <>
13433Values
13434
13435Comments
13436
13437TPM_ALG_RSASSA
13438
13439list of the allowed values
13440
13441TPM_ALG_RSAPSS
13442TPM_ALG_RSAES
13443TPM_ALG_OAEP
13444TPM_ALG_ECDSA
13445TPM_ALG_SM2
13446TPM_ALG_ECDAA
13447TPM_ALG_ECDH
13448+TPM_ALG_NULL
13449#TPM_RC_VALUE
13450
1345111.2.3.9
13452
13453TPMU_ASYM_SCHEME
13454
13455This union of all asymmetric schemes is used in each of the asymmetric scheme structures. The actual
13456scheme structure is defined by the interface type used for the selector.
13457EXAMPLE
13458
13459The TPMT_RSA_SCHEME structure uses the TPMU_ASYM_SCHEME union but the selector type is
13460TPMI_ALG_RSA_SCHEME. This means that the only elements of the union that can be selected for th e
13461TPMT_RSA_SCHEME are those that are in TPMI_RSA_SCHEME.
13462
13463Table 153 — Definition of TPMU_ASYM_SCHEME Union
13464Parameter
13465
13466Type
13467
13468Selector
13469
13470Description
13471
13472rsassa
13473
13474TPMS_SCHEME_RSASSA
13475
13476TPM_ALG_RSASSA
13477
13478the PKCS#1v1.5 scheme
13479
13480rsapss
13481
13482TPMS_SCHEME_RSAPSS
13483
13484TPM_ALG_RSAPSS
13485
13486the PKCS#1v2.1 PSS scheme
13487
13488oaep
13489
13490TPMS_SCHEME_OAEP
13491
13492TPM_ALG_OAEP
13493
13494the PKSC#1v2.1 OAEP scheme
13495
13496ecdsa
13497
13498TPMS_SCHEME_ECDSA
13499
13500TPM_ALG_ECDSA
13501
13502an ECDSA scheme
13503
13504sm2
13505
13506TPMS_SCHEME_SM2
13507
13508TPM_ALG_SM2
13509
13510sign or key exchange from SM2
13511
13512ecdaa
13513
13514TPMS_SCHEME_ECDAA
13515
13516TPM_ALG_ECDAA
13517
13518an ECDAA scheme
13519
13520ecSchnorr
13521
13522TPMS_SCHEME_ECSCHNORR
13523
13524TPM_ALG_ECSCHNORR elliptic curve Schnorr signature
13525
13526ecdh
13527TPMS_SCHEME_ECDH
13528TPM_ALG_ECDH
13529anySig
13530
13531TPMS_SCHEME_SIGHASH
13532
13533null
13534
13535Page 116
13536October 31, 2013
13537
13538TPM_ALG_NULL
13539
13540Published
13541Copyright © TCG 2006-2013
13542
13543no scheme or default
13544This selects the NULL Signature.
13545
13546Family “2.0”
13547Level 00 Revision 00.99
13548
13549Trusted Platform Module Library
13550
13551Part 2: Structures
13552
1355311.2.3.10 TPMT_ASYM_SCHEME
13554This structure is defined to allow overlay of all of the schemes for any asymmetric object. This structure is
13555not sent on the interface.
13556Table 154 — Definition of TPMT_ASYM_SCHEME Structure <>
13557Parameter
13558
13559Type
13560
13561Description
13562
13563scheme
13564
13565+TPMI_ALG_ASYM_SCHEME
13566
13567scheme selector
13568
13569[scheme]details
13570
13571TPMU_ASYM_SCHEME
13572
13573scheme parameters
13574
1357511.2.4 RSA
1357611.2.4.1
13577
13578TPMI_ALG_RSA_SCHEME
13579
13580The list of values that may appear in the scheme parameter of a TPMS_RSA_PARMS structure.
13581Table 155 — Definition of (TPM_ALG_ID) {RSA} TPMI_ALG_RSA_SCHEME Type
13582Values
13583
13584Comments
13585
13586TPM_ALG_RSASSA
13587
13588list of the allowed values
13589
13590TPM_ALG_RSAPSS
13591TPM_ALG_RSAES
13592TPM_ALG_OAEP
13593+TPM_ALG_NULL
13594#TPM_RC_VALUE
13595
1359611.2.4.2
13597
13598TPMT_RSA_SCHEME
13599Table 156 — Definition of {RSA} TPMT_RSA_SCHEME Structure
13600
13601Parameter
13602
13603Type
13604
13605Description
13606
13607scheme
13608
13609+TPMI_ALG_RSA_SCHEME
13610
13611scheme selector
13612
13613[scheme]details
13614
13615TPMU_ASYM_SCHEME
13616
13617scheme parameters
13618
13619Family “2.0”
13620Level 00 Revision 00.99
13621
13622Published
13623Copyright © TCG 2006-2013
13624
13625Page 117
13626October 31, 2013
13627
13628Part 2: Structures
1362911.2.4.3
13630
13631Trusted Platform Module Library
13632
13633TPMI_ALG_RSA_DECRYPT
13634
13635The list of values that are allowed in a decryption scheme selection as used in TPM2_RSA_Encrypt() and
13636TPM2_RSA_Decrypt().
13637Table 157 — Definition of (TPM_ALG_ID) {RSA} TPMI_ALG_RSA_DECRYPT Type
13638Values
13639
13640Comments
13641
13642TPM_ALG_RSAES
13643TPM_ALG_OAEP
13644+TPM_ALG_NULL
13645#TPM_RC_VALUE
13646
1364711.2.4.4
13648
13649TPMT_RSA_DECRYPT
13650Table 158 — Definition of {RSA} TPMT_RSA_DECRYPT Structure
13651
13652Parameter
13653
13654Type
13655
13656Description
13657
13658scheme
13659
13660+TPMI_ALG_RSA_DECRYPT
13661
13662scheme selector
13663
13664[scheme]details
13665
13666TPMU_ASYM_SCHEME
13667
13668scheme parameters
13669
1367011.2.4.5
13671
13672TPM2B_PUBLIC_KEY_RSA
13673
13674This sized buffer holds the largest RSA public key supported by the TPM.
13675NOTE
13676
13677The reference implementation only supports key sizes of 1,024 and 2,048 bits.
13678
13679Table 159 — Definition of {RSA} TPM2B_PUBLIC_KEY_RSA Structure
13680Parameter
13681
13682Type
13683
13684Description
13685
13686size
13687
13688UINT16
13689
13690size of the buffer
13691The value of zero is only valid for create.
13692
13693buffer [size] {:MAX_RSA_KEY_BYTES}
13694
13695BYTE
13696
13697Value
13698
1369911.2.4.6
13700
13701TPMI_RSA_KEY_BITS
13702
13703This holds the value that is the maximum size allowed for an RSA key.
13704NOTE 1
13705
13706An implementation is allowed to provide limited support for smaller RSA key sizes. That is, a TPM may be
13707able to accept a smaller RSA key size in TPM2_LoadExternal() when only the public area is loaded but
13708not accept that smaller key size in any command that loads both the public and private portions of an RSA
13709key. This would allow the TPM to validate signatures using the smaller key but would prevent the TPM
13710from using the smaller key size for any other purpose.
13711
13712NOTE 2
13713
13714The definition for RSA_KEY_SIZES_BITS used in the reference implementation is found in Annex B
13715
13716Page 118
13717October 31, 2013
13718
13719Published
13720Copyright © TCG 2006-2013
13721
13722Family “2.0”
13723Level 00 Revision 00.99
13724
13725Trusted Platform Module Library
13726
13727Part 2: Structures
13728
13729Table 160 — Definition of {RSA} (TPM_KEY_BITS) TPMI_RSA_KEY_BITS Type
13730Parameter
13731
13732Description
13733
13734$RSA_KEY_SIZES_BITS
13735
13736the number of bits in the supported key
13737
13738#TPM_RC_VALUE
13739
13740error when key size is not supported
13741
1374211.2.4.7
13743
13744TPM2B_PRIVATE_KEY_RSA
13745
13746This sized buffer holds the largest RSA prime number supported by the TPM.
13747NOTE
13748
13749All primes are required to have exactly half the number of significant bits as the public modulus , and the
13750square of each prime is required to have the same number of significant bits as the public modulus.
13751
13752Table 161 — Definition of {RSA} TPM2B_PRIVATE_KEY_RSA Structure
13753Parameter
13754
13755Type
13756
13757size
13758
13759UINT16
13760
13761buffer [size] {:MAX_RSA_KEY_BYTES/2}
13762
13763BYTE
13764
13765Family “2.0”
13766Level 00 Revision 00.99
13767
13768Description
13769
13770Published
13771Copyright © TCG 2006-2013
13772
13773Page 119
13774October 31, 2013
13775
13776Part 2: Structures
13777
13778Trusted Platform Module Library
13779
1378011.2.5 ECC
1378111.2.5.1
13782
13783TPM2B_ECC_PARAMETER
13784
13785This sized buffer holds the largest ECC parameter (coordinate) supported by the TPM.
13786Table 162 — Definition of {ECC} TPM2B_ECC_PARAMETER Structure
13787Parameter
13788
13789Type
13790
13791Description
13792
13793size
13794
13795UINT16
13796
13797size of buffer
13798
13799buffer [size] {:MAX_ECC_KEY_BYTES}
13800
13801BYTE
13802
13803the parameter data
13804
1380511.2.5.2
13806
13807TPMS_ECC_POINT
13808
13809This structure holds two ECC coordinates that, together, make up an ECC point.
13810Table 163 — Definition of {ECC} TPMS_ECC_POINT Structure
13811Parameter
13812
13813Type
13814
13815Description
13816
13817x
13818
13819TPM2B_ECC_PARAMETER
13820
13821X coordinate
13822
13823y
13824
13825TPM2B_ECC_PARAMETER
13826
13827Y coordinate
13828
1382911.2.5.3
13830
13831TPM2B_ECC_POINT
13832
13833This structure is defined to allow a point to be a single sized parameter so that it may be encrypted.
13834NOTE
13835
13836If the point is to be omitted, the X and Y coordinates need to be individual ly set to Empty Buffers. The
13837minimum value for size will be four. It is checked indirectly by unmarshaling of the TPMS_ECC_POINT. If
13838the type of point were BYTE, then size could have been zero. However, this would complicate the process
13839of marshaling the structure.
13840
13841Table 164 — Definition of {ECC} TPM2B_ECC_POINT Structure
13842Parameter
13843
13844Type
13845
13846Description
13847
13848size=
13849
13850UINT16
13851
13852size of the remainder of this structure
13853
13854point
13855
13856TPMS_ECC_POINT
13857
13858coordinates
13859error returned if the unmarshaled size of point is
13860not exactly equal to size
13861
13862#TPM_RC_SIZE
13863
13864Page 120
13865October 31, 2013
13866
13867Published
13868Copyright © TCG 2006-2013
13869
13870Family “2.0”
13871Level 00 Revision 00.99
13872
13873Trusted Platform Module Library
1387411.2.5.4
13875
13876Part 2: Structures
13877
13878TPMI_ALG_ECC_SCHEME
13879Table 165 — Definition of (TPM_ALG_ID) {ECC} TPMI_ALG_ECC_SCHEME Type
13880
13881Values
13882
13883Comments
13884
13885TPM_ALG_ECDSA
13886
13887these are the selections allowed for an ECC key
13888
13889TPM_ALG_SM2
13890TPM_ALG_ECDAA
13891TPM_ALG_ECSCHNORR
13892TPM_ALG_ECDH
13893+TPM_ALG_NULL
13894#TPM_RC_SCHEME
13895
1389611.2.5.5
13897
13898TPMI_ECC_CURVE
13899
13900The ECC curves implemented by the TPM.
13901NOTE
13902
13903The definition of ECC_CURVES used in the reference implementation is found in Annex B
13904
13905Table 166 — Definition of {ECC} (TPM_ECC_CURVE) TPMI_ECC_CURVE Type
13906Parameter
13907
13908Description
13909
13910$ECC_CURVES
13911
13912the list of implemented curves
13913
13914#TPM_RC_CURVE
13915
13916error when curve is not supported
13917
1391811.2.5.6
13919
13920TPMT_ECC_SCHEME
13921
13922Table 167 — Definition of (TPMT_SIG_SCHEME) {ECC} TPMT_ECC_SCHEME Structure
13923Parameter
13924
13925Type
13926
13927Description
13928
13929scheme
13930
13931+TPMI_ALG_ECC_SCHEME
13932
13933scheme selector
13934
13935[scheme]details
13936
13937TPMU_SIG_SCHEME
13938
13939scheme parameters
13940
13941Family “2.0”
13942Level 00 Revision 00.99
13943
13944Published
13945Copyright © TCG 2006-2013
13946
13947Page 121
13948October 31, 2013
13949
13950Part 2: Structures
1395111.2.5.7
13952
13953Trusted Platform Module Library
13954
13955TPMS_ALGORITHM_DETAIL_ECC
13956
13957This structure is used to report on the curve parameters of an ECC curve. It is returned by
13958TPM2_ECC_Parameters().
13959Table 168 — Definition of {ECC} TPMS_ALGORITHM_DETAIL_ECC Structure <OUT>
13960Parameter
13961
13962Type
13963
13964Description
13965
13966curveID
13967
13968TPM_ECC_CURVE
13969
13970identifier for the curve
13971
13972keySize
13973
13974UINT16
13975
13976Size in bits of the key
13977
13978kdf
13979
13980TPMT_KDF_SCHEME
13981
13982the default KDF and hash algorithm used in secret sharing
13983operations
13984
13985sign
13986
13987TPMT_ECC_SCHEME+
13988
13989If not TPM_ALG_NULL, this is the mandatory signature
13990scheme that is required to be used with this curve.
13991
13992p
13993
13994TPM2B_ECC_PARAMETER
13995
13996Fp (the modulus)
13997
13998a
13999
14000TPM2B_ECC_PARAMETER
14001
14002coefficient of the linear term in the curve equation
14003
14004b
14005
14006TPM2B_ECC_PARAMETER
14007
14008constant term for curve equation
14009
14010gX
14011
14012TPM2B_ECC_PARAMETER
14013
14014x coordinate of base point G
14015
14016gY
14017
14018TPM2B_ECC_PARAMETER
14019
14020y coordinate of base point G
14021
14022n
14023
14024TPM2B_ECC_PARAMETER
14025
14026order of G
14027
14028h
14029
14030TPM2B_ECC_PARAMETER
14031
14032cofactor (a size of zero indicates a cofactor of 1)
14033
1403411.3 Signatures
1403511.3.1 TPMS_SIGNATURE_RSASSA
14036Table 169 — Definition of {RSA} TPMS_SIGNATURE_RSASSA Structure
14037Parameter
14038
14039Type
14040
14041Description
14042
14043hash
14044
14045TPMI_ALG_HASH
14046
14047the hash algorithm used to digest the message
14048TPM_ALG_NULL is not allowed.
14049
14050sig
14051
14052TPM2B_PUBLIC_KEY_RSA
14053
14054The signature is the size of a public key.
14055
1405611.3.2 TPMS_SIGNATURE_RSAPSS
14057When the TPM generates a PSS signature, the salt size is the largest size allowed by the key and hash
14058combination.
14059EXAMPLE
14060
14061For a 2,048-bit public modulus key and SHA1 hash, the salt size is 256 – 20 – 2 = 234 octets.
14062
14063NOTE
14064
14065While this is significantly larger than required from a securit y perspective, it avoids issues of whether a
14066particular size of salt value is sufficient.
14067
14068Page 122
14069October 31, 2013
14070
14071Published
14072Copyright © TCG 2006-2013
14073
14074Family “2.0”
14075Level 00 Revision 00.99
14076
14077Trusted Platform Module Library
14078
14079Part 2: Structures
14080
14081Table 170 — Definition of {RSA} TPMS_SIGNATURE_RSAPSS Structure
14082Parameter
14083
14084Type
14085
14086Description
14087
14088hash
14089
14090TPMI_ALG_HASH
14091
14092the hash algorithm used in the signature process
14093TPM_ALG_NULL is not allowed.
14094
14095sig
14096
14097TPM2B_PUBLIC_KEY_RSA
14098
14099The signature is the size of a public key.
14100
1410111.3.3 TPMS_SIGNATURE_ECDSA
14102Table 171 — Definition of {ECC} TPMS_SIGNATURE_ECDSA Structure
14103Parameter
14104
14105Type
14106
14107Description
14108
14109hash
14110
14111TPMI_ALG_HASH
14112
14113the hash algorithm used in the signature process
14114TPM_ALG_NULL is not allowed.
14115
14116signatureR
14117
14118TPM2B_ECC_PARAMETER
14119
14120signatureS
14121
14122TPM2B_ECC_PARAMETER
14123
1412411.3.4 TPMU_SIGNATURE
14125A TPMU_SIGNATURE_COMPOSITE is a union of the various signatures that is supported by a particular
14126TPM implementation. The union allows substitution of any signature algorithm wherever a signature is
14127required in a structure. Table 172 is an illustration of a TPMU_SIGNATURE for a TPM that implements
14128both RSA and ECC signing.
14129NOTE 1
14130
14131All TPM are required to support a hash algorithm and the HMAC algorithm.
14132
14133When a symmetric algorithm is used for signing, the signing algorithm is assumed to be an HMAC based
14134on the indicated hash algorithm. The HMAC key will either be referenced as part of the usage or will be
14135implied by context.
14136NOTE 2
14137
14138The table below is illustrative. It would be modified to reflect the signatures produced by the TPM.
14139
14140Table 172 — Definition of TPMU_SIGNATURE Union <IN/OUT, S>
14141Parameter
14142
14143Type
14144
14145Selector
14146
14147Description
14148
14149rsassa
14150
14151TPMS_SIGNATURE_RSASSA
14152
14153TPM_ALG_RSASSA
14154
14155a PKCS#1v1.5 signature
14156
14157rsapss
14158
14159TPMS_SIGNATURE_RSAPSS
14160
14161TPM_ALG_RSAPSS
14162
14163a PKCS#1v2.1PSS signature
14164
14165ecdsa
14166
14167TPMS_SIGNATURE_ECDSA
14168
14169TPM_ALG_ECDSA
14170
14171an ECDSA signature
14172
14173sm2
14174
14175TPMS_SIGNATURE_ECDSA
14176
14177TPM_ALG_SM2
14178
14179same format as ECDSA
14180
14181ecdaa
14182
14183TPMS_SIGNATURE_ECDSA
14184
14185TPM_ALG_ECDAA
14186
14187same format as ECDSA
14188
14189ecschnorr
14190
14191TPMS_SIGNATURE_ECDSA
14192
14193TPM_ALG_ECSCHNORR
14194
14195same format as ECDSA
14196
14197hmac
14198
14199TPMT_HA
14200
14201TPM_ALG_HMAC
14202
14203HMAC signature (required to
14204be supported)
14205
14206any
14207
14208TPMS_SCHEME_SIGHASH
14209
14210null
14211
14212Family “2.0”
14213Level 00 Revision 00.99
14214
14215Published
14216Copyright © TCG 2006-2013
14217
14218the NULL signature
14219
14220Page 123
14221October 31, 2013
14222
14223Part 2: Structures
14224
14225Trusted Platform Module Library
14226
1422711.3.5 TPMT_SIGNATURE
14228Table 173 shows the basic algorithm-agile structure when a symmetric or asymmetric signature is
14229indicated. The sigAlg parameter indicates the algorithm used for the signature. This structure is output
14230from the attestation commands and is an input to TPM2_VerifySignature(), TPM2_PolicySigned(), and
14231TPM2_FieldUpgradeStart().
14232Table 173 — Definition of TPMT_SIGNATURE Structure
14233Parameter
14234
14235Type
14236
14237Description
14238
14239sigAlg
14240
14241+TPMI_ALG_SIG_SCHEME
14242
14243selector of the algorithm used to construct the signature
14244
14245[sigAlg]signature
14246
14247TPMU_SIGNATURE
14248
14249This shall be the actual signature information.
14250
1425111.4 Key/Secret Exchange
1425211.4.1 Introduction
14253The structures in this clause are used when a key or secret is being exchanged. The exchange may be in
1425414255
14256TPM2_StartAuthSession() where the secret is injected for salting the session,
14257
1425814259
14260TPM2_Duplicate(), TPM2_Import, or TPM2_Rewrap() where the secret is the symmetric encryption
14261key for the outer wrapper of a duplication blob, or
14262
1426314264
14265TPM2_ActivateIdentity() or TPM2_CreateIdentity() where the secret is the symmetric encryption key
14266for the credential blob.
14267
14268Particulars are described in Part 1.
1426911.4.2 TPMU_ENCRYPTED_SECRET
14270This structure is used to hold either an ephemeral public point for ECDH, an OAEP-encrypted block for
14271RSA, or a symmetrically encrypted value. This structure is defined for the limited purpose of determining
14272the size of a TPM2B_ENCRYPTED_SECRET.
14273The symmetrically encrypted value may use either CFB or XOR encryption.
14274NOTE
14275
14276Table 174 is illustrative. It would be modified depending on the algorithms supported in the TPM.
14277
14278Table 174 — Definition of TPMU_ENCRYPTED_SECRET Union <S>
14279Parameter
14280
14281Type
14282
14283Selector
14284
14285ecc [sizeof(TPMS_ECC_POINT)]
14286
14287BYTE
14288
14289TPM_ALG_ECC
14290
14291rsa [MAX_RSA_KEY_BYTES]
14292
14293BYTE
14294
14295TPM_ALG_RSA
14296
14297symmetric [sizeof(TPM2B_DIGEST)]
14298
14299BYTE
14300
14301TPM_ALG_SYMCIPHER
14302
14303keyedHash [sizeof(TPM2B_DIGEST)]
14304
14305BYTE
14306
14307TPM_ALG_KEYEDHASH
14308
14309Page 124
14310October 31, 2013
14311
14312Published
14313Copyright © TCG 2006-2013
14314
14315Description
14316
14317Any symmetrically encrypted
14318secret value will be limited to
14319be no larger than a digest.
14320
14321Family “2.0”
14322Level 00 Revision 00.99
14323
14324Trusted Platform Module Library
14325
14326Part 2: Structures
14327
1432811.4.3 TPM2B_ENCRYPTED_SECRET
14329Table 175 — Definition of TPM2B_ENCRYPTED_SECRET Structure
14330Parameter
14331
14332Type
14333
14334Description
14335
14336size
14337
14338UINT16
14339
14340size of the secret value
14341
14342secret [size] {:sizeof(TPMU_ENCRYPTED_SECRET)}
14343
14344BYTE
14345
14346secret
14347
14348Family “2.0”
14349Level 00 Revision 00.99
14350
14351Published
14352Copyright © TCG 2006-2013
14353
14354Page 125
14355October 31, 2013
14356
14357Part 2: Structures
14358
14359Trusted Platform Module Library
14360
1436112 Key/Object Complex
1436212.1 Introduction
14363An object description requires a TPM2B_PUBLIC structure and may require a TPMT_SENSITIVE
14364structure. When the structure is stored off the TPM, the TPMT_SENSITIVE structure is encrypted within a
14365TPM2B_PRIVATE structure.
14366When the object requires two components for its description, those components are loaded as separate
14367parameters in the TPM2_Load() command. When the TPM creates an object that requires both
14368components, the TPM will return them as separate parameters from the TPM2_Create() operation.
14369The TPM may produce multiple different TPM2B_PRIVATE structures for a single TPM2B_PUBLIC
14370structure. Creation of a modified TPM2B_PRIVATE structure requires that the full structure be loaded with
14371the TPM2_Load() command, modification of the TPMT_SENSITIVE data, and output of a new
14372TPM2B_PRIVATE structure.
1437312.2 Public Area Structures
1437412.2.1 Description
14375This clause defines the TPM2B_PUBLIC structure and the higher-level substructure that may be
14376contained in a TPM2B_PUBLIC. The higher-level structures that are currently defined for inclusion in a
14377TPM2B_PUBLIC are the
1437814379
14380structures for asymmetric keys,
14381
1438214383
14384structures for symmetric keys, and
14385
1438614387
14388structures for sealed data.
14389
1439012.2.2 TPMI_ALG_PUBLIC
14391Table 176 — Definition of (TPM_ALG_ID) TPMI_ALG_PUBLIC Type
14392Values
14393
14394Comments
14395
14396TPM_ALG_KEYEDHASH
14397
14398required of all TPM
14399
14400TPM_ALG_SYMCIPHER
14401
14402required of all TPM
14403
14404TPM_ALG_RSA
14405
14406At least one asymmetric algorithm shall be implemented.
14407
14408TPM_ALG_ECC
14409
14410At least one asymmetric algorithm shall be implemented.
14411
14412#TPM_RC_TYPE
14413
14414response code when a public type is not supported
14415
1441612.2.3 Type-Specific Parameters
1441712.2.3.1
14418
14419Description
14420
14421The public area contains two fields (parameters and unique) that vary by object type. The parameters
14422field varies according to the type of the object but the contents may be the same across multiple
14423instances of a particular type. The unique field format also varies according to the type of the object and
14424will also be unique for each instance.
14425
14426Page 126
14427October 31, 2013
14428
14429Published
14430Copyright © TCG 2006-2013
14431
14432Family “2.0”
14433Level 00 Revision 00.99
14434
14435Trusted Platform Module Library
14436
14437Part 2: Structures
14438
14439For a symmetric key (type == TPM_ALG_SYMCIPHER), HMAC key (type == TPM_ALG_KEYEDHASH)
14440or data object (also, type == TPM_ALG_KEYEDHASH), the contents of unique shall be computed from
14441components of the sensitive area of the object as follows:
14442
14443unique ≔ HnameAlg(seedValue || sensitive)
14444
14445(8)
14446
14447where
14448
14449HnameAlg()
14450
14451the hash algorithm used to compute the Name of the object
14452
14453seedValue
14454
14455the digest-sized obfuscation value in the sensitive area of a symmetric
14456key
14457or
14458symmetric
14459data
14460object
14461found
14462in
14463a
14464TPMT_SENSITIVE.seedValue.buffer
14465
14466sensitive
14467
14468the
14469secret
14470key/data
14471of
14472TPMT_SENSITIVE.sensitive.any.buffer
14473
1447412.2.3.2
14475
14476the
14477
14478object
14479
14480in
14481
14482the
14483
14484TPMU_PUBLIC_ID
14485Table 177 — Definition of TPMU_PUBLIC_ID Union <IN/OUT, S>
14486
14487Parameter
14488
14489Type
14490
14491Selector
14492
14493keyedHash
14494
14495TPM2B_DIGEST
14496
14497TPM_ALG_KEYEDHASH
14498
14499sym
14500
14501TPM2B_DIGEST
14502
14503TPM_ALG_SYMCIPHER
14504
14505rsa
14506
14507TPM2B_PUBLIC_KEY_RSA
14508
14509TPM_ALG_RSA
14510
14511ecc
14512
14513TPMS_ECC_POINT
14514
14515TPM_ALG_ECC
14516
1451712.2.3.3
14518
14519Description
14520
14521TPMS_KEYEDHASH_PARMS
14522
14523This structure describes the parameters that would appear in the public area of a KEYEDHASH object.
14524Note
14525
14526Although the names are the same, the types of the structures are not the same as for asymmetric
14527parameter lists.
14528
14529Table 178 — Definition of TPMS_KEYEDHASH_PARMS Structure
14530Parameter
14531
14532Type
14533
14534Description
14535
14536scheme
14537
14538TPMT_KEYEDHASH_SCHEME+
14539
14540Indicates the signing method used for a keyedHash signing
14541object. This field also determines the size of the data field for a
14542data object created with TPM2_Create(). This field shall not be set
14543to TPM_ALG_NULL in a template if either sign or encrypt is SET.
14544
1454512.2.3.4
14546
14547TPMS_ASYM_PARMS
14548
14549This structure contains the common public area parameters for an asymmetric key. The first two
14550parameters of the parameter definition structures of an asymmetric key shall have the same two first
14551components.
14552NOTE
14553
14554The sign parameter may have a different type in order to allow different schemes to be selected for each
14555asymmetric type but the first parameter of each scheme definition shall be a TPM_ALG_ID for a valid
14556signing scheme.
14557
14558Family “2.0”
14559Level 00 Revision 00.99
14560
14561Published
14562Copyright © TCG 2006-2013
14563
14564Page 127
14565October 31, 2013
14566
14567Part 2: Structures
14568
14569Trusted Platform Module Library
14570Table 179 — Definition of TPMS_ASYM_PARMS Structure <>
14571
14572Parameter
14573
14574Type
14575
14576Description
14577
14578symmetric
14579
14580TPMT_SYM_DEF_OBJECT+
14581
14582the companion symmetric algorithm for a restricted
14583decryption key and shall be set to a supported symmetric
14584algorithm
14585This field is optional for keys that are not decryption keys
14586and shall be set to TPM_ALG_NULL if not used.
14587
14588scheme
14589
14590TPMT_ASYM_SCHEME+
14591
14592for a key with the sign attribute SET, a valid signing
14593scheme for the key type
14594for a key with the decrypt attribute SET, a valid key
14595exchange protocol
14596for a key with sign and decrypt attributes, shall be TPM_ALG_NULL
14597
1459812.2.3.5
14599
14600TPMS_RSA_PARMS
14601
14602A TPM compatible with this specification and supporting RSA shall support numPrimes of two and an
14603exponent of zero. Support for other values is optional. Use of other exponents in duplicated keys is not
14604recommended because the resulting keys would not be interoperable with other TPMs.
14605NOTE 1
14606
14607Implementations are not required to check that exponent is the default exponent. They may fail to load the
14608key if exponent is not zero. The reference implementation allows the values listed in the table.
14609
14610Table 180 — Definition of {RSA} TPMS_RSA_PARMS Structure
14611Parameter
14612
14613Type
14614
14615Description
14616
14617symmetric
14618
14619TPMT_SYM_DEF_OBJECT+
14620
14621for a restricted decryption key, shall be set to a
14622supported symmetric algorithm, key size, and mode.
14623if the key is not a restricted decryption key, this field
14624shall be set to TPM_ALG_NULL.
14625
14626scheme
14627
14628TPMT_RSA_SCHEME+
14629
14630
14631keyBits
14632
14633TPMI_RSA_KEY_BITS
14634
14635number of bits in the public modulus
14636
14637exponent
14638UINT32
14639
14640the public exponent
14641A prime number greater than 2.
14642When zero, indicates that the exponent is the default
1464316
14644of 2 + 1
14645
14646
14647#TPM_RC_VALUE
14648
14649Page 128
14650October 31, 2013
14651
14652Published
14653Copyright © TCG 2006-2013
14654
14655Family “2.0”
14656Level 00 Revision 00.99
14657
14658Trusted Platform Module Library
1465912.2.3.6
14660
14661Part 2: Structures
14662
14663TPMS_ECC_PARMS
14664
14665This structure contains the parameters for prime modulus ECC.
14666Table 181 — Definition of {ECC} TPMS_ECC_PARMS Structure
14667Parameter
14668
14669Type
14670
14671Description
14672
14673symmetric
14674
14675TPMT_SYM_DEF_OBJECT+
14676
14677for a restricted decryption key, shall be set to a supported
14678symmetric algorithm, key size. and mode.
14679if the key is not a restricted decryption key, this field shall be
14680set to TPM_ALG_NULL.
14681
14682scheme
14683
14684TPMT_ECC_SCHEME+
14685
14686If the sign attribute of the key is SET, then this shall be a valid
14687signing scheme.
14688NOTE
14689
14690If the sign parameter in curveID indicates a mandatory
14691scheme, then this field shall have the same value.
14692
14693curveID
14694TPMI_ECC_CURVE
14695
14696ECC curve ID
14697
14698kdf
14699
14700TPMT_KDF_SCHEME+
14701
14702
1470312.2.3.7
14704
14705There are currently no commands where this parameter
14706has effect and, in the reference code, this field needs to
14707be set to TPM_ALG_NULL.
14708
14709TPMU_PUBLIC_PARMS
14710
14711Table 182 defines the possible parameter definition structures that may be contained in the public portion
14712of a key.
14713Table 182 — Definition of TPMU_PUBLIC_PARMS Union <IN/OUT, S>
14714Parameter
14715
14716Type
14717
14718(1)
14719
14720Selector
14721
14722Description
14723
14724keyedHashDetail
14725
14726TPMS_KEYEDHASH_PARMS
14727
14728TPM_ALG_KEYEDHASH
14729
14730sign | encrypt | neither
14731
14732symDetail
14733
14734TPMS_SYMCIPHER_PARMS
14735
14736TPM_ALG_SYMCIPHER
14737
14738a symmetric block cipher
14739
14740rsaDetail
14741
14742TPMS_RSA_PARMS
14743
14744TPM_ALG_RSA
14745
14746decrypt + sign
14747
14748(2)
14749
14750eccDetail
14751
14752TPMS_ECC_PARMS
14753
14754TPM_ALG_ECC
14755
14756decrypt + sign
14757
14758(2)
14759
14760asymDetail
14761
14762TPMS_ASYM_PARMS
14763
14764common scheme structure
14765for RSA and ECC keys
14766
14767NOTES
147681)
14769
14770Description column indicates which of TPMA_OBJECT.decrypt or TPMA_OBJECT.sign may be set.
14771
147722)
14773
14774“+” indicates that both may be set but one shall be set. “|” indicates the optional settings.
14775
14776Family “2.0”
14777Level 00 Revision 00.99
14778
14779Published
14780Copyright © TCG 2006-2013
14781
14782Page 129
14783October 31, 2013
14784
14785Part 2: Structures
1478612.2.3.8
14787
14788Trusted Platform Module Library
14789
14790TPMT_PUBLIC_PARMS
14791
14792This structure is used in TPM2_TestParms() to validate that a set of algorithm parameters is supported by
14793the TPM.
14794Table 183 — Definition of TPMT_PUBLIC_PARMS Structure
14795Parameter
14796
14797Type
14798
14799Description
14800
14801type
14802
14803TPMI_ALG_PUBLIC
14804
14805the algorithm to be tested
14806
14807[type]parameters
14808
14809TPMU_PUBLIC_PARMS
14810 the algorithm details
14811
1481212.2.4 TPMT_PUBLIC
14813Table 184 defines the public area structure. The Name of the object is nameAlg concatenated with the
14814digest of this structure using nameAlg.
14815Table 184 — Definition of TPMT_PUBLIC Structure
14816Parameter
14817
14818Type
14819
14820Description
14821
14822type
14823
14824TPMI_ALG_PUBLIC
14825
14826“algorithm” associated with this object
14827
14828nameAlg
14829
14830+TPMI_ALG_HASH
14831
14832algorithm used for computing the Name of the object
14833NOTE
14834
14835The "+" indicates that the instance of a TPMT_PUBLIC may have
14836a "+" to indicate that the nameAlg may be TPM_ALG_NULL.
14837
14838objectAttributes
14839
14840TPMA_OBJECT
14841
14842attributes that, along with type, determine the manipulations of this
14843object
14844
14845authPolicy
14846
14847TPM2B_DIGEST
14848
14849optional policy for using this key
14850The policy is computed using the nameAlg of the object.
14851NOTE
14852
14853Shall be the Empty Buffer if no authorization policy is present.
14854
14855[type]parameters
14856
14857TPMU_PUBLIC_PARMS
14858
14859the algorithm or structure details
14860
14861[type]unique
14862
14863TPMU_PUBLIC_ID
14864
14865Page 130
14866October 31, 2013
14867
14868the unique identifier of the structure
14869For an asymmetric key, this would be the public key.
14870
14871Published
14872Copyright © TCG 2006-2013
14873
14874Family “2.0”
14875Level 00 Revision 00.99
14876
14877Trusted Platform Module Library
14878
14879Part 2: Structures
14880
1488112.2.5 TPM2B_PUBLIC
14882This sized buffer is used to embed a TPMT_PUBLIC in a command.
14883Table 185 — Definition of TPM2B_PUBLIC Structure
14884Parameter
14885
14886Type
14887
14888Description
14889
14890size=
14891
14892UINT16
14893
14894size of publicArea
14895NOTE
14896
14897publicArea
14898
14899+TPMT_PUBLIC
14900
14901The “=” will force the TPM to try to unmarshal a
14902TPMT_PUBLIC and check that the unmarshaled size
14903matches the value of size. If all the required fields of
14904a TPMT_PUBLIC are not present, the TPM will return
14905an error (generally TPM_RC_SIZE) when attempting
14906to unmarshal the TPMT_PUBLIC.
14907
14908the public area
14909NOTE
14910
14911The “+” indicates that the caller may specify that use
14912of TPM_ALG_NULL is allowed for nameAlg.
14913
1491412.3 Private Area Structures
1491512.3.1 Introduction
14916The structures in 12.3 define the contents and construction of the private portion of a TPM object. A
14917TPM2B_PRIVATE along with a TPM2B_PUBLIC are needed to describe a TPM object.
14918A TPM2B_PRIVATE area may be encrypted by different symmetric algorithms or, in some cases, not
14919encrypted at all.
1492012.3.2 Sensitive Data Structures
1492112.3.2.1
14922
14923Introduction
14924
14925The structures in 12.3.2 define the presumptive internal representations of the sensitive areas of the
14926various entities. A TPM may store the sensitive information in any desired format but when constructing a
14927TPM_PRIVATE, the formats in this clause shall be used.
1492812.3.2.2
14929
14930TPM2B_PRIVATE_VENDOR_SPECIFIC
14931
14932This structure is defined for coding purposes. For IO to the TPM, the sensitive portion of the key will be in
14933a canonical form. For an RSA key, this will be one of the prime factors of the public modulus. After
14934loading, it is typical that other values will be computed so that computations using the private key will not
14935need to start with just one prime factor. This structure allows the vendor-specific structure to use the
14936space of the
14937The value for RSA_VENDOR_SPECIFIC is determined by the vendor.
14938Table 186 — Definition of {RSA} TPM2B_PRIVATE_VENDOR_SPECIFIC Structure<>
14939Parameter
14940
14941Type
14942
14943size
14944
14945UINT16
14946
14947buffer [size] {:PRIVATE_VENDOR_SPECIFIC_BYTES}
14948
14949BYTE
14950
14951Family “2.0”
14952Level 00 Revision 00.99
14953
14954Published
14955Copyright © TCG 2006-2013
14956
14957Description
14958
14959Page 131
14960October 31, 2013
14961
14962Part 2: Structures
1496312.3.2.3
14964
14965Trusted Platform Module Library
14966
14967TPMU_SENSITIVE_COMPOSITE
14968Table 187 — Definition of TPMU_SENSITIVE_COMPOSITE Union <IN/OUT, S>
14969
14970Parameter
14971
14972Type
14973
14974Selector
14975
14976Description
14977
14978rsa
14979
14980TPM2B_PRIVATE_KEY_RSA
14981
14982TPM_ALG_RSA
14983
14984a prime factor of the public
14985key
14986
14987ecc
14988
14989TPM2B_ECC_PARAMETER
14990
14991TPM_ALG_ECC
14992
14993the integer private key
14994
14995bits
14996
14997TPM2B_SENSITIVE_DATA
14998
14999TPM_ALG_KEYEDHASH
15000
15001the private data
15002
15003sym
15004
15005TPM2B_SYM_KEY
15006
15007TPM_ALG_SYMCIPHER
15008
15009the symmetric key
15010
15011any
15012
15013TPM2B_PRIVATE_VENDOR_SPECIFIC
15014
1501512.3.2.4
15016
15017vendor-specific size for key
15018storage
15019
15020TPMT_SENSITIVE
15021Table 188 — Definition of TPMT_SENSITIVE Structure
15022
15023Parameter
15024
15025Type
15026
15027Description
15028
15029sensitiveType
15030
15031TPMI_ALG_PUBLIC
15032
15033identifier for the sensitive area
15034This shall be the same as the type parameter of the
15035associated public area.
15036
15037authValue
15038
15039TPM2B_AUTH
15040
15041user authorization data
15042The authValue may be a zero-length string.
15043This value shall not be larger than the size of the
15044digest produced by the nameAlg of the object.
15045
15046seedValue
15047
15048TPM2B_DIGEST
15049
15050for asymmetric key object, the optional protection
15051seed; for other objects, the obfuscation value
15052This value shall not be larger than the size of the
15053digest produced by nameAlg of the object.
15054
15055[sensitiveType]sensitive
15056
15057TPMU_SENSITIVE_COMPOSITE
15058
15059the type-specific private data
15060
1506112.3.3 TPM2B_SENSITIVE
15062The TPM2B_SENSITIVE structure is used as a parameter in TPM2_LoadExternal(). It is an unencrypted
15063sensitive area but it may be encrypted using parameter encryption.
15064NOTE
15065
15066When this structure is unmarshaled, the size of the sensitiveType determines what type of value is
15067unmarshaled. Each value of sensitiveType is associated with a TPM2B. It is the maximum size for each of
15068the TPM2B values will determine if the unmarshal operation is successful . Since there is no selector for
15069the any or vendor options for the union, the maximum input and output sizes for a TMP2B_SENSITIVE
15070are not affected by the sizes of those parameters.
15071
15072Table 189 — Definition of TPM2B_SENSITIVE Structure <IN/OUT>
15073Parameter
15074
15075Type
15076
15077Description
15078
15079size
15080
15081UINT16
15082
15083size of the private structure
15084
15085sensitiveArea
15086
15087TPMT_SENSITIVE
15088
15089an unencrypted sensitive area
15090
15091Page 132
15092October 31, 2013
15093
15094Published
15095Copyright © TCG 2006-2013
15096
15097Family “2.0”
15098Level 00 Revision 00.99
15099
15100Trusted Platform Module Library
15101
15102Part 2: Structures
15103
1510412.3.4 Encryption
15105A TPMS_SENSITIVE is the input to the encryption process. All TPMS_ENCRYPT structures are CFBencrypted using a key and Initialization Vector (IV) that are derived from a seed value.
15106The method of generating the key and IV is described in “Protected Storage” subclause “Symmetric
15107Encryption.” in Part 1.
1510812.3.5 Integrity
15109The integrity computation is used to ensure that a protected object is modified when stored in memory
15110outside of the TPM.
15111The method of protecting the integrity of the sensitive area is described in “Protected Storage” subclause
15112“Integrity” in Part 1.
1511312.3.6 _PRIVATE
15114This structure is defined to size the contents of a TPM2B_PRIVATE. This structure is not directly
15115marshaled or unmarshaled.
15116For TPM2_Duplicate() and TPM2_Import(), the TPM2B_PRIVATE may contain multiply encrypted data
15117and two integrity values. In some cases, the sensitive data is not encrypted and the integrity value is not
15118present.
15119For TPM2_Load() and TPM2_Create(), integrityInner is always present.
15120If integrityInner is present, it and sensitive are encrypted as a single block.
15121When an integrity value is not needed, it is not present and it is not represented by an Empty Buffer.
15122Table 190 — Definition of _PRIVATE Structure <>
15123Parameter
15124
15125Type
15126
15127Description
15128
15129integrityOuter
15130
15131TPM2B_DIGEST
15132
15133integrityInner
15134
15135TPM2B_DIGEST
15136
15137could also be a TPM2B_IV
15138
15139sensitive
15140
15141TPMT_SENSITIVE
15142
15143the sensitive area
15144
1514512.3.7 TPM2B_PRIVATE
15146The TPM2B_PRIVATE structure is used as a parameter in multiple commands that create, load, and
15147modify the sensitive area of an object.
15148Table 191 — Definition of TPM2B_PRIVATE Structure <IN/OUT, S>
15149Parameter
15150
15151Type
15152
15153Description
15154
15155size
15156
15157UINT16
15158
15159size of the private structure
15160
15161buffer [size] {:sizeof(_PRIVATE)}
15162
15163BYTE
15164
15165an encrypted private area
15166
15167Family “2.0”
15168Level 00 Revision 00.99
15169
15170Published
15171Copyright © TCG 2006-2013
15172
15173Page 133
15174October 31, 2013
15175
15176Part 2: Structures
15177
15178Trusted Platform Module Library
15179
1518012.4 Identity Object
1518112.4.1 Description
15182An identity object is used to convey credential protection value (CV) to a TPM that can load the object
15183associated with the object. The CV is encrypted to a storage key on the target TPM, and if the credential
15184integrity checks and the proper object is loaded in the TPM, then the TPM will return the CV.
1518512.4.2 _ID_OBJECT
15186This structure is used for sizing the TPM2_ID_OBJECT.
15187Table 192 — Definition of _ID_OBJECT Structure <>
15188Parameter
15189
15190Type
15191
15192Description
15193
15194integrityHMAC
15195
15196TPM2B_DIGEST
15197
15198encIdentity
15199
15200TPM2B_DIGEST
15201
15202credential protector information returned if name matches the
15203referenced object
15204All of the encIdentity is encrypted, including the size field.
15205NOTE
15206
15207The TPM is not required to check that the size is not larger
15208than the digest of the nameAlg. However, if the size is
15209larger, the ID object may not be usable on a TPM that has
15210no digest larger than produced by nameAlg.
15211
1521212.4.3 TPM2B_ID_OBJECT
15213This structure is an output from TPM2_MakeCredential() and is an input to TPM2_ActivateCredential().
15214Table 193 — Definition of TPM2B_ID_OBJECT Structure <IN/OUT>
15215Parameter
15216
15217Type
15218
15219Description
15220
15221size
15222
15223UINT16
15224
15225size of the credential structure
15226
15227credential [size] {:sizeof(_ID_OBJECT)}
15228
15229BYTE
15230
15231an encrypted credential area
15232
15233Page 134
15234October 31, 2013
15235
15236Published
15237Copyright © TCG 2006-2013
15238
15239Family “2.0”
15240Level 00 Revision 00.99
15241
15242Trusted Platform Module Library
15243
15244Part 2: Structures
15245
1524613 NV Storage Structures
1524713.1 TPM_NV_INDEX
15248A TPM_NV_INDEX is used to reference a defined location in NV memory. The format of the Index is
15249changed from TPM 1.2 in order to include the Index in the reserved handle space. Handles in this range
15250use the digest of the public area of the Index as the Name of the entity in authorization computations
15251The 32-bit TPM 1.2 NV Index format is shown in Figure 4. In order to allow the Index to fit into the 24 bits
15252available in the reserved handle space, the Index value format is changed as shown in Figure 5.
152533 3 2 2 2 2 2 2 2
152541 0 9 8 7 6 5 4 3
15255
152561 1
152576 5
15258
15259T P U D reserved
15260
152610
152620
15263
15264Purview
15265
15266Index
15267
15268Figure 4 — TPM 1.2 TPM_NV_INDEX
152693
152701
15271
152722 2
152734 3
15274
152750
152760
15277
15278TPM_HT_NV_INDEX
15279
15280Index
15281
15282Figure 5 — TPM 2.0 TPM_NV_INDEX
15283NOTE
15284
15285This TPM_NV_INDEX format does not retain the Purview field and the D bit is not a part of an Index
15286handle as in TPM 1.2. The TPMA_NV_PLATFORMCREATE attribute is a property of an Index that
15287provides functionality similar to the D bit.
15288
15289A valid Index handle will have an MSO of TPM_HT_NV_INDEX.
15290NOTE
15291
15292This structure is not used. It is defined here to indicate how the fields of the handle are assigned. The
15293exemplary unmarshaling code unmarshals a TPM_HANDLE and validates that it is in the range for a
15294TPM_NV_INDEX.
15295
15296Table 194 — Definition of (UINT32) TPM_NV_INDEX Bits <>
15297Bit
15298
15299Name
15300
15301Definition
15302
1530323:0
15304
15305index
15306
15307The index of the NV location
15308
1530931:24
15310
15311RH_NV
15312
15313constant value of TPM_HT_NV_INDEX indicating the NV Index range
15314
15315#TPM_RC_VALUE
15316
15317response code returned if unmarshaling of this type fails because the handle
15318value is incorrect
15319
15320Family “2.0”
15321Level 00 Revision 00.99
15322
15323Published
15324Copyright © TCG 2006-2013
15325
15326Page 135
15327October 31, 2013
15328
15329Part 2: Structures
15330
15331Trusted Platform Module Library
15332Table 195 — Options for space Field of TPM_NV_INDEX
15333
15334Some prior versions of this specification contained a table here that assigned subsets of the index field to
15335different entities. Since this assignment was a convention and not an architectural element of the TPM,
15336the table was removed and the information is now contained in a registry document that is maintained by
15337the TCG.
1533813.2 TPMA_NV (NV Index Attributes)
15339This structure allows the TPM to keep track of the data and permissions to manipulate an NV Index.
15340The platform controls (TPMA_NV_PPWRITE and TPMA_NV_PPREAD) and owner controls
15341(TPMA_NV_OWNERWRITE and TPMA_NV_OWNERREAD) give the platform and owner access to NV
15342Indexes using platformAuth or ownerAuth rather than the authValue or authPolicy of the Index.
15343If access to an NV Index is to be restricted based on PCR, then an appropriate authPolicy shall be
15344provided.
15345NOTE
15346
15347platformAuth or ownerAuth can be provided in any type of authorization session or as a password.
15348
15349If TPMA_NV_AUTHREAD is SET, then the Index may be read if the Index authValue is provided. If
15350TPMA_NV_POLICYREAD is SET, then the Index may be read if the Index authPolicy is satisfied.
15351At least one of TPMA_NV_PPREAD,
15352TPMA_NV_POLICYREAD shall be SET.
15353
15354TPMA_NV_OWNERREAD,
15355
15356TPMA_NV_AUTHREAD,
15357
15358or
15359
15360If TPMA_NV_AUTHWRITE is SET, then the Index may be written if the Index authValue is provided. If
15361TPMA_NV_POLICYWRITE is SET, then the Index may be written if the Index authPolicy is satisfied.
15362At least one of TPMA_NV_PPWRITE, TPMA_NV_OWNERWRITE TPMA_NV_AUTHWRITE, or
15363TPMA_NV_POLICYWRITE shall be SET.
15364If TPMA_NV_WRITELOCKED is SET, then the Index may not be written. If TPMA_NV_WRITEDEFINE is
15365SET, TPMA_NV_WRITELOCKED may not be CLEAR except by deleting and redefining the Index. If
15366TPMA_NV_WRITEDEFINE is CLEAR, then TPMA_NV_WRITELOCK will be CLEAR on the next
15367TPM2_Startup(TPM_SU_CLEAR).
15368If TPMA_NV_READLOCKED is SET, then the Index may not be read. TPMA_NV_READLOCK will be
15369CLEAR on the next TPM2_Startup(TPM_SU_CLEAR).
15370NOTE
15371
15372The TPM is expected to maintain indicators to indicate that the Index is temporarily locked. The state of
15373these indicators is reported in the TPMA_NV_READLOCKED and TPMA_NV_WRITELOCKED attributes.
15374
15375If TPMA_NV_EXTEND is SET, then writes to the Index will cause an update of the Index using the extend
15376operation with the nameAlg used to create the digest.
15377Only one of TPMA_NV_EXTEND, TPMA_NV_COUNTER, or TPMA_NV_BITS may be set.
15378When
15379the
15380Index
15381is
15382created
15383(TPM2_NV_DefineSpace()),
15384TPMA_NV_WRITELOCKED,
15385TPMA_NV_READLOCKED, TPMA_NV_WRITTEN shall all be CLEAR in the parameter that defines the
15386attributes of the created Index.
15387
15388Page 136
15389October 31, 2013
15390
15391Published
15392Copyright © TCG 2006-2013
15393
15394Family “2.0”
15395Level 00 Revision 00.99
15396
15397Trusted Platform Module Library
15398
15399Part 2: Structures
15400
15401Table 196 — Definition of (UINT32) TPMA_NV Bits
15402Bit
15403
15404Name
15405
15406Description
15407
154080
15409
15410TPMA_NV_PPWRITE
15411
15412SET (1): The Index data can be written if platformAuth is provided.
15413CLEAR (0): Writing of the Index data cannot be authorized with
15414platformAuth.
15415
154161
15417
15418TPMA_NV_OWNERWRITE
15419
15420SET (1): The Index data can be written if ownerAuth is provided.
15421CLEAR (0): Writing of the Index data cannot be authorized with
15422ownerAuth.
15423
154242
15425
15426TPMA_NV_AUTHWRITE
15427
15428SET (1): Authorizations to change the Index contents that require
15429USER role may be provided with an HMAC session or password.
15430CLEAR (0): Authorizations to change the Index contents that require
15431USER role may not be provided with an HMAC session or password.
15432
154333
15434
15435TPMA_NV_POLICYWRITE
15436
15437SET (1): Authorizations to change the Index contents that require
15438USER role may be provided with a policy session.
15439CLEAR (0): Authorizations to change the Index contents that require
15440USER role may not be provided with a policy session.
15441NOTE
15442
15443TPM2_NV_ChangeAuth() always requires that authorization be
15444provided in a policy session.
15445
154464
15447
15448TPMA_NV_COUNTER
15449
15450SET (1): Index contains an 8-octet value that is to be used as a
15451counter and can only be modified with TPM2_NV_Increment().
15452CLEAR (0): The Index is not a counter.
15453
154545
15455
15456TPMA_NV_BITS
15457
15458SET (1): Index contains an 8-octet value to be used as a bit field and
15459can only be modified with TPM2_NV_SetBits().
15460CLEAR (0): The Index is not a bit field.
15461
154626
15463
15464TPMA_NV_EXTEND
15465
15466SET (1): Index contains a digest-sized value used like a PCR. The
15467Index may only be modified using TPM2_NV_Extend. The extend will
15468use the nameAlg of the Index.
15469CLEAR (0): Index is not a PCR.
15470
154719:7 Reserved
15472
15473shall be zero
15474reserved for use in defining additional write controls
15475
1547610
15477
15478TPMA_NV_POLICY_DELETE
15479
15480SET (1): Index may not be deleted unless the authPolicy is satisfied.
15481CLEAR (0): Index may be deleted with proper platform or owner
15482authorization.
15483
1548411
15485
15486TPMA_NV_WRITELOCKED
15487
15488SET (1): Index cannot be written.
15489CLEAR (0): Index can be written.
15490
1549112
15492
15493TPMA_NV_WRITEALL
15494
15495SET (1): A partial write of the Index data is not allowed. The write
15496size shall match the defined space size.
15497CLEAR (0): Partial writes are allowed. This setting is required if
15498TPMA_NV_BITS is SET.
15499
1550013
15501
15502TPMA_NV_WRITEDEFINE
15503
15504SET (1): TPM2_NV_WriteLock() may be used to prevent further
15505writes to this location.
15506CLEAR (0): TPM2_NV_WriteLock() does not block subsequent
15507writes.
15508
1550914
15510
15511TPMA_NV_WRITE_STCLEAR
15512
15513SET (1): TPM2_NV_WriteLock() may be used to prevent further
15514writes to this location until the next TPM Reset or TPM Restart.
15515CLEAR (0): A write to this Index with a data size of zero does not
15516change the write access.
15517
15518Family “2.0”
15519Level 00 Revision 00.99
15520
15521Published
15522Copyright © TCG 2006-2013
15523
15524Page 137
15525October 31, 2013
15526
15527Part 2: Structures
15528
15529Trusted Platform Module Library
15530
15531Bit
15532
15533Name
15534
15535Description
15536
1553715
15538
15539TPMA_NV_GLOBALLOCK
15540
15541SET (1): If TPM2_NV_GlobalWriteLock() is successful, then further
15542writes to this location are not permitted until the next TPM Reset or
15543TPM Restart.
15544CLEAR (0): TPM2_NV_GlobalWriteLock() has no effect on the
15545writing of the data at this Index.
15546
1554716
15548
15549TPMA_NV_PPREAD
15550
15551SET (1): The Index data can be read if platformAuth is provided.
15552CLEAR (0): Reading of the Index data cannot be authorized with
15553platformAuth.
15554
1555517
15556
15557TPMA_NV_OWNERREAD
15558
15559SET (1): The Index data can be read if ownerAuth is provided.
15560CLEAR (0): Reading of the Index data cannot be authorized with
15561ownerAuth.
15562
1556318
15564
15565TPMA_NV_AUTHREAD
15566
15567SET (1): The Index data may be read if the authValue is provided.
15568CLEAR (0): Reading of the Index data cannot be authorized with the
15569Index authValue.
15570
1557119
15572
15573TPMA_NV_POLICYREAD
15574
15575SET (1): The Index data may be read if the authPolicy is satisfied.
15576CLEAR (0): Reading of the Index data cannot be authorized with the
15577Index authPolicy.
15578
1557924:20 Reserved
15580
15581shall be zero
15582reserved for use in defining additional read controls
15583
1558425
15585
15586TPMA_NV_NO_DA
15587
15588SET (1): Authorization failures of the Index do not affect the DA logic
15589and authorization of the Index is not blocked when the TPM is in
15590Lockout mode.
15591CLEAR (0): Authorization failures of the Index will increment the
15592authorization failure counter and authorizations of this Index are not
15593allowed when the TPM is in Lockout mode.
15594
1559526
15596
15597TPMA_NV_ORDERLY
15598
15599SET (1): NV Index state is only required to be saved when the TPM
15600performs an orderly shutdown (TPM2_Shutdown()). Only an Index
15601with TPMA_NV_COUNTER SET may have this setting.
15602CLEAR (0): NV Index state is required to be persistent after the
15603command to update the Index completes successfully (that is, the NV
15604update is synchronous with the update command).
15605
1560627
15607
15608TPMA_NV_CLEAR_STCLEAR
15609
15610SET (1): TPMA_NV_WRITTEN for the Index is CLEAR by TPM
15611Reset or TPM Restart.
15612CLEAR (0): TPMA_NV_WRITTEN is not changed by TPM Restart.
15613
1561424:20
15615
15616NOTE
15617
15618This attribute may only be SET if TPMA_NV_COUNTER is not
15619SET.
15620
15621NOTE
15622
15623If the TPMA_NV_ORDERLY is SET, TPMA_NV_WRITTEN will
15624be CLEAR by TPM Reset.
15625
1562628
15627
15628TPMA_NV_READLOCKED
15629
15630SET (1): Reads of the Index are blocked until the next TPM Reset or
15631TPM Restart.
15632CLEAR (0): Reads of the Index are allowed if proper authorization is
15633provided.
15634
1563529
15636
15637TPMA_NV_WRITTEN
15638
15639SET (1): Index has been written.
15640CLEAR (0): Index has not been written.
15641
1564230
15643
15644TPMA_NV_PLATFORMCREATE
15645
15646SET (1): This Index may be undefined with platformAuth but not with
15647ownerAuth.
15648CLEAR (0): This Index may be undefined using ownerAuth but not
15649with platformAuth.
15650The TPM will validate that this attribute is SET when the Index is
15651defined using platformAuth and will validate that this attribute is
15652CLEAR when the Index is defined using ownerAuth.
15653
15654Page 138
15655October 31, 2013
15656
15657Published
15658Copyright © TCG 2006-2013
15659
15660Family “2.0”
15661Level 00 Revision 00.99
15662
15663Trusted Platform Module Library
15664
15665Part 2: Structures
15666
15667Bit
15668
15669Name
15670
15671Description
15672
1567331
15674
15675TPMA_NV_READ_STCLEAR
15676
15677SET (1): TPM2_NV_ReadLock() may be used to SET
15678TPMA_NV_READLOCKED for this Index.
15679CLEAR (0): TPM2_NV_ReadLock() has no effect on this Index.
15680
1568113.3 TPMS_NV_PUBLIC
15682This structure describes an NV Index.
15683Table 197 — Definition of TPMS_NV_PUBLIC Structure
15684Name
15685
15686Type
15687
15688Description
15689
15690nvIndex
15691
15692TPMI_RH_NV_INDEX
15693
15694the handle of the data area
15695
15696nameAlg
15697
15698TPMI_ALG_HASH
15699
15700hash algorithm used to compute the name of the
15701Index and used for the authPolicy
15702
15703attributes
15704
15705TPMA_NV
15706
15707the Index attributes
15708
15709authPolicy
15710
15711TPM2B_DIGEST
15712
15713the access policy for the Index
15714
15715dataSize{:MAX_NV_INDEX_SIZE}
15716
15717UINT16
15718
15719the size of the data area
15720The
15721maximum
15722size is implementationdependent. The minimum maximum size is
15723platform-specific.
15724
15725#TPM_RC_SIZE
15726
15727response code returned when the requested size
15728is too large for the implementation
15729
1573013.4 TPM2B_NV_PUBLIC
15731This structure is used when a TPMS_NV_PUBLIC is sent on the TPM interface.
15732Table 198 — Definition of TPM2B_NV_PUBLIC Structure
15733Name
15734
15735Type
15736
15737Description
15738
15739size=
15740
15741UINT16
15742
15743size of nvPublic
15744
15745nvPublic
15746
15747TPMS_NV_PUBLIC
15748
15749the public area
15750
15751Family “2.0”
15752Level 00 Revision 00.99
15753
15754Published
15755Copyright © TCG 2006-2013
15756
15757Page 139
15758October 31, 2013
15759
15760Part 2: Structures
15761
15762Trusted Platform Module Library
15763
1576414 Context Data
1576514.1 Introduction
15766This clause defines the contents of the
15767TPM2_ContextLoad() command parameters.
15768
15769TPM2_ContextSave()
15770
15771response
15772
15773parameters
15774
15775and
15776
15777If the parameters provided by the caller in TPM2_ContextLoad() do not match the values returned by the
15778TPM when the context was saved, the integrity check of the TPM2B_CONTEXT will fail and the object or
15779session will not be loaded.
1578014.2 TPM2B_CONTEXT_SENSITIVE
15781This structure holds the object or session context data. When saved, the full structure is encrypted.
15782Table 199 — Definition of TPM2B_CONTEXT_SENSITIVE Structure <IN/OUT>
15783Parameter
15784
15785Type
15786
15787size
15788
15789Description
15790
15791UINT16
15792
15793buffer [size] {:MAX_CONTEXT_SIZE}
15794BYTE
15795
15796the sensitive data
15797
1579814.3 TPMS_CONTEXT_DATA
15799This structure holds the integrity value and the encrypted data for a context.
15800Table 200 — Definition of TPMS_CONTEXT_DATA Structure <IN/OUT, S>
15801Parameter
15802
15803Type
15804
15805Description
15806
15807integrity
15808
15809TPM2B_DIGEST
15810
15811the integrity value
15812
15813encrypted
15814
15815TPM2B_CONTEXT_SENSITIVE
15816
15817the sensitive area
15818
1581914.4 TPM2B_CONTEXT_DATA
15820This structure is used in a TPMS_CONTEXT.
15821Table 201 — Definition of TPM2B_CONTEXT_DATA Structure <IN/OUT>
15822Parameter
15823
15824Type
15825
15826size
15827
15828Description
15829
15830UINT16
15831
15832buffer [size] {:sizeof(TPMS_CONTEXT_DATA)}
15833BYTE
15834
15835Page 140
15836October 31, 2013
15837
15838Published
15839Copyright © TCG 2006-2013
15840
15841Family “2.0”
15842Level 00 Revision 00.99
15843
15844Trusted Platform Module Library
15845
15846Part 2: Structures
15847
1584814.5 TPMS_CONTEXT
15849This structure is used in TPM2_ContextLoad() and TPM2_ContextSave(). If the values of the
15850TPMS_CONTEXT structure in TPM2_ContextLoad() are not the same as the values when the context
15851was saved (TPM2_ContextSave()), then the TPM shall not load the context.
15852Saved object contexts shall not be loaded as long as the associated hierarchy is disabled.
15853Saved object contexts are invalidated when the Primary Seed of their hierarchy changes. Objects in the
15854Endorsement hierarchy are invalidated when either the EPS or SPS is changed.
15855When an object has the stClear attribute, it shall not be possible to reload the context or any descendant
15856object after a TPM Reset or TPM Restart.
15857NOTE 1
15858
15859The reference implementation prevents reloads after TPM Restart by including the curre nt value of a
15860clearCount in the saved object context. When an object is loaded, this value is compared with the current
15861value of the clearCount if the object has the stClear attribute. If the values are not the same, then the
15862object cannot be loaded.
15863
15864A sequence value is contained within the integrity-protected part of the saved context. The sequence
15865value is repeated in the sequence parameter of the TPMS_CONTEXT of the context. The sequence
15866parameter, along with other values, is used in the generation the protection values of the context.
15867If the integrity value of the context is valid, but the sequence value of the decrypted context does not
15868match the value in the sequence parameter, then TPM shall enter the failure mode because this is
15869indicative of a specific type of attack on the context values.
15870NOTE 2
15871
15872If the integrity value is correct, but the decryption fails and produces the wrong value for sequence, this
15873implies that either the TPM is faulty or an external entity is able to forge an integrity val ue for the context
15874but they have insufficient information to know what the encryption key of the context. Since the TPM
15875generated the valid context, then there is no reason for the sequence value in the context to be decrypted
15876incorrectly other than the TPM is faulty or the TPM is under attack. In either case, it is appropriate for the
15877TPM to enter failure more.
15878
15879Table 202 — Definition of TPMS_CONTEXT Structure
15880Name
15881
15882Type
15883
15884Description
15885
15886sequence
15887
15888UINT64
15889
15890the sequence number of the context
15891NOTE
15892
15893Transient object contexts and
15894contexts used different counters.
15895
15896session
15897
15898savedHandle
15899
15900TPMI_DH_CONTEXT
15901
15902the handle of the session, object or sequence
15903
15904hierarchy
15905
15906TPMI_RH_HIERARCHY+
15907
15908the hierarchy of the context
15909
15910contextBlob
15911
15912TPM2B_CONTEXT_DATA
15913
15914the context data and integrity HMAC
15915
15916Family “2.0”
15917Level 00 Revision 00.99
15918
15919Published
15920Copyright © TCG 2006-2013
15921
15922Page 141
15923October 31, 2013
15924
15925Part 2: Structures
15926
15927Trusted Platform Module Library
15928
1592914.6 Parameters of TPMS_CONTEXT
1593014.6.1 sequence
15931The sequence parameter is used to differentiate the contexts and to allow the TPM to create a different
15932encryption key for each context. Objects and sessions use different sequence counters. The sequence
15933counter for objects (transient and sequence) is incremented when an object context is saved, and the
15934sequence counter for sessions increments when a session is created or when it is loaded
15935(TPM2_ContextLoad()). The session sequence number is the contextID counter.
15936For a session, the sequence number also allows the TRM to find the “older” contexts so that they may be
15937refreshed if the contextID are too widely separated.
15938If an input value for sequence is larger than the value used in any saved context, the TPM shall return an
15939error (TPM_RC_VALUE) and do no additional processing of the context.
15940If the context is a session context and the input value for sequence is less than the current value of
15941contextID minus the maximum range for sessions, the TPM shall return an error (TPM_RC_VALUE) and
15942do no additional processing of the context.
1594314.6.2 savedHandle
15944For a session, this is the handle that was assigned to the session when it was saved. For a transient
15945object, the handle will have one of the values shown in Table 203.
15946If the handle type for savedHandle is TPM_HT_TRANSIENT, then the low order bits are used to
15947differentiate static objects from sequence objects.
15948If an input value for handle is outside of the range of values used by the TPM, the TPM shall return an
15949error (TPM_RC_VALUE) and do no additional processing of the context.
15950Table 203 — Context Handle Values
15951Value
15952
15953Description
15954
159550x02xxxxxx
15956
15957an HMAC session context
15958
159590x03xxxxxx
15960
15961a policy session context
15962
159630x80000000
15964
15965an ordinary transient object
15966
159670x80000001
15968
15969a sequence object
15970
159710x80000002
15972
15973a transient object with the stClear attribute SET
15974
15975Page 142
15976October 31, 2013
15977
15978Published
15979Copyright © TCG 2006-2013
15980
15981Family “2.0”
15982Level 00 Revision 00.99
15983
15984Trusted Platform Module Library
15985
15986Part 2: Structures
15987
1598814.6.3 hierarchy
15989This is the hierarchy (TPMI_RH_HIERARCHY) for the saved context and determines the proof value used
15990in the construction of the encryption and integrity values for the context. For session and sequence
15991contexts, the hierarchy is TPM_RC_NULL. The hierarchy for a transient object may be TPM_RH_NULL
15992but it is not required.
1599314.7 Context Protection
1599414.7.1 Context Integrity
15995The integrity of the context blob is protected by an HMAC. The integrity value is constructed such that
15996changes to the component values will invalidate the context and prevent it from being loaded.
15997Previously saved contexts for objects in the Platform hierarchy shall not be loadable after the PPS is
15998changed.
15999Previously saved contexts for objects in the Storage hierarchy shall not be loadable after the SPS is
16000changed.
16001Previously saved contexts for objects in the Endorsement hierarchy shall not be loadable after either the
16002EPS or SPS is changed.
16003Previously saved sessions shall not be loadable after the SPS changes.
16004Previously saved contexts for objects that have their stClear attribute SET shall not be loadable after a
16005TPM Restart. If a Storage Key has its stClear attribute SET, the descendants of this key shall not be
16006loadable after TPM Restart.
16007Previously saved contexts for a session and objects shall not be loadable after a TPM Reset.
16008A saved context shall not be loaded if its HMAC is not valid. The equation for computing the HMAC for a
16009context is found in “Context Integrity Protection” in Part 1.
1601014.7.2 Context Confidentiality
16011The context data of sessions and objects shall be protected by symmetric encryption using CFB. The
16012method for computing the IV and encryption key is found in “Context Confidentiality Protection” in Part 1.
16013
16014Family “2.0”
16015Level 00 Revision 00.99
16016
16017Published
16018Copyright © TCG 2006-2013
16019
16020Page 143
16021October 31, 2013
16022
16023Part 2: Structures
16024
16025Trusted Platform Module Library
16026
1602715 Creation Data
1602815.1 TPMS_CREATION_DATA
16029This structure provides information relating to the creation environment for the object. The creation data
16030includes the parent Name, parent Qualified Name, and the digest of selected PCR. These values
16031represent the environment in which the object was created. Creation data allows a relying party to
16032determine if an object was created when some appropriate protections were present.
16033When the object is created, the structure shown in Table 204 is generated and a ticket is computed over
16034this data.
16035If
16036the
16037parent
16038is
16039a
16040permanent
16041handle
16042(TPM_RH_OWNER,
16043TPM_RH_PLATFORM,
16044TPM_RH_ENDORSEMENT, or TPM_RH_NULL), then parentName and parentQualifiedName will be set
16045to the parent handle value and parentNameAlg will be TPM_ALG_NULL.
16046Table 204 — Definition of TPMS_CREATION_DATA Structure <OUT>
16047Parameter
16048
16049Type
16050
16051Description
16052
16053pcrSelect
16054
16055TPML_PCR_SELECTION
16056
16057list indicating the PCR included in pcrDigest
16058
16059pcrDigest
16060
16061TPM2B_DIGEST
16062
16063digest of the selected PCR using nameAlg of the object for
16064which this structure is being created
16065pcrDigest.size shall be zero if the pcrSelect list is empty.
16066
16067locality
16068
16069TPMA_LOCALITY
16070
16071the locality at which the object was created
16072
16073parentNameAlg
16074
16075TPM_ALG_ID
16076
16077nameAlg of the parent
16078
16079parentName
16080
16081TPM2B_NAME
16082
16083Name of the parent at time of creation
16084The size will match digest size associated with parentNameAlg
16085unless it is TPM_ALG_NULL, in which case the size will be 4
16086and parentName will be the hierarchy handle.
16087
16088parentQualifiedName
16089
16090TPM2B_NAME
16091
16092Qualified Name of the parent at the time of creation
16093Size is the same as parentName.
16094
16095outsideInfo
16096
16097TPM2B_DATA
16098
16099association with additional information added by the key
16100creator
16101This will be the contents of the outsideInfo parameter in
16102TPM2_Create() or TPM2_CreatePrimary().
16103
1610415.2 TPM2B_CREATION_DATA
16105This structure is created by TPM2_Create() and TPM2_CreatePrimary(). It is never entered into the TPM
16106and never has a size of zero.
16107Table 205 — Definition of TPM2B_CREATION_DATA Structure <OUT>
16108Parameter
16109
16110Type
16111
16112Description
16113
16114size=
16115
16116UINT16
16117
16118size of the creation data
16119
16120creationData
16121
16122TPMS_CREATION_DATA
16123
161241.1.1.1.1
16125Page 144
16126October 31, 2013
16127
16128Published
16129Copyright © TCG 2006-2013
16130
16131Family “2.0”
16132Level 00 Revision 00.99
16133
16134Trusted Platform Module Library
16135
16136Part 2: Structures
16137
16138Annex A
16139(informative)
16140Algorithm Constants
16141A.1
16142
16143Introduction
16144
16145This annex contains constants that are defined by algorithms.
16146
16147A.2
16148A.2.1
16149
16150Allowed Hash Algorithms
16151SHA1
16152Table 206 — Defines for SHA1 Hash Values
16153
16154Name
16155
16156Value
16157
16158SHA1_DIGEST_SIZE
16159
1616020
16161
16162SHA1_BLOCK_SIZE
16163
1616464
16165
16166SHA1_DER_SIZE
16167
16168Description
16169
1617015
16171
16172SHA1_DER
16173
16174Values are in octets.
16175
16176{0x30,0x21,0x30,0x09,0x06,0x05,0x2B,0x0E,0x03,0x02,0x1A,0x05,0x00,0x04,0x14}
16177
16178A.2.2
16179
16180SHA256
16181Table 207 — Defines for SHA256 Hash Values
16182
16183Name
16184
16185Value
16186
16187SHA256_DIGEST_SIZE
16188
1618932
16190
16191SHA256_BLOCK_SIZE
16192
1619364
16194
16195SHA256_DER_SIZE
16196
16197Description
16198
1619919
16200
16201SHA256_DER
16202
16203
16204Values are in octets.
16205
16206{0x30,0x31,0x30,0x0d,0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,0x05,0x00,0x04,0x20}
16207
16208A.2.3
16209SHA384
16210Table 208 — Defines for SHA384 Hash Values
16211
16212Name
16213
16214Value
16215
16216SHA384_DIGEST_SIZE
16217
1621848
16219
16220SHA384_BLOCK_SIZE
16221
16222128
16223
16224SHA384_DER_SIZE
16225
16226Description
16227
1622819
16229
16230SHA384_DER
16231
16232Family “2.0”
16233Level 00 Revision 00.99
16234
16235Values are in octets.
16236
16237{0x30,0x41,0x30,0x0d,0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,0x05,0x00,0x04,0x30}
16238
16239Published
16240Copyright © TCG 2006-2013
16241
16242Page 145
16243October 31, 2013
16244
16245Part 2: Structures
16246A.2.4
16247
16248Trusted Platform Module Library
16249
16250SHA512
16251Table 209 — Defines for SHA512 Hash Values
16252
16253Name
16254
16255Value
16256
16257SHA512_DIGEST_SIZE
16258
1625964
16260
16261SHA512_BLOCK_SIZE
16262
16263128
16264
16265SHA512_DER_SIZE
16266
16267Description
16268
1626919
16270
16271SHA512_DER
16272
16273
16274Values are in octets.
16275
16276{0x30,0x51,0x30,0x0d,0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,0x05,0x00,0x04,0x40}
16277
16278A.2.5
16279SM3_256
16280Table 210 — Defines for SM3_256 Hash Values
16281
16282Name
16283
16284Value
16285
16286Description
16287
16288SM3_256_DIGEST_SIZE
16289
1629032
16291
16292Values are in octets.
16293
16294SM3_256_BLOCK_SIZE
16295
1629664
16297
16298??
16299
16300SM3_256_DER_SIZE
16301
1630218
16303
16304SM3_256_DER
16305
16306
16307{0x30,0x30,0x30,0x0c,0x06,0x08,0x2a,0x81,0x1c,0x81,0x45,0x01,0x83,0x11,0x05,0x00,0x04,0x20}
16308
16309A.3
16310Unknown
16311
16312Architectural Limits
16313Table 211 — Defines for Architectural Limits Values
16314
16315Name
16316MAX_SESSION_NUMBER
16317
16318Page 146
16319October 31, 2013
16320
16321Value
163223
16323
16324Description
16325the maximum number of authorization sessions that may be in a
16326command
16327This value may be increased if new commands require more than
16328two authorization handles.
16329
16330Published
16331Copyright © TCG 2006-2013
16332
16333Family “2.0”
16334Level 00 Revision 00.99
16335
16336Trusted Platform Module Library
16337
16338Part 2: Structures
16339
16340Annex B
16341(informative)
16342Implementation Definitions
16343B.1
16344
16345Introduction
16346
16347This annex contains some of the tables that are used to define the desired implementation for the
16348automated tools.
16349NOTE
16350
16351B.2
16352
16353The reference implementation assumes that stdint.h is used.
16354
16355Logic Values
16356
16357The values in this clause are used to see the generation of the subsequent tables. These values should
16358not be changed.
16359Table 212 — Defines for Logic Values
16360Name
16361
16362Value
16363
16364YES
16365
163661
16367
16368NO
16369
163700
16371
16372TRUE
16373
163741
16375
16376FALSE
16377
163780
16379
16380SET
16381
163821
16383
16384CLEAR
16385
16386Description
16387
163880
16389
16390B.3
16391
16392Processor Values
16393
16394These values are used to control generation of octet-swapping routines. The canonical octet ordering for
16395the TPM input/output buffer is “big endian” with the most significant octet of any datum at the lowest
16396address.
16397NOTE
16398
16399The setting for the exemplar is for the x86 family of processor.
16400
16401Table 213 — Defines for Processor Values
16402Name
16403
16404Value
16405
16406Description
16407
16408BIG_ENDIAN_TPM
16409
16410NO
16411
16412set to YES or NO according to the processor
16413
16414LITTLE_ENDIAN_TPM
16415
16416YES
16417
16418set to YES or NO according to the processor
16419NOTE
16420
16421NO_AUTO_ALIGN
16422
16423NO
16424
16425set to YES if the processor does not allow unaligned accesses
16426NOTE
16427
16428Family “2.0”
16429Level 00 Revision 00.99
16430
16431BIG_ENDIAN and LITTLE_ENDIAN shall be set to opposite values.
16432
16433If LITTLE_ENDIAN is YES, then the setting of this value has no effect.
16434
16435Published
16436Copyright © TCG 2006-2013
16437
16438Page 147
16439October 31, 2013
16440
16441Part 2: Structures
16442
16443B.4
16444
16445Trusted Platform Module Library
16446
16447Implemented Algorithms
16448
16449Table 214 is used to indicate the algorithms that are implemented in a TPM. The selections in the Value
16450column may be changed to reflect the implementation. The values shown are illustrative.
16451The "Implemented" column contains a "Y", "YES", or blank to indicate that the command is present in the
16452implementation, an "N" or "NO" to indicate that the command is not implemented.
16453The leading and trailing “_” characters are to avoid name space collisions with some crypto libraries.
16454
16455NOTE
16456
16457Table 214 — Defines for Implemented Algorithms
16458Algorithm Name
16459
16460Implemented
16461
16462RSA
16463
16464YES
16465
16466SHA1
16467
16468YES
16469
16470HMAC
16471
16472YES
16473
16474AES
16475
16476YES
16477
16478MGF1
16479
16480YES
16481
16482XOR
16483
16484YES
16485
16486KEYEDHASH
16487
16488YES
16489
16490SHA256
16491
16492YES
16493
16494SHA384
16495
16496NO
16497
16498SHA512
16499
16500NO
16501
16502SM3_256
16503
16504YES
16505
16506SM4
16507
16508Comments
16509
16510YES
16511
16512REQUIRED, do not change this value
16513
16514REQUIRED, do not change this value
16515
16516RSASSA
16517
16518(YES * RSA)
16519
16520requires RSA
16521
16522RSAES
16523
16524(YES * RSA)
16525
16526requires RSA
16527
16528RSAPSS
16529
16530(YES * RSA)
16531
16532requires RSA
16533
16534OAEP
16535
16536(YES * RSA)
16537
16538requires RSA
16539
16540ECC
16541
16542YES
16543
16544ECDH
16545
16546(YES * ECC)
16547
16548requires ECC
16549
16550ECDSA
16551
16552(YES * ECC)
16553
16554requires ECC
16555
16556ECDAA
16557
16558(YES * ECC)
16559
16560requires ECC
16561
16562SM2
16563
16564(YES * ECC)
16565
16566requires ECC
16567
16568ECSCHNORR
16569
16570(YES * ECC)
16571
16572requires ECC
16573
16574ECMQV
16575
16576(NO * ECC)
16577
16578requires ECC
16579
16580SYMCIPHER
16581KDF1_SP800_56a
16582
16583YES
16584
16585REQUIRED, at least one symmetric algorithm shall be implemented
16586
16587(YES * ECC)
16588
16589KDF2
16590
16591NO
16592
16593KDF1_SP800_108
16594
16595YES
16596
16597CTR
16598
16599YES
16600
16601OFB
16602
16603YES
16604
16605CBC
16606
16607YES
16608
16609CFB
16610
16611YES
16612
16613ECB
16614
16615requires ECC
16616
16617YES
16618
16619B.5
16620
16621REQUIRED, do not change this value
16622
16623Implemented Commands
16624
16625Page 148
16626October 31, 2013
16627
16628Published
16629Copyright © TCG 2006-2013
16630
16631Family “2.0”
16632Level 00 Revision 00.99
16633
16634Trusted Platform Module Library
16635
16636Part 2: Structures
16637
16638This table is used to indicate which of the commands are implemented. In the reference implementation,
16639this table determines which commands can be called and drives the generation of various commanddependent switch statements.
16640The "Implemented or Dependent" column contains a "Y", "YES", or blank to indicate that the command is
16641present in the implementation; an "N" or "NO" to indicate that the command is not implemented; and an
16642algorithm value if implementation of the command is dependent on a setting in Table 214. Linkage to
16643Table 214 is not required and is provide as a convenience.
16644To indicate that the command is implemented, only "Y", "N", blank, or a value from Table 214 is allowed.
16645Table 215 — Defines for Implemented Commands
16646Name
16647ActivateCredential
16648
16649Implemented
16650or Dependent
16651
16652Comments
16653
16654YES
16655
16656Certify
16657
16658Y
16659
16660CertifyCreation
16661
16662Y
16663
16664ChangeEPS
16665
16666Y
16667
16668ChangePPS
16669
16670Y
16671
16672Clear
16673
16674Y
16675
16676ClearControl
16677
16678Y
16679
16680ClockRateAdjust
16681
16682Y
16683
16684ClockSet
16685
16686Y
16687
16688Commit
16689
16690ECC
16691
16692ContextLoad
16693
16694Y
16695
16696Context
16697
16698ContextSave
16699
16700Y
16701
16702Context
16703
16704Create
16705
16706Y
16707
16708CreatePrimary
16709
16710Y
16711
16712DictionaryAttackLockReset
16713
16714Y
16715
16716DictionaryAttackParameters
16717
16718Y
16719
16720Duplicate
16721
16722Y
16723
16724ECC_Parameters
16725
16726ECC
16727
16728ECDH_KeyGen
16729
16730ECC
16731
16732ECDH_ZGen
16733
16734ECC
16735
16736EncryptDecrypt
16737
16738Y
16739
16740EventSequenceComplete
16741
16742Y
16743
16744EvictControl
16745
16746Y
16747
16748FieldUpgradeData
16749
16750N
16751
16752FieldUpgradeStart
16753
16754N
16755
16756FirmwareRead
16757
16758N
16759
16760FlushContext
16761
16762Y
16763
16764GetCapability
16765
16766Y
16767
16768GetCommandAuditDigest
16769
16770Y
16771
16772GetRandom
16773
16774Y
16775
16776GetSessionAuditDigest
16777
16778Y
16779
16780Family “2.0”
16781Level 00 Revision 00.99
16782
16783Context
16784
16785Published
16786Copyright © TCG 2006-2013
16787
16788Page 149
16789October 31, 2013
16790
16791Part 2: Structures
16792
16793Name
16794
16795Trusted Platform Module Library
16796Implemented
16797or Dependent
16798
16799Comments
16800
16801GetTestResult
16802
16803Y
16804
16805GetTime
16806
16807Y
16808
16809Hash
16810
16811Y
16812
16813HashSequenceStart
16814
16815Y
16816
16817HierarchyChangeAuth
16818
16819Y
16820
16821HierarchyControl
16822
16823Y
16824
16825HMAC
16826
16827Y
16828
16829HMAC_Start
16830
16831Y
16832
16833Import
16834
16835Y
16836
16837IncrementalSelfTest
16838
16839Y
16840
16841Load
16842
16843Y
16844
16845LoadExternal
16846
16847Y
16848
16849MakeCredential
16850
16851Y
16852
16853NV_Certify
16854
16855Y
16856
16857NV_ChangeAuth
16858
16859Y
16860
16861NV_DefineSpace
16862
16863Y
16864
16865NV_Extend
16866
16867Y
16868
16869NV_GlobalWriteLock
16870
16871Y
16872
16873NV_Increment
16874
16875Y
16876
16877NV_Read
16878
16879Y
16880
16881NV_ReadLock
16882
16883Y
16884
16885NV_ReadPublic
16886
16887Y
16888
16889NV_SetBits
16890
16891Y
16892
16893NV_UndefineSpace
16894
16895Y
16896
16897NV_UndefineSpaceSpecial
16898
16899Y
16900
16901NV_Write
16902
16903Y
16904
16905NV_WriteLock
16906
16907Y
16908
16909ObjectChangeAuth
16910
16911Y
16912
16913PCR_Allocate
16914
16915Y
16916
16917PCR_Event
16918
16919Y
16920
16921PCR_Extend
16922
16923Y
16924
16925PCR_Read
16926
16927Y
16928
16929PCR
16930
16931PCR_Reset
16932
16933Y
16934
16935PCR
16936
16937PCR_SetAuthPolicy
16938
16939Y
16940
16941PCR_SetAuthValue
16942
16943Y
16944
16945PolicyAuthorize
16946
16947Y
16948
16949Policy
16950
16951PolicyAuthValue
16952
16953Y
16954
16955Policy
16956
16957PolicyCommandCode
16958
16959Y
16960
16961Policy
16962
16963PolicyCounterTimer
16964
16965Y
16966
16967Policy
16968
16969PolicyCpHash
16970
16971Y
16972
16973Policy
16974
16975Page 150
16976October 31, 2013
16977
16978NV
16979
16980PCR
16981
16982Published
16983Copyright © TCG 2006-2013
16984
16985Family “2.0”
16986Level 00 Revision 00.99
16987
16988Trusted Platform Module Library
16989
16990Part 2: Structures
16991Implemented
16992or Dependent
16993
16994Name
16995
16996Comments
16997
16998PolicyDuplicationSelect
16999
17000Y
17001
17002Policy
17003
17004PolicyGetDigest
17005
17006Y
17007
17008Policy
17009
17010PolicyLocality
17011
17012Y
17013
17014Policy
17015
17016PolicyNameHash
17017
17018Y
17019
17020Policy
17021
17022PolicyNV
17023
17024Y
17025
17026Policy
17027
17028PolicyOR
17029
17030Y
17031
17032Policy
17033
17034PolicyPassword
17035
17036Y
17037
17038Policy
17039
17040PolicyPCR
17041
17042Y
17043
17044Policy
17045
17046PolicyPhysicalPresence
17047
17048Y
17049
17050Policy
17051
17052PolicyRestart
17053
17054Y
17055
17056PolicySecret
17057
17058Y
17059
17060Policy
17061
17062PolicySigned
17063
17064Y
17065
17066Policy
17067
17068PolicyTicket
17069
17070Y
17071
17072Policy
17073
17074PP_Commands
17075
17076Y
17077
17078Quote
17079
17080Y
17081
17082ReadClock
17083
17084Y
17085
17086ReadPublic
17087
17088Y
17089
17090Rewrap
17091
17092Y
17093
17094RSA_Decrypt
17095
17096RSA
17097
17098RSA_Encrypt
17099
17100RSA
17101
17102SelfTest
17103
17104Y
17105
17106SequenceComplete
17107
17108Y
17109
17110SequenceUpdate
17111
17112Y
17113
17114SetAlgorithmSet
17115
17116Y
17117
17118SetCommandCodeAuditStatus
17119
17120Y
17121
17122SetPrimaryPolicy
17123
17124Y
17125
17126Shutdown
17127
17128Y
17129
17130Sign
17131
17132Y
17133
17134StartAuthSession
17135
17136Y
17137
17138Startup
17139
17140Y
17141
17142StirRandom
17143
17144Y
17145
17146TestParms
17147
17148Y
17149
17150Unseal
17151
17152Y
17153
17154VerifySignature
17155
17156Y
17157
17158ZGen_2Phase
17159
17160Y
17161
17162EC_Ephemeral
17163
17164Y
17165
17166PolicyNvWritten
17167
17168Y
17169
17170B.6
17171
17172Algorithm Constants
17173
17174Family “2.0”
17175Level 00 Revision 00.99
17176
17177Published
17178Copyright © TCG 2006-2013
17179
17180Page 151
17181October 31, 2013
17182
17183Part 2: Structures
17184B.6.1
17185
17186Trusted Platform Module Library
17187
17188RSA
17189Table 216 — Defines for RSA Algorithm Constants
17190
17191Name
17192
17193Value
17194
17195Comments
17196
17197RSA_KEY_SIZES_BITS
17198
17199{1024, 2048}
17200
17201braces because this is a
17202list value
17203
17204MAX_RSA_KEY_BITS
17205
172062048
17207
17208MAX_RSA_KEY_BYTES
17209
17210((MAX_RSA_KEY_BITS + 7) / 8)
17211
17212B.6.2
17213
17214ECC
17215Table 217 — Defines for ECC Algorithm Constants
17216
17217Name
17218
17219Value
17220
17221ECC_CURVES
17222
17223{TPM_ECC_NIST_P256, TPM_ECC_BN_P256, TPM_ECC_SM2_P256}
17224
17225ECC_KEY_SIZES_BITS
17226
17227{256}
17228
17229MAX_ECC_KEY_BITS
17230
17231256
17232
17233MAX_ECC_KEY_BYTES
17234
17235((MAX_ECC_KEY_BITS + 7) / 8)
17236
17237B.6.3
17238
17239Comments
17240
17241this is a list value with
17242length of one
17243
17244AES
17245Table 218 — Defines for AES Algorithm Constants
17246
17247Name
17248
17249Value
17250
17251AES_KEY_SIZES_BITS
17252
17253{128}
17254
17255MAX_AES_KEY_BITS
17256
17257128
17258
17259MAX_AES_BLOCK_SIZE_BYTES
17260
1726116
17262
17263MAX_AES_KEY_BYTES
17264
17265((MAX_AES_KEY_BITS + 7) / 8)
17266
17267B.6.4
17268
17269Comments
17270
17271SM4
17272Table 219 — Defines for SM4 Algorithm Constants
17273
17274Name
17275
17276Value
17277
17278SM4_KEY_SIZES_BITS
17279
17280{128}
17281
17282MAX_SM4_KEY_BITS
17283
17284128
17285
17286MAX_SM4_BLOCK_SIZE_BYTES
17287
1728816
17289
17290MAX_SM4_KEY_BYTES
17291
17292((MAX_SM4_KEY_BITS + 7) / 8)
17293
17294Page 152
17295October 31, 2013
17296
17297Comments
17298
17299Published
17300Copyright © TCG 2006-2013
17301
17302Family “2.0”
17303Level 00 Revision 00.99
17304
17305Trusted Platform Module Library
17306B.6.5
17307
17308Part 2: Structures
17309
17310Symmetric
17311
17312The definitions in this table are derived from the implemented symmetric algorithms.
17313Table 220 — Defines for Symmetric Algorithm Constants
17314Name
17315
17316Value
17317
17318MAX_SYM_KEY_BITS
17319
17320MAX_AES_KEY_BITS
17321
17322MAX_SYM_KEY_BYTES
17323
17324MAX_AES_KEY_BYTES
17325
17326MAX_SYM_BLOCK_SIZE
17327
17328MAX_AES_BLOCK_SIZE_BYTES
17329
17330Family “2.0”
17331Level 00 Revision 00.99
17332
17333Comments
17334
17335Published
17336Copyright © TCG 2006-2013
17337
17338Page 153
17339October 31, 2013
17340
17341Part 2: Structures
17342
17343B.7
17344
17345Trusted Platform Module Library
17346
17347Implementation Specific Values
17348
17349The values listed in Table 221 are defined for a specific TPM implementation. The numbers in the Value
17350column may be changed to reflect the implementation. The values shown are illustrative.
17351Table 221 — Defines for Implementation Values
17352Name
17353
17354Value
17355
17356Description
17357
17358FIELD_UPGRADE_IMPLEMENTED
17359
17360NO
17361
17362temporary define
17363
17364BSIZE
17365
17366UINT16
17367
17368size used for internal storage of
17369the size field of a TPM2B
17370This is the definition used for
17371the reference design.
17372Compilation with this value
17373changed may cause warnings
17374about conversions.
17375
17376BUFFER_ALIGNMENT
17377
173784
17379
17380sets the size granularity for the
17381buffers in a TPM2B structure
17382TPMxB buffers will be assigned
17383a space that is a multiple of this
17384value. This does not set the size
17385limits for IO. Those are set by
17386the canonical form of the
17387TPMxB
17388
17389IMPLEMENTATION_PCR
17390
1739124
17392
17393the number of PCR in the TPM
17394
17395PLATFORM_PCR
17396
1739724
17398
17399the number of PCR required by
17400the relevant platform
17401specification
17402
17403DRTM_PCR
17404
1740517
17406
17407the DRTM PCR
17408
17409HCRTM_PCR
17410
174110
17412
17413the PCR that will receive the HCRTM value at TPM2_Startup
17414
17415NUM_LOCALITIES
17416
174175
17418
17419the number of localities
17420supported by the TPM
17421This is expected to be either 5
17422for a PC, or 1 for just about
17423everything else.
17424
17425MAX_HANDLE_NUM
17426
174273
17428
17429the maximum number of
17430handles in the handle area
17431This should be produced by the
17432Part 3 parser but is here for
17433now.
17434
17435MAX_ACTIVE_SESSIONS
17436
1743764
17438
17439the number of simultaneously
17440active sessions that are
17441supported by the TPM
17442implementation
17443
17444CONTEXT_SLOT
17445
17446UINT16
17447
17448the type of an entry in the array
17449of saved contexts
17450
17451CONTEXT_COUNTER
17452
17453UINT64
17454
17455the type of the saved session
17456counter
17457
17458MAX_LOADED_SESSIONS
17459
174603
17461
17462the number of sessions that the
17463TPM may have in memory
17464
17465MAX_SESSION_NUM
17466
174673
17468
17469this is the current maximum
17470value
17471
17472Page 154
17473October 31, 2013
17474
17475Published
17476Copyright © TCG 2006-2013
17477
17478Family “2.0”
17479Level 00 Revision 00.99
17480
17481Trusted Platform Module Library
17482
17483Part 2: Structures
17484
17485Name
17486
17487Value
17488
17489Description
17490
17491MAX_LOADED_OBJECTS
17492
174933
17494
17495the number of simultaneously
17496loaded objects that are
17497supported by the TPM; this
17498number does not include the
17499objects that may be placed in
17500NV memory by
17501TPM2_EvictControl().
17502
17503MIN_EVICT_OBJECTS
17504
175052
17506
17507the minimum number of evict
17508objects supported by the TPM
17509
17510PCR_SELECT_MIN
17511
17512((PLATFORM_PCR+7)/8)
17513
17514PCR_SELECT_MAX
17515
17516((IMPLEMENTATION_PCR+7)/8)
17517
17518NUM_POLICY_PCR_GROUP
17519
175201
17521
17522number of PCR groups that
17523have individual policies
17524
17525NUM_AUTHVALUE_PCR_GROUP
17526
175271
17528
17529number of PCR groups that
17530have individual authorization
17531values
17532
17533MAX_CONTEXT_SIZE
17534
175354000
17536
17537This may be larger than
17538necessary
17539
17540MAX_DIGEST_BUFFER
17541
175421024
17543
17544MAX_NV_INDEX_SIZE
17545
175462048
17547
17548maximum data size allowed in
17549an NV Index
17550
17551MAX_NV_BUFFER_SIZE
17552
175531024
17554
17555maximum data size in one NV
17556read or write command
17557
17558MAX_CAP_BUFFER
17559
175601024
17561
17562NV_MEMORY_SIZE
17563
1756416384
17565
17566NUM_STATIC_PCR
17567
1756816
17569
17570MAX_ALG_LIST_SIZE
17571
1757264
17573
17574number of algorithms that can
17575be in a list
17576
17577TIMER_PRESCALE
17578
17579100000
17580
17581nominal value for the pre-scale
17582value of Clock (the number of
17583cycles of the TPM's oscillator for
17584each increment of Clock)
17585
17586PRIMARY_SEED_SIZE
17587
1758832
17589
17590size of the Primary Seed in
17591octets
17592
17593CONTEXT_ENCRYPT_ALG
17594
17595TPM_ALG_AES
17596
17597context encryption algorithm
17598
17599CONTEXT_ENCRYPT_KEY_BITS
17600
17601MAX_SYM_KEY_BITS
17602
17603context encryption key size in
17604bits
17605
17606CONTEXT_ENCRYPT_KEY_BYTES
17607
17608((CONTEXT_ENCRYPT_KEY_BITS+7)/8)
17609
17610CONTEXT_INTEGRITY_HASH_ALG
17611
17612TPM_ALG_SHA256
17613
17614context integrity hash algorithm
17615
17616CONTEXT_INTEGRITY_HASH_SIZE
17617
17618SHA256_DIGEST_SIZE
17619
17620number of byes in the context
17621integrity digest
17622
17623PROOF_SIZE
17624
17625CONTEXT_INTEGRITY_HASH_SIZE
17626
17627size of proof value in octets
17628This size of the proof should be
17629consistent with the digest size
17630used for context integrity.
17631
17632NV_CLOCK_UPDATE_INTERVAL
17633
1763412
17635
17636the update interval expressed
17637as a power of 2 seconds
17638
17639size of NV memory in octets
17640
17641A value of 12 is 4,096 seconds
17642(~68 minutes).
17643
17644Family “2.0”
17645Level 00 Revision 00.99
17646
17647Published
17648Copyright © TCG 2006-2013
17649
17650Page 155
17651October 31, 2013
17652
17653Part 2: Structures
17654
17655Trusted Platform Module Library
17656
17657Name
17658
17659Value
17660
17661Description
17662
17663NUM_POLICY_PCR
17664
176651
17666
17667number of PCR that allow
17668policy/auth
17669
17670MAX_COMMAND_SIZE
17671
176724096
17673
17674maximum size of a command
17675
17676MAX_RESPONSE_SIZE
17677
176784096
17679
17680maximum size of a response
17681
17682ORDERLY_BITS
17683
176848
17685
17686number between 1 and 32
17687inclusive
17688
17689MAX_ORDERLY_COUNT
17690
17691((1 << ORDERLY_BITS) - 1)
17692
17693maximum count of orderly
17694counter before NV is updated
17695This must be of the form 2N – 1
17696where 1 ≤ N ≤ 32.
17697
17698ALG_ID_FIRST
17699
17700TPM_ALG_FIRST
17701
17702used by GetCapability()
17703processing to bound the
17704algorithm search
17705
17706ALG_ID_LAST
17707
17708TPM_ALG_LAST
17709
17710used by GetCapability()
17711processing to bound the
17712algorithm search
17713
17714MAX_SYM_DATA
17715
17716128
17717
17718this is the maximum number of
17719octets that may be in a sealed
17720blob.
17721
17722MAX_RNG_ENTROPY_SIZE
17723
1772464
17725
17726RAM_INDEX_SPACE
17727
17728512
17729
17730RSA_DEFAULT_PUBLIC_EXPONENT
17731
177320x00010001
17733
17734216 + 1
17735
17736ENABLE_PCR_NO_INCREMENT
17737
17738YES
17739
17740
17741CRT_FORMAT_RSA
17742
17743YES
17744
17745PRIVATE_VENDOR_SPECIFIC_BYTES
17746
17747((MAX_RSA_KEY_BYTES/2) * (3 + CRT_FORMAT_RSA * 2))
17748
17749Page 156
17750October 31, 2013
17751
17752Published
17753Copyright © TCG 2006-2013
17754
17755Family “2.0”
17756Level 00 Revision 00.99
17757
17758
17759