github.com/jlmucb/cloudproxy@v0.0.0-20170830161738-b5aa0b619bc4/go/tpm2/constants.go (about) 1 // Copyright (c) 2014, Google Inc. All rights reserved. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package tpm2 16 17 // TPM generated 18 const( 19 OrdTPM_GENERATED_VALUE uint32 = 0xff544347 20 ) 21 22 // Supported Algorithms. 23 const( 24 AlgTPM_ALG_RSA uint16 = 0x0001 25 AlgTPM_ALG_SHA1 uint16 = 0x0004 26 AlgTPM_ALG_AES uint16 = 0x0006 27 AlgTPM_ALG_SHA256 uint16 = 0x000B 28 AlgTPM_ALG_SHA384 uint16 = 0x000C 29 AlgTPM_ALG_SHA512 uint16 = 0x000D 30 AlgTPM_ALG_NULL uint16 = 0x0010 31 AlgTPM_ALG_RSASSA uint16 = 0x0014 32 AlgTPM_ALG_RSAES uint16 = 0x0015 33 AlgTPM_ALG_RSAPSS uint16 = 0x0016 34 AlgTPM_ALG_OAEP uint16 = 0x0017 35 AlgTPM_ALG_ECDSA uint16 = 0x0018 36 AlgTPM_ALG_ECDH uint16 = 0x0019 37 AlgTPM_ALG_ECDAA uint16 = 0x001A 38 AlgTPM_ALG_ECC uint16 = 0x0023 39 AlgTPM_ALG_CTR uint16 = 0x0040 40 AlgTPM_ALG_OFB uint16 = 0x0041 41 AlgTPM_ALG_CBC uint16 = 0x0042 42 AlgTPM_ALG_CFB uint16 = 0x0043 43 AlgTPM_ALG_ECB uint16 = 0x0044 44 AlgTPM_ALG_LAST uint16 = 0x0044 45 AlgTPM_ALG_KEYEDHASH uint16 = 0x0008 46 ) 47 48 // Policy 49 const( 50 OrdTPM_SE_POLICY uint8 = 0x01 51 ) 52 53 // Properties 54 const( 55 FlagFixedTPM uint32 = 0x00000002 56 FlagFixedParent uint32 = 0x00000010 57 FlagSensitiveDataOrigin uint32 = 0x00000020 58 FlagUserWithAuth uint32 = 0x00000040 59 FlagAdminWithPolicy uint32 = 0x00000080 60 61 FlagRestricted uint32 = 0x00010000 62 FlagDecrypt uint32 = 0x00020000 63 FlagSign uint32 = 0x00040000 64 65 FlagSealDefault uint32 = FlagFixedTPM | FlagFixedParent 66 FlagSignerDefault uint32 = FlagSign | FlagRestricted | FlagFixedTPM | 67 FlagFixedParent | FlagSensitiveDataOrigin | FlagUserWithAuth 68 FlagStorageDefault uint32 = FlagDecrypt | FlagRestricted | FlagFixedTPM | 69 FlagFixedParent | FlagSensitiveDataOrigin | FlagUserWithAuth 70 ) 71 72 // Reserved Handles and Properties 73 const( 74 OrdTPM_RH_OWNER uint32 = 0x40000001 75 OrdTPM_RH_REVOKE uint32 = 0x40000002 76 OrdTPM_RH_TRANSPORT uint32 = 0x40000003 77 OrdTPM_RH_OPERATOR uint32 = 0x40000004 78 OrdTPM_RH_ADMIN uint32 = 0x40000005 79 OrdTPM_RH_EK uint32 = 0x40000006 80 OrdTPM_RH_NULL uint32 = 0x40000007 81 OrdTPM_RH_UNASSIGNED uint32 = 0x40000008 82 OrdTPM_RS_PW uint32 = 0x40000009 83 OrdTPM_RH_LOCKOUT uint32 = 0x4000000A 84 OrdTPM_RH_ENDORSEMENT uint32 = 0x4000000B 85 OrdTPM_RH_PLATFORM uint32 = 0x4000000C 86 OrdTPM_CAP_TPM_PROPERTIES uint32 = 0x00000006 87 OrdTPM_CAP_HANDLES uint32 = 0x00000001 88 OrdNV_PLATFORMCREATE uint32 = 0x40000000 89 OrdNV_AUTHWRITE uint32 = 0x00000004 90 OrdNV_AUTHREAD uint32 = 0x00040000 91 OrdNV_COUNTER uint32 = 0x00000010 92 OrdHR_SHIFT uint32 = 24 93 OrdTPM_HT_NV_INDEX uint32 = 1 94 OrdNV_EXTEND uint32 = 0x00000040 95 OrdNV_POLICY_DELETE uint32 = 0x00000400 96 OrdNV_WRITTEN uint32 = 0x20000000 97 ) 98 99 // Tags 100 const( 101 tagNO_SESSIONS uint16 = 0x8001 102 tagSESSIONS uint16 = 0x8002 103 ) 104 105 // magic number 106 const( 107 ordTpmMagic uint32 = 0xff544347 108 ) 109 110 // Supported TPM operations. 111 const ( 112 cmdEvictControl uint32 = 0x00000120 113 cmdClockSet uint32 = 0x00000128 114 cmdPCR_Allocate uint32 = 0x0000012B 115 cmdCreatePrimary uint32 = 0x00000131 116 cmdCreate uint32 = 0x00000153 117 cmdStirRandom uint32 = 0x00000146 118 cmdActivateCredential uint32 = 0x00000147 119 cmdCertify uint32 = 0x00000148 120 cmdLoad uint32 = 0x00000157 121 cmdQuote uint32 = 0x00000158 122 cmdUnseal uint32 = 0x0000015E 123 cmdContextLoad uint32 = 0x00000161 124 cmdContextSave uint32 = 0x00000162 125 cmdFlushContext uint32 = 0x00000165 126 cmdLoadExternal uint32 = 0x00000167 127 cmdMakeCredential uint32 = 0x00000168 128 cmdReadPublic uint32 = 0x00000173 129 cmdStartAuthSession uint32 = 0x00000176 130 cmdGetCapability uint32 = 0x0000017A 131 cmdGetRandom uint32 = 0x0000017B 132 cmdPCR_Read uint32 = 0x0000017E 133 cmdPolicyPCR uint32 = 0x0000017F 134 cmdReadClock uint32 = 0x00000181 135 cmdPCR_Extend uint32 = 0x00000182 136 cmdPolicyGetDigest uint32 = 0x00000189 137 cmdPolicyPassword uint32 = 0x0000018C 138 cmdPcrEvent uint32 = 0x0000013C 139 cmdDefineSpace uint32 = 0x0000012A 140 cmdUndefineSpace uint32 = 0x00000122 141 cmdReadNv uint32 = 0x0000014E 142 cmdWriteNv uint32 = 0x00000137 143 cmdIncrementNvCounter uint32 = 0x00000134 144 ) 145 146 const maxTPMResponse = 4096 147