blob: 8eb443d3687919d3858f113cb11ce55af9eb1325 [file] [log] [blame]
// Copyright 2014 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// THIS CODE IS GENERATED - DO NOT MODIFY!
#ifndef TRUNKS_TPM_GENERATED_H_
#define TRUNKS_TPM_GENERATED_H_
#include <string>
#include <base/basictypes.h>
#include <base/callback_forward.h>
#include "trunks/trunks_export.h"
namespace trunks {
class AuthorizationDelegate;
class CommandTransceiver;
#if !defined(SHA1_DIGEST_SIZE)
#define SHA1_DIGEST_SIZE 20
#endif
#if !defined(SHA1_BLOCK_SIZE)
#define SHA1_BLOCK_SIZE 64
#endif
#if !defined(SHA1_DER_SIZE)
#define SHA1_DER_SIZE 15
#endif
#if !defined(SHA1_DER)
#define SHA1_DER {0x30,0x21,0x30,0x09,0x06,0x05,0x2B,0x0E,0x03,0x02,0x1A,0x05,0x00,0x04,0x14}
#endif
#if !defined(SHA256_DIGEST_SIZE)
#define SHA256_DIGEST_SIZE 32
#endif
#if !defined(SHA256_BLOCK_SIZE)
#define SHA256_BLOCK_SIZE 64
#endif
#if !defined(SHA256_DER_SIZE)
#define SHA256_DER_SIZE 19
#endif
#if !defined(SHA256_DER)
#define SHA256_DER {0x30,0x31,0x30,0x0d,0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,0x05,0x00,0x04,0x20}
#endif
#if !defined(SHA384_DIGEST_SIZE)
#define SHA384_DIGEST_SIZE 48
#endif
#if !defined(SHA384_BLOCK_SIZE)
#define SHA384_BLOCK_SIZE 128
#endif
#if !defined(SHA384_DER_SIZE)
#define SHA384_DER_SIZE 19
#endif
#if !defined(SHA384_DER)
#define SHA384_DER {0x30,0x41,0x30,0x0d,0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,0x05,0x00,0x04,0x30}
#endif
#if !defined(SHA512_DIGEST_SIZE)
#define SHA512_DIGEST_SIZE 64
#endif
#if !defined(SHA512_BLOCK_SIZE)
#define SHA512_BLOCK_SIZE 128
#endif
#if !defined(SHA512_DER_SIZE)
#define SHA512_DER_SIZE 19
#endif
#if !defined(SHA512_DER)
#define SHA512_DER {0x30,0x51,0x30,0x0d,0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,0x05,0x00,0x04,0x40}
#endif
#if !defined(SM3_256_DIGEST_SIZE)
#define SM3_256_DIGEST_SIZE 32
#endif
#if !defined(SM3_256_BLOCK_SIZE)
#define SM3_256_BLOCK_SIZE 64
#endif
#if !defined(SM3_256_DER_SIZE)
#define SM3_256_DER_SIZE 18
#endif
#if !defined(SM3_256_DER)
#define SM3_256_DER {0x30,0x30,0x30,0x0c,0x06,0x08,0x2a,0x81,0x1c,0x81,0x45,0x01,0x83,0x11,0x05,0x00,0x04,0x20}
#endif
#if !defined(MAX_SESSION_NUMBER)
#define MAX_SESSION_NUMBER 3
#endif
#if !defined(YES)
#define YES 1
#endif
#if !defined(NO)
#define NO 0
#endif
#if !defined(TRUE)
#define TRUE 1
#endif
#if !defined(FALSE)
#define FALSE 0
#endif
#if !defined(SET)
#define SET 1
#endif
#if !defined(CLEAR)
#define CLEAR 0
#endif
#if !defined(BIG_ENDIAN_TPM)
#define BIG_ENDIAN_TPM NO
#endif
#if !defined(LITTLE_ENDIAN_TPM)
#define LITTLE_ENDIAN_TPM YES
#endif
#if !defined(NO_AUTO_ALIGN)
#define NO_AUTO_ALIGN NO
#endif
#if !defined(RSA_KEY_SIZES_BITS)
#define RSA_KEY_SIZES_BITS {1024, 2048}
#endif
#if !defined(MAX_RSA_KEY_BITS)
#define MAX_RSA_KEY_BITS 2048
#endif
#if !defined(MAX_RSA_KEY_BYTES)
#define MAX_RSA_KEY_BYTES ((MAX_RSA_KEY_BITS + 7) / 8)
#endif
#if !defined(ECC_CURVES)
#define ECC_CURVES {TPM_ECC_NIST_P256, TPM_ECC_BN_P256, TPM_ECC_SM2_P256}
#endif
#if !defined(ECC_KEY_SIZES_BITS)
#define ECC_KEY_SIZES_BITS {256}
#endif
#if !defined(MAX_ECC_KEY_BITS)
#define MAX_ECC_KEY_BITS 256
#endif
#if !defined(MAX_ECC_KEY_BYTES)
#define MAX_ECC_KEY_BYTES ((MAX_ECC_KEY_BITS + 7) / 8)
#endif
#if !defined(AES_KEY_SIZES_BITS)
#define AES_KEY_SIZES_BITS {128}
#endif
#if !defined(MAX_AES_KEY_BITS)
#define MAX_AES_KEY_BITS 128
#endif
#if !defined(MAX_AES_BLOCK_SIZE_BYTES)
#define MAX_AES_BLOCK_SIZE_BYTES 16
#endif
#if !defined(MAX_AES_KEY_BYTES)
#define MAX_AES_KEY_BYTES ((MAX_AES_KEY_BITS + 7) / 8)
#endif
#if !defined(SM4_KEY_SIZES_BITS)
#define SM4_KEY_SIZES_BITS {128}
#endif
#if !defined(MAX_SM4_KEY_BITS)
#define MAX_SM4_KEY_BITS 128
#endif
#if !defined(MAX_SM4_BLOCK_SIZE_BYTES)
#define MAX_SM4_BLOCK_SIZE_BYTES 16
#endif
#if !defined(MAX_SM4_KEY_BYTES)
#define MAX_SM4_KEY_BYTES ((MAX_SM4_KEY_BITS + 7) / 8)
#endif
#if !defined(MAX_SYM_KEY_BITS)
#define MAX_SYM_KEY_BITS MAX_AES_KEY_BITS
#endif
#if !defined(MAX_SYM_KEY_BYTES)
#define MAX_SYM_KEY_BYTES MAX_AES_KEY_BYTES
#endif
#if !defined(MAX_SYM_BLOCK_SIZE)
#define MAX_SYM_BLOCK_SIZE MAX_AES_BLOCK_SIZE_BYTES
#endif
#if !defined(FIELD_UPGRADE_IMPLEMENTED)
#define FIELD_UPGRADE_IMPLEMENTED NO
#endif
#if !defined(BSIZE)
#define BSIZE UINT16
#endif
#if !defined(BUFFER_ALIGNMENT)
#define BUFFER_ALIGNMENT 4
#endif
#if !defined(IMPLEMENTATION_PCR)
#define IMPLEMENTATION_PCR 24
#endif
#if !defined(PLATFORM_PCR)
#define PLATFORM_PCR 24
#endif
#if !defined(DRTM_PCR)
#define DRTM_PCR 17
#endif
#if !defined(HCRTM_PCR)
#define HCRTM_PCR 0
#endif
#if !defined(NUM_LOCALITIES)
#define NUM_LOCALITIES 5
#endif
#if !defined(MAX_HANDLE_NUM)
#define MAX_HANDLE_NUM 3
#endif
#if !defined(MAX_ACTIVE_SESSIONS)
#define MAX_ACTIVE_SESSIONS 64
#endif
#if !defined(CONTEXT_SLOT)
#define CONTEXT_SLOT UINT16
#endif
#if !defined(CONTEXT_COUNTER)
#define CONTEXT_COUNTER UINT64
#endif
#if !defined(MAX_LOADED_SESSIONS)
#define MAX_LOADED_SESSIONS 3
#endif
#if !defined(MAX_SESSION_NUM)
#define MAX_SESSION_NUM 3
#endif
#if !defined(MAX_LOADED_OBJECTS)
#define MAX_LOADED_OBJECTS 3
#endif
#if !defined(MIN_EVICT_OBJECTS)
#define MIN_EVICT_OBJECTS 2
#endif
#if !defined(PCR_SELECT_MIN)
#define PCR_SELECT_MIN ((PLATFORM_PCR+7)/8)
#endif
#if !defined(PCR_SELECT_MAX)
#define PCR_SELECT_MAX ((IMPLEMENTATION_PCR+7)/8)
#endif
#if !defined(NUM_POLICY_PCR_GROUP)
#define NUM_POLICY_PCR_GROUP 1
#endif
#if !defined(NUM_AUTHVALUE_PCR_GROUP)
#define NUM_AUTHVALUE_PCR_GROUP 1
#endif
#if !defined(MAX_CONTEXT_SIZE)
#define MAX_CONTEXT_SIZE 4000
#endif
#if !defined(MAX_DIGEST_BUFFER)
#define MAX_DIGEST_BUFFER 1024
#endif
#if !defined(MAX_NV_INDEX_SIZE)
#define MAX_NV_INDEX_SIZE 2048
#endif
#if !defined(MAX_NV_BUFFER_SIZE)
#define MAX_NV_BUFFER_SIZE 1024
#endif
#if !defined(MAX_CAP_BUFFER)
#define MAX_CAP_BUFFER 1024
#endif
#if !defined(NV_MEMORY_SIZE)
#define NV_MEMORY_SIZE 16384
#endif
#if !defined(NUM_STATIC_PCR)
#define NUM_STATIC_PCR 16
#endif
#if !defined(MAX_ALG_LIST_SIZE)
#define MAX_ALG_LIST_SIZE 64
#endif
#if !defined(TIMER_PRESCALE)
#define TIMER_PRESCALE 100000
#endif
#if !defined(PRIMARY_SEED_SIZE)
#define PRIMARY_SEED_SIZE 32
#endif
#if !defined(CONTEXT_ENCRYPT_ALG)
#define CONTEXT_ENCRYPT_ALG TPM_ALG_AES
#endif
#if !defined(CONTEXT_ENCRYPT_KEY_BITS)
#define CONTEXT_ENCRYPT_KEY_BITS MAX_SYM_KEY_BITS
#endif
#if !defined(CONTEXT_ENCRYPT_KEY_BYTES)
#define CONTEXT_ENCRYPT_KEY_BYTES ((CONTEXT_ENCRYPT_KEY_BITS+7)/8)
#endif
#if !defined(CONTEXT_INTEGRITY_HASH_ALG)
#define CONTEXT_INTEGRITY_HASH_ALG TPM_ALG_SHA256
#endif
#if !defined(CONTEXT_INTEGRITY_HASH_SIZE)
#define CONTEXT_INTEGRITY_HASH_SIZE SHA256_DIGEST_SIZE
#endif
#if !defined(PROOF_SIZE)
#define PROOF_SIZE CONTEXT_INTEGRITY_HASH_SIZE
#endif
#if !defined(NV_CLOCK_UPDATE_INTERVAL)
#define NV_CLOCK_UPDATE_INTERVAL 12
#endif
#if !defined(NUM_POLICY_PCR)
#define NUM_POLICY_PCR 1
#endif
#if !defined(MAX_COMMAND_SIZE)
#define MAX_COMMAND_SIZE 4096
#endif
#if !defined(MAX_RESPONSE_SIZE)
#define MAX_RESPONSE_SIZE 4096
#endif
#if !defined(ORDERLY_BITS)
#define ORDERLY_BITS 8
#endif
#if !defined(MAX_ORDERLY_COUNT)
#define MAX_ORDERLY_COUNT ((1 << ORDERLY_BITS) - 1)
#endif
#if !defined(ALG_ID_FIRST)
#define ALG_ID_FIRST TPM_ALG_FIRST
#endif
#if !defined(ALG_ID_LAST)
#define ALG_ID_LAST TPM_ALG_LAST
#endif
#if !defined(MAX_SYM_DATA)
#define MAX_SYM_DATA 128
#endif
#if !defined(MAX_RNG_ENTROPY_SIZE)
#define MAX_RNG_ENTROPY_SIZE 64
#endif
#if !defined(RAM_INDEX_SPACE)
#define RAM_INDEX_SPACE 512
#endif
#if !defined(RSA_DEFAULT_PUBLIC_EXPONENT)
#define RSA_DEFAULT_PUBLIC_EXPONENT 0x00010001
#endif
#if !defined(ENABLE_PCR_NO_INCREMENT)
#define ENABLE_PCR_NO_INCREMENT YES
#endif
#if !defined(CRT_FORMAT_RSA)
#define CRT_FORMAT_RSA YES
#endif
#if !defined(PRIVATE_VENDOR_SPECIFIC_BYTES)
#define PRIVATE_VENDOR_SPECIFIC_BYTES ((MAX_RSA_KEY_BYTES/2) * (3 + CRT_FORMAT_RSA * 2))
#endif
#if !defined(MAX_CAP_DATA)
#define MAX_CAP_DATA (MAX_CAP_BUFFER-sizeof(TPM_CAP)-sizeof(UINT32))
#endif
#if !defined(MAX_CAP_ALGS)
#define MAX_CAP_ALGS (TPM_ALG_LAST - TPM_ALG_FIRST + 1)
#endif
#if !defined(MAX_CAP_HANDLES)
#define MAX_CAP_HANDLES (MAX_CAP_DATA/sizeof(TPM_HANDLE))
#endif
#if !defined(MAX_CAP_CC)
#define MAX_CAP_CC ((TPM_CC_LAST - TPM_CC_FIRST) + 1)
#endif
#if !defined(MAX_TPM_PROPERTIES)
#define MAX_TPM_PROPERTIES (MAX_CAP_DATA/sizeof(TPMS_TAGGED_PROPERTY))
#endif
#if !defined(MAX_PCR_PROPERTIES)
#define MAX_PCR_PROPERTIES (MAX_CAP_DATA/sizeof(TPMS_TAGGED_PCR_SELECT))
#endif
#if !defined(MAX_ECC_CURVES)
#define MAX_ECC_CURVES (MAX_CAP_DATA/sizeof(TPM_ECC_CURVE))
#endif
#if !defined(HASH_COUNT)
#define HASH_COUNT 3
#endif
typedef uint8_t UINT8;
typedef uint8_t BYTE;
typedef int8_t INT8;
typedef int BOOL;
typedef uint16_t UINT16;
typedef int16_t INT16;
typedef uint32_t UINT32;
typedef int32_t INT32;
typedef uint64_t UINT64;
typedef int64_t INT64;
typedef UINT32 TPM_ALGORITHM_ID;
typedef UINT32 TPM_MODIFIER_INDICATOR;
typedef UINT32 TPM_AUTHORIZATION_SIZE;
typedef UINT32 TPM_PARAMETER_SIZE;
typedef UINT16 TPM_KEY_SIZE;
typedef UINT16 TPM_KEY_BITS;
typedef UINT32 TPM_HANDLE;
struct TPM2B_DIGEST;
typedef TPM2B_DIGEST TPM2B_NONCE;
typedef TPM2B_DIGEST TPM2B_AUTH;
typedef TPM2B_DIGEST TPM2B_OPERAND;
struct TPMS_SCHEME_SIGHASH;
typedef TPMS_SCHEME_SIGHASH TPMS_SCHEME_HMAC;
typedef TPMS_SCHEME_SIGHASH TPMS_SCHEME_RSASSA;
typedef TPMS_SCHEME_SIGHASH TPMS_SCHEME_RSAPSS;
typedef TPMS_SCHEME_SIGHASH TPMS_SCHEME_ECDSA;
typedef TPMS_SCHEME_SIGHASH TPMS_SCHEME_SM2;
typedef TPMS_SCHEME_SIGHASH TPMS_SCHEME_ECSCHNORR;
typedef BYTE TPMI_YES_NO;
typedef TPM_HANDLE TPMI_DH_OBJECT;
typedef TPM_HANDLE TPMI_DH_PERSISTENT;
typedef TPM_HANDLE TPMI_DH_ENTITY;
typedef TPM_HANDLE TPMI_DH_PCR;
typedef TPM_HANDLE TPMI_SH_AUTH_SESSION;
typedef TPM_HANDLE TPMI_SH_HMAC;
typedef TPM_HANDLE TPMI_SH_POLICY;
typedef TPM_HANDLE TPMI_DH_CONTEXT;
typedef TPM_HANDLE TPMI_RH_HIERARCHY;
typedef TPM_HANDLE TPMI_RH_ENABLES;
typedef TPM_HANDLE TPMI_RH_HIERARCHY_AUTH;
typedef TPM_HANDLE TPMI_RH_PLATFORM;
typedef TPM_HANDLE TPMI_RH_OWNER;
typedef TPM_HANDLE TPMI_RH_ENDORSEMENT;
typedef TPM_HANDLE TPMI_RH_PROVISION;
typedef TPM_HANDLE TPMI_RH_CLEAR;
typedef TPM_HANDLE TPMI_RH_NV_AUTH;
typedef TPM_HANDLE TPMI_RH_LOCKOUT;
typedef TPM_HANDLE TPMI_RH_NV_INDEX;
typedef UINT16 TPM_ALG_ID;
typedef TPM_ALG_ID TPMI_ALG_HASH;
typedef TPM_ALG_ID TPMI_ALG_ASYM;
typedef TPM_ALG_ID TPMI_ALG_SYM;
typedef TPM_ALG_ID TPMI_ALG_SYM_OBJECT;
typedef TPM_ALG_ID TPMI_ALG_SYM_MODE;
typedef TPM_ALG_ID TPMI_ALG_KDF;
typedef TPM_ALG_ID TPMI_ALG_SIG_SCHEME;
typedef TPM_ALG_ID TPMI_ECC_KEY_EXCHANGE;
typedef UINT16 TPM_ST;
typedef TPM_ST TPMI_ST_COMMAND_TAG;
typedef TPM_ST TPMI_ST_ATTEST;
typedef TPM_KEY_BITS TPMI_AES_KEY_BITS;
typedef TPM_KEY_BITS TPMI_SM4_KEY_BITS;
typedef TPM_ALG_ID TPMI_ALG_KEYEDHASH_SCHEME;
typedef TPM_ALG_ID TPMI_ALG_ASYM_SCHEME;
typedef TPM_ALG_ID TPMI_ALG_RSA_SCHEME;
typedef TPM_ALG_ID TPMI_ALG_RSA_DECRYPT;
typedef TPM_KEY_BITS TPMI_RSA_KEY_BITS;
typedef TPM_ALG_ID TPMI_ALG_ECC_SCHEME;
typedef UINT16 TPM_ECC_CURVE;
typedef TPM_ECC_CURVE TPMI_ECC_CURVE;
typedef TPM_ALG_ID TPMI_ALG_PUBLIC;
typedef UINT32 TPMA_ALGORITHM;
typedef UINT32 TPMA_OBJECT;
typedef UINT8 TPMA_SESSION;
typedef UINT8 TPMA_LOCALITY;
typedef UINT32 TPMA_PERMANENT;
typedef UINT32 TPMA_STARTUP_CLEAR;
typedef UINT32 TPMA_MEMORY;
typedef UINT32 TPM_CC;
typedef TPM_CC TPMA_CC;
typedef UINT32 TPM_NV_INDEX;
typedef UINT32 TPMA_NV;
typedef UINT32 TPM_SPEC;
typedef UINT32 TPM_GENERATED;
typedef UINT32 TPM_RC;
typedef INT8 TPM_CLOCK_ADJUST;
typedef UINT16 TPM_EO;
typedef UINT16 TPM_SU;
typedef UINT8 TPM_SE;
typedef UINT32 TPM_CAP;
typedef UINT32 TPM_PT;
typedef UINT32 TPM_PT_PCR;
typedef UINT32 TPM_PS;
typedef UINT8 TPM_HT;
typedef UINT32 TPM_RH;
typedef TPM_HANDLE TPM_HC;
const TPM_SPEC TPM_SPEC_FAMILY = 0x322E3000;
const TPM_SPEC TPM_SPEC_LEVEL = 00;
const TPM_SPEC TPM_SPEC_VERSION = 99;
const TPM_SPEC TPM_SPEC_YEAR = 2013;
const TPM_SPEC TPM_SPEC_DAY_OF_YEAR = 304;
const TPM_GENERATED TPM_GENERATED_VALUE = 0xff544347;
const TPM_ALG_ID TPM_ALG_ERROR = 0x0000;
const TPM_ALG_ID TPM_ALG_FIRST = 0x0001;
const TPM_ALG_ID TPM_ALG_RSA = 0x0001;
const TPM_ALG_ID TPM_ALG_SHA = 0x0004;
const TPM_ALG_ID TPM_ALG_SHA1 = 0x0004;
const TPM_ALG_ID TPM_ALG_HMAC = 0x0005;
const TPM_ALG_ID TPM_ALG_AES = 0x0006;
const TPM_ALG_ID TPM_ALG_MGF1 = 0x0007;
const TPM_ALG_ID TPM_ALG_KEYEDHASH = 0x0008;
const TPM_ALG_ID TPM_ALG_XOR = 0x000A;
const TPM_ALG_ID TPM_ALG_SHA256 = 0x000B;
const TPM_ALG_ID TPM_ALG_SHA384 = 0x000C;
const TPM_ALG_ID TPM_ALG_SHA512 = 0x000D;
const TPM_ALG_ID TPM_ALG_NULL = 0x0010;
const TPM_ALG_ID TPM_ALG_SM3_256 = 0x0012;
const TPM_ALG_ID TPM_ALG_SM4 = 0x0013;
const TPM_ALG_ID TPM_ALG_RSASSA = 0x0014;
const TPM_ALG_ID TPM_ALG_RSAES = 0x0015;
const TPM_ALG_ID TPM_ALG_RSAPSS = 0x0016;
const TPM_ALG_ID TPM_ALG_OAEP = 0x0017;
const TPM_ALG_ID TPM_ALG_ECDSA = 0x0018;
const TPM_ALG_ID TPM_ALG_ECDH = 0x0019;
const TPM_ALG_ID TPM_ALG_ECDAA = 0x001A;
const TPM_ALG_ID TPM_ALG_SM2 = 0x001B;
const TPM_ALG_ID TPM_ALG_ECSCHNORR = 0x001C;
const TPM_ALG_ID TPM_ALG_ECMQV = 0x001D;
const TPM_ALG_ID TPM_ALG_KDF1_SP800_56a = 0x0020;
const TPM_ALG_ID TPM_ALG_KDF2 = 0x0021;
const TPM_ALG_ID TPM_ALG_KDF1_SP800_108 = 0x0022;
const TPM_ALG_ID TPM_ALG_ECC = 0x0023;
const TPM_ALG_ID TPM_ALG_SYMCIPHER = 0x0025;
const TPM_ALG_ID TPM_ALG_CTR = 0x0040;
const TPM_ALG_ID TPM_ALG_OFB = 0x0041;
const TPM_ALG_ID TPM_ALG_CBC = 0x0042;
const TPM_ALG_ID TPM_ALG_CFB = 0x0043;
const TPM_ALG_ID TPM_ALG_ECB = 0x0044;
const TPM_ALG_ID TPM_ALG_LAST = 0x0044;
const TPM_ECC_CURVE TPM_ECC_NONE = 0x0000;
const TPM_ECC_CURVE TPM_ECC_NIST_P192 = 0x0001;
const TPM_ECC_CURVE TPM_ECC_NIST_P224 = 0x0002;
const TPM_ECC_CURVE TPM_ECC_NIST_P256 = 0x0003;
const TPM_ECC_CURVE TPM_ECC_NIST_P384 = 0x0004;
const TPM_ECC_CURVE TPM_ECC_NIST_P521 = 0x0005;
const TPM_ECC_CURVE TPM_ECC_BN_P256 = 0x0010;
const TPM_ECC_CURVE TPM_ECC_BN_P638 = 0x0011;
const TPM_ECC_CURVE TPM_ECC_SM2_P256 = 0x0020;
const TPM_CC TPM_CC_FIRST = 0x0000011F;
const TPM_CC TPM_CC_PP_FIRST = 0x0000011F;
const TPM_CC TPM_CC_NV_UndefineSpaceSpecial = 0x0000011F;
const TPM_CC TPM_CC_EvictControl = 0x00000120;
const TPM_CC TPM_CC_HierarchyControl = 0x00000121;
const TPM_CC TPM_CC_NV_UndefineSpace = 0x00000122;
const TPM_CC TPM_CC_ChangeEPS = 0x00000124;
const TPM_CC TPM_CC_ChangePPS = 0x00000125;
const TPM_CC TPM_CC_Clear = 0x00000126;
const TPM_CC TPM_CC_ClearControl = 0x00000127;
const TPM_CC TPM_CC_ClockSet = 0x00000128;
const TPM_CC TPM_CC_HierarchyChangeAuth = 0x00000129;
const TPM_CC TPM_CC_NV_DefineSpace = 0x0000012A;
const TPM_CC TPM_CC_PCR_Allocate = 0x0000012B;
const TPM_CC TPM_CC_PCR_SetAuthPolicy = 0x0000012C;
const TPM_CC TPM_CC_PP_Commands = 0x0000012D;
const TPM_CC TPM_CC_SetPrimaryPolicy = 0x0000012E;
const TPM_CC TPM_CC_FieldUpgradeStart = 0x0000012F;
const TPM_CC TPM_CC_ClockRateAdjust = 0x00000130;
const TPM_CC TPM_CC_CreatePrimary = 0x00000131;
const TPM_CC TPM_CC_NV_GlobalWriteLock = 0x00000132;
const TPM_CC TPM_CC_PP_LAST = 0x00000132;
const TPM_CC TPM_CC_GetCommandAuditDigest = 0x00000133;
const TPM_CC TPM_CC_NV_Increment = 0x00000134;
const TPM_CC TPM_CC_NV_SetBits = 0x00000135;
const TPM_CC TPM_CC_NV_Extend = 0x00000136;
const TPM_CC TPM_CC_NV_Write = 0x00000137;
const TPM_CC TPM_CC_NV_WriteLock = 0x00000138;
const TPM_CC TPM_CC_DictionaryAttackLockReset = 0x00000139;
const TPM_CC TPM_CC_DictionaryAttackParameters = 0x0000013A;
const TPM_CC TPM_CC_NV_ChangeAuth = 0x0000013B;
const TPM_CC TPM_CC_PCR_Event = 0x0000013C;
const TPM_CC TPM_CC_PCR_Reset = 0x0000013D;
const TPM_CC TPM_CC_SequenceComplete = 0x0000013E;
const TPM_CC TPM_CC_SetAlgorithmSet = 0x0000013F;
const TPM_CC TPM_CC_SetCommandCodeAuditStatus = 0x00000140;
const TPM_CC TPM_CC_FieldUpgradeData = 0x00000141;
const TPM_CC TPM_CC_IncrementalSelfTest = 0x00000142;
const TPM_CC TPM_CC_SelfTest = 0x00000143;
const TPM_CC TPM_CC_Startup = 0x00000144;
const TPM_CC TPM_CC_Shutdown = 0x00000145;
const TPM_CC TPM_CC_StirRandom = 0x00000146;
const TPM_CC TPM_CC_ActivateCredential = 0x00000147;
const TPM_CC TPM_CC_Certify = 0x00000148;
const TPM_CC TPM_CC_PolicyNV = 0x00000149;
const TPM_CC TPM_CC_CertifyCreation = 0x0000014A;
const TPM_CC TPM_CC_Duplicate = 0x0000014B;
const TPM_CC TPM_CC_GetTime = 0x0000014C;
const TPM_CC TPM_CC_GetSessionAuditDigest = 0x0000014D;
const TPM_CC TPM_CC_NV_Read = 0x0000014E;
const TPM_CC TPM_CC_NV_ReadLock = 0x0000014F;
const TPM_CC TPM_CC_ObjectChangeAuth = 0x00000150;
const TPM_CC TPM_CC_PolicySecret = 0x00000151;
const TPM_CC TPM_CC_Rewrap = 0x00000152;
const TPM_CC TPM_CC_Create = 0x00000153;
const TPM_CC TPM_CC_ECDH_ZGen = 0x00000154;
const TPM_CC TPM_CC_HMAC = 0x00000155;
const TPM_CC TPM_CC_Import = 0x00000156;
const TPM_CC TPM_CC_Load = 0x00000157;
const TPM_CC TPM_CC_Quote = 0x00000158;
const TPM_CC TPM_CC_RSA_Decrypt = 0x00000159;
const TPM_CC TPM_CC_HMAC_Start = 0x0000015B;
const TPM_CC TPM_CC_SequenceUpdate = 0x0000015C;
const TPM_CC TPM_CC_Sign = 0x0000015D;
const TPM_CC TPM_CC_Unseal = 0x0000015E;
const TPM_CC TPM_CC_PolicySigned = 0x00000160;
const TPM_CC TPM_CC_ContextLoad = 0x00000161;
const TPM_CC TPM_CC_ContextSave = 0x00000162;
const TPM_CC TPM_CC_ECDH_KeyGen = 0x00000163;
const TPM_CC TPM_CC_EncryptDecrypt = 0x00000164;
const TPM_CC TPM_CC_FlushContext = 0x00000165;
const TPM_CC TPM_CC_LoadExternal = 0x00000167;
const TPM_CC TPM_CC_MakeCredential = 0x00000168;
const TPM_CC TPM_CC_NV_ReadPublic = 0x00000169;
const TPM_CC TPM_CC_PolicyAuthorize = 0x0000016A;
const TPM_CC TPM_CC_PolicyAuthValue = 0x0000016B;
const TPM_CC TPM_CC_PolicyCommandCode = 0x0000016C;
const TPM_CC TPM_CC_PolicyCounterTimer = 0x0000016D;
const TPM_CC TPM_CC_PolicyCpHash = 0x0000016E;
const TPM_CC TPM_CC_PolicyLocality = 0x0000016F;
const TPM_CC TPM_CC_PolicyNameHash = 0x00000170;
const TPM_CC TPM_CC_PolicyOR = 0x00000171;
const TPM_CC TPM_CC_PolicyTicket = 0x00000172;
const TPM_CC TPM_CC_ReadPublic = 0x00000173;
const TPM_CC TPM_CC_RSA_Encrypt = 0x00000174;
const TPM_CC TPM_CC_StartAuthSession = 0x00000176;
const TPM_CC TPM_CC_VerifySignature = 0x00000177;
const TPM_CC TPM_CC_ECC_Parameters = 0x00000178;
const TPM_CC TPM_CC_FirmwareRead = 0x00000179;
const TPM_CC TPM_CC_GetCapability = 0x0000017A;
const TPM_CC TPM_CC_GetRandom = 0x0000017B;
const TPM_CC TPM_CC_GetTestResult = 0x0000017C;
const TPM_CC TPM_CC_Hash = 0x0000017D;
const TPM_CC TPM_CC_PCR_Read = 0x0000017E;
const TPM_CC TPM_CC_PolicyPCR = 0x0000017F;
const TPM_CC TPM_CC_PolicyRestart = 0x00000180;
const TPM_CC TPM_CC_ReadClock = 0x00000181;
const TPM_CC TPM_CC_PCR_Extend = 0x00000182;
const TPM_CC TPM_CC_PCR_SetAuthValue = 0x00000183;
const TPM_CC TPM_CC_NV_Certify = 0x00000184;
const TPM_CC TPM_CC_EventSequenceComplete = 0x00000185;
const TPM_CC TPM_CC_HashSequenceStart = 0x00000186;
const TPM_CC TPM_CC_PolicyPhysicalPresence = 0x00000187;
const TPM_CC TPM_CC_PolicyDuplicationSelect = 0x00000188;
const TPM_CC TPM_CC_PolicyGetDigest = 0x00000189;
const TPM_CC TPM_CC_TestParms = 0x0000018A;
const TPM_CC TPM_CC_Commit = 0x0000018B;
const TPM_CC TPM_CC_PolicyPassword = 0x0000018C;
const TPM_CC TPM_CC_ZGen_2Phase = 0x0000018D;
const TPM_CC TPM_CC_EC_Ephemeral = 0x0000018E;
const TPM_CC TPM_CC_PolicyNvWritten = 0x0000018F;
const TPM_CC TPM_CC_LAST = 0x0000018F;
const TPM_RC TPM_RC_SUCCESS = 0x000;
const TPM_RC TPM_RC_BAD_TAG = 0x01E;
const TPM_RC RC_VER1 = 0x100;
const TPM_RC TPM_RC_INITIALIZE = RC_VER1 + 0x000;
const TPM_RC TPM_RC_FAILURE = RC_VER1 + 0x001;
const TPM_RC TPM_RC_SEQUENCE = RC_VER1 + 0x003;
const TPM_RC TPM_RC_PRIVATE = RC_VER1 + 0x00B;
const TPM_RC TPM_RC_HMAC = RC_VER1 + 0x019;
const TPM_RC TPM_RC_DISABLED = RC_VER1 + 0x020;
const TPM_RC TPM_RC_EXCLUSIVE = RC_VER1 + 0x021;
const TPM_RC TPM_RC_AUTH_TYPE = RC_VER1 + 0x024;
const TPM_RC TPM_RC_AUTH_MISSING = RC_VER1 + 0x025;
const TPM_RC TPM_RC_POLICY = RC_VER1 + 0x026;
const TPM_RC TPM_RC_PCR = RC_VER1 + 0x027;
const TPM_RC TPM_RC_PCR_CHANGED = RC_VER1 + 0x028;
const TPM_RC TPM_RC_UPGRADE = RC_VER1 + 0x02D;
const TPM_RC TPM_RC_TOO_MANY_CONTEXTS = RC_VER1 + 0x02E;
const TPM_RC TPM_RC_AUTH_UNAVAILABLE = RC_VER1 + 0x02F;
const TPM_RC TPM_RC_REBOOT = RC_VER1 + 0x030;
const TPM_RC TPM_RC_UNBALANCED = RC_VER1 + 0x031;
const TPM_RC TPM_RC_COMMAND_SIZE = RC_VER1 + 0x042;
const TPM_RC TPM_RC_COMMAND_CODE = RC_VER1 + 0x043;
const TPM_RC TPM_RC_AUTHSIZE = RC_VER1 + 0x044;
const TPM_RC TPM_RC_AUTH_CONTEXT = RC_VER1 + 0x045;
const TPM_RC TPM_RC_NV_RANGE = RC_VER1 + 0x046;
const TPM_RC TPM_RC_NV_SIZE = RC_VER1 + 0x047;
const TPM_RC TPM_RC_NV_LOCKED = RC_VER1 + 0x048;
const TPM_RC TPM_RC_NV_AUTHORIZATION = RC_VER1 + 0x049;
const TPM_RC TPM_RC_NV_UNINITIALIZED = RC_VER1 + 0x04A;
const TPM_RC TPM_RC_NV_SPACE = RC_VER1 + 0x04B;
const TPM_RC TPM_RC_NV_DEFINED = RC_VER1 + 0x04C;
const TPM_RC TPM_RC_BAD_CONTEXT = RC_VER1 + 0x050;
const TPM_RC TPM_RC_CPHASH = RC_VER1 + 0x051;
const TPM_RC TPM_RC_PARENT = RC_VER1 + 0x052;
const TPM_RC TPM_RC_NEEDS_TEST = RC_VER1 + 0x053;
const TPM_RC TPM_RC_NO_RESULT = RC_VER1 + 0x054;
const TPM_RC TPM_RC_SENSITIVE = RC_VER1 + 0x055;
const TPM_RC RC_MAX_FM0 = RC_VER1 + 0x07F;
const TPM_RC RC_FMT1 = 0x080;
const TPM_RC TPM_RC_ASYMMETRIC = RC_FMT1 + 0x001;
const TPM_RC TPM_RC_ATTRIBUTES = RC_FMT1 + 0x002;
const TPM_RC TPM_RC_HASH = RC_FMT1 + 0x003;
const TPM_RC TPM_RC_VALUE = RC_FMT1 + 0x004;
const TPM_RC TPM_RC_HIERARCHY = RC_FMT1 + 0x005;
const TPM_RC TPM_RC_KEY_SIZE = RC_FMT1 + 0x007;
const TPM_RC TPM_RC_MGF = RC_FMT1 + 0x008;
const TPM_RC TPM_RC_MODE = RC_FMT1 + 0x009;
const TPM_RC TPM_RC_TYPE = RC_FMT1 + 0x00A;
const TPM_RC TPM_RC_HANDLE = RC_FMT1 + 0x00B;
const TPM_RC TPM_RC_KDF = RC_FMT1 + 0x00C;
const TPM_RC TPM_RC_RANGE = RC_FMT1 + 0x00D;
const TPM_RC TPM_RC_AUTH_FAIL = RC_FMT1 + 0x00E;
const TPM_RC TPM_RC_NONCE = RC_FMT1 + 0x00F;
const TPM_RC TPM_RC_PP = RC_FMT1 + 0x010;
const TPM_RC TPM_RC_SCHEME = RC_FMT1 + 0x012;
const TPM_RC TPM_RC_SIZE = RC_FMT1 + 0x015;
const TPM_RC TPM_RC_SYMMETRIC = RC_FMT1 + 0x016;
const TPM_RC TPM_RC_TAG = RC_FMT1 + 0x017;
const TPM_RC TPM_RC_SELECTOR = RC_FMT1 + 0x018;
const TPM_RC TPM_RC_INSUFFICIENT = RC_FMT1 + 0x01A;
const TPM_RC TPM_RC_SIGNATURE = RC_FMT1 + 0x01B;
const TPM_RC TPM_RC_KEY = RC_FMT1 + 0x01C;
const TPM_RC TPM_RC_POLICY_FAIL = RC_FMT1 + 0x01D;
const TPM_RC TPM_RC_INTEGRITY = RC_FMT1 + 0x01F;
const TPM_RC TPM_RC_TICKET = RC_FMT1 + 0x020;
const TPM_RC TPM_RC_RESERVED_BITS = RC_FMT1 + 0x021;
const TPM_RC TPM_RC_BAD_AUTH = RC_FMT1 + 0x022;
const TPM_RC TPM_RC_EXPIRED = RC_FMT1 + 0x023;
const TPM_RC TPM_RC_POLICY_CC = RC_FMT1 + 0x024;
const TPM_RC TPM_RC_BINDING = RC_FMT1 + 0x025;
const TPM_RC TPM_RC_CURVE = RC_FMT1 + 0x026;
const TPM_RC TPM_RC_ECC_POINT = RC_FMT1 + 0x027;
const TPM_RC RC_WARN = 0x900;
const TPM_RC TPM_RC_CONTEXT_GAP = RC_WARN + 0x001;
const TPM_RC TPM_RC_OBJECT_MEMORY = RC_WARN + 0x002;
const TPM_RC TPM_RC_SESSION_MEMORY = RC_WARN + 0x003;
const TPM_RC TPM_RC_MEMORY = RC_WARN + 0x004;
const TPM_RC TPM_RC_SESSION_HANDLES = RC_WARN + 0x005;
const TPM_RC TPM_RC_OBJECT_HANDLES = RC_WARN + 0x006;
const TPM_RC TPM_RC_LOCALITY = RC_WARN + 0x007;
const TPM_RC TPM_RC_YIELDED = RC_WARN + 0x008;
const TPM_RC TPM_RC_CANCELED = RC_WARN + 0x009;
const TPM_RC TPM_RC_TESTING = RC_WARN + 0x00A;
const TPM_RC TPM_RC_REFERENCE_H0 = RC_WARN + 0x010;
const TPM_RC TPM_RC_REFERENCE_H1 = RC_WARN + 0x011;
const TPM_RC TPM_RC_REFERENCE_H2 = RC_WARN + 0x012;
const TPM_RC TPM_RC_REFERENCE_H3 = RC_WARN + 0x013;
const TPM_RC TPM_RC_REFERENCE_H4 = RC_WARN + 0x014;
const TPM_RC TPM_RC_REFERENCE_H5 = RC_WARN + 0x015;
const TPM_RC TPM_RC_REFERENCE_H6 = RC_WARN + 0x016;
const TPM_RC TPM_RC_REFERENCE_S0 = RC_WARN + 0x018;
const TPM_RC TPM_RC_REFERENCE_S1 = RC_WARN + 0x019;
const TPM_RC TPM_RC_REFERENCE_S2 = RC_WARN + 0x01A;
const TPM_RC TPM_RC_REFERENCE_S3 = RC_WARN + 0x01B;
const TPM_RC TPM_RC_REFERENCE_S4 = RC_WARN + 0x01C;
const TPM_RC TPM_RC_REFERENCE_S5 = RC_WARN + 0x01D;
const TPM_RC TPM_RC_REFERENCE_S6 = RC_WARN + 0x01E;
const TPM_RC TPM_RC_NV_RATE = RC_WARN + 0x020;
const TPM_RC TPM_RC_LOCKOUT = RC_WARN + 0x021;
const TPM_RC TPM_RC_RETRY = RC_WARN + 0x022;
const TPM_RC TPM_RC_NV_UNAVAILABLE = RC_WARN + 0x023;
const TPM_RC TPM_RC_NOT_USED = RC_WARN + 0x7F;
const TPM_RC TPM_RC_H = 0x000;
const TPM_RC TPM_RC_P = 0x040;
const TPM_RC TPM_RC_S = 0x800;
const TPM_RC TPM_RC_1 = 0x100;
const TPM_RC TPM_RC_2 = 0x200;
const TPM_RC TPM_RC_3 = 0x300;
const TPM_RC TPM_RC_4 = 0x400;
const TPM_RC TPM_RC_5 = 0x500;
const TPM_RC TPM_RC_6 = 0x600;
const TPM_RC TPM_RC_7 = 0x700;
const TPM_RC TPM_RC_8 = 0x800;
const TPM_RC TPM_RC_9 = 0x900;
const TPM_RC TPM_RC_A = 0xA00;
const TPM_RC TPM_RC_B = 0xB00;
const TPM_RC TPM_RC_C = 0xC00;
const TPM_RC TPM_RC_D = 0xD00;
const TPM_RC TPM_RC_E = 0xE00;
const TPM_RC TPM_RC_F = 0xF00;
const TPM_RC TPM_RC_N_MASK = 0xF00;
const TPM_CLOCK_ADJUST TPM_CLOCK_COARSE_SLOWER = -3;
const TPM_CLOCK_ADJUST TPM_CLOCK_MEDIUM_SLOWER = -2;
const TPM_CLOCK_ADJUST TPM_CLOCK_FINE_SLOWER = -1;
const TPM_CLOCK_ADJUST TPM_CLOCK_NO_CHANGE = 0;
const TPM_CLOCK_ADJUST TPM_CLOCK_FINE_FASTER = 1;
const TPM_CLOCK_ADJUST TPM_CLOCK_MEDIUM_FASTER = 2;
const TPM_CLOCK_ADJUST TPM_CLOCK_COARSE_FASTER = 3;
const TPM_EO TPM_EO_EQ = 0x0000;
const TPM_EO TPM_EO_NEQ = 0x0001;
const TPM_EO TPM_EO_SIGNED_GT = 0x0002;
const TPM_EO TPM_EO_UNSIGNED_GT = 0x0003;
const TPM_EO TPM_EO_SIGNED_LT = 0x0004;
const TPM_EO TPM_EO_UNSIGNED_LT = 0x0005;
const TPM_EO TPM_EO_SIGNED_GE = 0x0006;
const TPM_EO TPM_EO_UNSIGNED_GE = 0x0007;
const TPM_EO TPM_EO_SIGNED_LE = 0x0008;
const TPM_EO TPM_EO_UNSIGNED_LE = 0x0009;
const TPM_EO TPM_EO_BITSET = 0x000A;
const TPM_EO TPM_EO_BITCLEAR = 0x000B;
const TPM_ST TPM_ST_RSP_COMMAND = 0x00C4;
const TPM_ST TPM_ST_NULL = 0X8000;
const TPM_ST TPM_ST_NO_SESSIONS = 0x8001;
const TPM_ST TPM_ST_SESSIONS = 0x8002;
const TPM_ST TPM_ST_ATTEST_NV = 0x8014;
const TPM_ST TPM_ST_ATTEST_COMMAND_AUDIT = 0x8015;
const TPM_ST TPM_ST_ATTEST_SESSION_AUDIT = 0x8016;
const TPM_ST TPM_ST_ATTEST_CERTIFY = 0x8017;
const TPM_ST TPM_ST_ATTEST_QUOTE = 0x8018;
const TPM_ST TPM_ST_ATTEST_TIME = 0x8019;
const TPM_ST TPM_ST_ATTEST_CREATION = 0x801A;
const TPM_ST TPM_ST_CREATION = 0x8021;
const TPM_ST TPM_ST_VERIFIED = 0x8022;
const TPM_ST TPM_ST_AUTH_SECRET = 0x8023;
const TPM_ST TPM_ST_HASHCHECK = 0x8024;
const TPM_ST TPM_ST_AUTH_SIGNED = 0x8025;
const TPM_ST TPM_ST_FU_MANIFEST = 0x8029;
const TPM_SU TPM_SU_CLEAR = 0x0000;
const TPM_SU TPM_SU_STATE = 0x0001;
const TPM_SE TPM_SE_HMAC = 0x00;
const TPM_SE TPM_SE_POLICY = 0x01;
const TPM_SE TPM_SE_TRIAL = 0x03;
const TPM_CAP TPM_CAP_FIRST = 0x00000000;
const TPM_CAP TPM_CAP_ALGS = 0x00000000;
const TPM_CAP TPM_CAP_HANDLES = 0x00000001;
const TPM_CAP TPM_CAP_COMMANDS = 0x00000002;
const TPM_CAP TPM_CAP_PP_COMMANDS = 0x00000003;
const TPM_CAP TPM_CAP_AUDIT_COMMANDS = 0x00000004;
const TPM_CAP TPM_CAP_PCRS = 0x00000005;
const TPM_CAP TPM_CAP_TPM_PROPERTIES = 0x00000006;
const TPM_CAP TPM_CAP_PCR_PROPERTIES = 0x00000007;
const TPM_CAP TPM_CAP_ECC_CURVES = 0x00000008;
const TPM_CAP TPM_CAP_LAST = 0x00000008;
const TPM_CAP TPM_CAP_VENDOR_PROPERTY = 0x00000100;
const TPM_PT TPM_PT_NONE = 0x00000000;
const TPM_PT PT_GROUP = 0x00000100;
const TPM_PT PT_FIXED = PT_GROUP * 1;
const TPM_PT TPM_PT_FAMILY_INDICATOR = PT_FIXED + 0;
const TPM_PT TPM_PT_LEVEL = PT_FIXED + 1;
const TPM_PT TPM_PT_REVISION = PT_FIXED + 2;
const TPM_PT TPM_PT_DAY_OF_YEAR = PT_FIXED + 3;
const TPM_PT TPM_PT_YEAR = PT_FIXED + 4;
const TPM_PT TPM_PT_MANUFACTURER = PT_FIXED + 5;
const TPM_PT TPM_PT_VENDOR_STRING_1 = PT_FIXED + 6;
const TPM_PT TPM_PT_VENDOR_STRING_2 = PT_FIXED + 7;
const TPM_PT TPM_PT_VENDOR_STRING_3 = PT_FIXED + 8;
const TPM_PT TPM_PT_VENDOR_STRING_4 = PT_FIXED + 9;
const TPM_PT TPM_PT_VENDOR_TPM_TYPE = PT_FIXED + 10;
const TPM_PT TPM_PT_FIRMWARE_VERSION_1 = PT_FIXED + 11;
const TPM_PT TPM_PT_FIRMWARE_VERSION_2 = PT_FIXED + 12;
const TPM_PT TPM_PT_INPUT_BUFFER = PT_FIXED + 13;
const TPM_PT TPM_PT_HR_TRANSIENT_MIN = PT_FIXED + 14;
const TPM_PT TPM_PT_HR_PERSISTENT_MIN = PT_FIXED + 15;
const TPM_PT TPM_PT_HR_LOADED_MIN = PT_FIXED + 16;
const TPM_PT TPM_PT_ACTIVE_SESSIONS_MAX = PT_FIXED + 17;
const TPM_PT TPM_PT_PCR_COUNT = PT_FIXED + 18;
const TPM_PT TPM_PT_PCR_SELECT_MIN = PT_FIXED + 19;
const TPM_PT TPM_PT_CONTEXT_GAP_MAX = PT_FIXED + 20;
const TPM_PT TPM_PT_NV_COUNTERS_MAX = PT_FIXED + 22;
const TPM_PT TPM_PT_NV_INDEX_MAX = PT_FIXED + 23;
const TPM_PT TPM_PT_MEMORY = PT_FIXED + 24;
const TPM_PT TPM_PT_CLOCK_UPDATE = PT_FIXED + 25;
const TPM_PT TPM_PT_CONTEXT_HASH = PT_FIXED + 26;
const TPM_PT TPM_PT_CONTEXT_SYM = PT_FIXED + 27;
const TPM_PT TPM_PT_CONTEXT_SYM_SIZE = PT_FIXED + 28;
const TPM_PT TPM_PT_ORDERLY_COUNT = PT_FIXED + 29;
const TPM_PT TPM_PT_MAX_COMMAND_SIZE = PT_FIXED + 30;
const TPM_PT TPM_PT_MAX_RESPONSE_SIZE = PT_FIXED + 31;
const TPM_PT TPM_PT_MAX_DIGEST = PT_FIXED + 32;
const TPM_PT TPM_PT_MAX_OBJECT_CONTEXT = PT_FIXED + 33;
const TPM_PT TPM_PT_MAX_SESSION_CONTEXT = PT_FIXED + 34;
const TPM_PT TPM_PT_PS_FAMILY_INDICATOR = PT_FIXED + 35;
const TPM_PT TPM_PT_PS_LEVEL = PT_FIXED + 36;
const TPM_PT TPM_PT_PS_REVISION = PT_FIXED + 37;
const TPM_PT TPM_PT_PS_DAY_OF_YEAR = PT_FIXED + 38;
const TPM_PT TPM_PT_PS_YEAR = PT_FIXED + 39;
const TPM_PT TPM_PT_SPLIT_MAX = PT_FIXED + 40;
const TPM_PT TPM_PT_TOTAL_COMMANDS = PT_FIXED + 41;
const TPM_PT TPM_PT_LIBRARY_COMMANDS = PT_FIXED + 42;
const TPM_PT TPM_PT_VENDOR_COMMANDS = PT_FIXED + 43;
const TPM_PT TPM_PT_NV_BUFFER_MAX = PT_FIXED + 44;
const TPM_PT PT_VAR = PT_GROUP * 2;
const TPM_PT TPM_PT_PERMANENT = PT_VAR + 0;
const TPM_PT TPM_PT_STARTUP_CLEAR = PT_VAR + 1;
const TPM_PT TPM_PT_HR_NV_INDEX = PT_VAR + 2;
const TPM_PT TPM_PT_HR_LOADED = PT_VAR + 3;
const TPM_PT TPM_PT_HR_LOADED_AVAIL = PT_VAR + 4;
const TPM_PT TPM_PT_HR_ACTIVE = PT_VAR + 5;
const TPM_PT TPM_PT_HR_ACTIVE_AVAIL = PT_VAR + 6;
const TPM_PT TPM_PT_HR_TRANSIENT_AVAIL = PT_VAR + 7;
const TPM_PT TPM_PT_HR_PERSISTENT = PT_VAR + 8;
const TPM_PT TPM_PT_HR_PERSISTENT_AVAIL = PT_VAR + 9;
const TPM_PT TPM_PT_NV_COUNTERS = PT_VAR + 10;
const TPM_PT TPM_PT_NV_COUNTERS_AVAIL = PT_VAR + 11;
const TPM_PT TPM_PT_ALGORITHM_SET = PT_VAR + 12;
const TPM_PT TPM_PT_LOADED_CURVES = PT_VAR + 13;
const TPM_PT TPM_PT_LOCKOUT_COUNTER = PT_VAR + 14;
const TPM_PT TPM_PT_MAX_AUTH_FAIL = PT_VAR + 15;
const TPM_PT TPM_PT_LOCKOUT_INTERVAL = PT_VAR + 16;
const TPM_PT TPM_PT_LOCKOUT_RECOVERY = PT_VAR + 17;
const TPM_PT TPM_PT_NV_WRITE_RECOVERY = PT_VAR + 18;
const TPM_PT TPM_PT_AUDIT_COUNTER_0 = PT_VAR + 19;
const TPM_PT TPM_PT_AUDIT_COUNTER_1 = PT_VAR + 20;
const TPM_PT_PCR TPM_PT_PCR_FIRST = 0x00000000;
const TPM_PT_PCR TPM_PT_PCR_SAVE = 0x00000000;
const TPM_PT_PCR TPM_PT_PCR_EXTEND_L0 = 0x00000001;
const TPM_PT_PCR TPM_PT_PCR_RESET_L0 = 0x00000002;
const TPM_PT_PCR TPM_PT_PCR_EXTEND_L1 = 0x00000003;
const TPM_PT_PCR TPM_PT_PCR_RESET_L1 = 0x00000004;
const TPM_PT_PCR TPM_PT_PCR_EXTEND_L2 = 0x00000005;
const TPM_PT_PCR TPM_PT_PCR_RESET_L2 = 0x00000006;
const TPM_PT_PCR TPM_PT_PCR_EXTEND_L3 = 0x00000007;
const TPM_PT_PCR TPM_PT_PCR_RESET_L3 = 0x00000008;
const TPM_PT_PCR TPM_PT_PCR_EXTEND_L4 = 0x00000009;
const TPM_PT_PCR TPM_PT_PCR_RESET_L4 = 0x0000000A;
const TPM_PT_PCR TPM_PT_PCR_NO_INCREMENT = 0x00000011;
const TPM_PT_PCR TPM_PT_PCR_DRTM_RESET = 0x00000012;
const TPM_PT_PCR TPM_PT_PCR_POLICY = 0x00000013;
const TPM_PT_PCR TPM_PT_PCR_AUTH = 0x00000014;
const TPM_PT_PCR TPM_PT_PCR_LAST = 0x00000014;
const TPM_PS TPM_PS_MAIN = 0x00000000;
const TPM_PS TPM_PS_PC = 0x00000001;
const TPM_PS TPM_PS_PDA = 0x00000002;
const TPM_PS TPM_PS_CELL_PHONE = 0x00000003;
const TPM_PS TPM_PS_SERVER = 0x00000004;
const TPM_PS TPM_PS_PERIPHERAL = 0x00000005;
const TPM_PS TPM_PS_TSS = 0x00000006;
const TPM_PS TPM_PS_STORAGE = 0x00000007;
const TPM_PS TPM_PS_AUTHENTICATION = 0x00000008;
const TPM_PS TPM_PS_EMBEDDED = 0x00000009;
const TPM_PS TPM_PS_HARDCOPY = 0x0000000A;
const TPM_PS TPM_PS_INFRASTRUCTURE = 0x0000000B;
const TPM_PS TPM_PS_VIRTUALIZATION = 0x0000000C;
const TPM_PS TPM_PS_TNC = 0x0000000D;
const TPM_PS TPM_PS_MULTI_TENANT = 0x0000000E;
const TPM_PS TPM_PS_TC = 0x0000000F;
const TPM_HT TPM_HT_PCR = 0x00;
const TPM_HT TPM_HT_NV_INDEX = 0x01;
const TPM_HT TPM_HT_HMAC_SESSION = 0x02;
const TPM_HT TPM_HT_LOADED_SESSION = 0x02;
const TPM_HT TPM_HT_POLICY_SESSION = 0x03;
const TPM_HT TPM_HT_ACTIVE_SESSION = 0x03;
const TPM_HT TPM_HT_PERMANENT = 0x40;
const TPM_HT TPM_HT_TRANSIENT = 0x80;
const TPM_HT TPM_HT_PERSISTENT = 0x81;
const TPM_RH TPM_RH_FIRST = 0x40000000;
const TPM_RH TPM_RH_SRK = 0x40000000;
const TPM_RH TPM_RH_OWNER = 0x40000001;
const TPM_RH TPM_RH_REVOKE = 0x40000002;
const TPM_RH TPM_RH_TRANSPORT = 0x40000003;
const TPM_RH TPM_RH_OPERATOR = 0x40000004;
const TPM_RH TPM_RH_ADMIN = 0x40000005;
const TPM_RH TPM_RH_EK = 0x40000006;
const TPM_RH TPM_RH_NULL = 0x40000007;
const TPM_RH TPM_RH_UNASSIGNED = 0x40000008;
const TPM_RH TPM_RS_PW = 0x40000009;
const TPM_RH TPM_RH_LOCKOUT = 0x4000000A;
const TPM_RH TPM_RH_ENDORSEMENT = 0x4000000B;
const TPM_RH TPM_RH_PLATFORM = 0x4000000C;
const TPM_RH TPM_RH_PLATFORM_NV = 0x4000000D;
const TPM_RH TPM_RH_LAST = 0x4000000D;
const TPM_HC HR_HANDLE_MASK = 0x00FFFFFF;
const TPM_HC HR_RANGE_MASK = 0xFF000000;
const TPM_HC HR_SHIFT = 24;
const TPM_HC HR_PCR = (TPM_HT_PCR << HR_SHIFT);
const TPM_HC HR_HMAC_SESSION = (TPM_HT_HMAC_SESSION << HR_SHIFT);
const TPM_HC HR_POLICY_SESSION = (TPM_HT_POLICY_SESSION << HR_SHIFT);
const TPM_HC HR_TRANSIENT = (TPM_HT_TRANSIENT << HR_SHIFT);
const TPM_HC HR_PERSISTENT = (TPM_HT_PERSISTENT << HR_SHIFT);
const TPM_HC HR_NV_INDEX = (TPM_HT_NV_INDEX << HR_SHIFT);
const TPM_HC HR_PERMANENT = (TPM_HT_PERMANENT << HR_SHIFT);
const TPM_HC PCR_FIRST = (HR_PCR + 0);
const TPM_HC PCR_LAST = (PCR_FIRST + IMPLEMENTATION_PCR-1);
const TPM_HC HMAC_SESSION_FIRST = (HR_HMAC_SESSION + 0);
const TPM_HC HMAC_SESSION_LAST = (HMAC_SESSION_FIRST+MAX_ACTIVE_SESSIONS-1);
const TPM_HC LOADED_SESSION_LAST = HMAC_SESSION_LAST;
const TPM_HC POLICY_SESSION_FIRST = (HR_POLICY_SESSION + 0);
const TPM_HC POLICY_SESSION_LAST = (POLICY_SESSION_FIRST + MAX_ACTIVE_SESSIONS-1);
const TPM_HC TRANSIENT_FIRST = (HR_TRANSIENT + 0);
const TPM_HC ACTIVE_SESSION_FIRST = POLICY_SESSION_FIRST;
const TPM_HC ACTIVE_SESSION_LAST = POLICY_SESSION_LAST;
const TPM_HC TRANSIENT_LAST = (TRANSIENT_FIRST+MAX_LOADED_OBJECTS-1);
const TPM_HC PERSISTENT_FIRST = (HR_PERSISTENT + 0);
const TPM_HC PERSISTENT_LAST = (PERSISTENT_FIRST + 0x00FFFFFF);
const TPM_HC PLATFORM_PERSISTENT = (PERSISTENT_FIRST + 0x00800000);
const TPM_HC NV_INDEX_FIRST = (HR_NV_INDEX + 0);
const TPM_HC NV_INDEX_LAST = (NV_INDEX_FIRST + 0x00FFFFFF);
const TPM_HC PERMANENT_FIRST = TPM_RH_FIRST;
const TPM_HC PERMANENT_LAST = TPM_RH_LAST;
struct TPMS_ALGORITHM_DESCRIPTION {
TPM_ALG_ID alg;
TPMA_ALGORITHM attributes;
};
union TPMU_HA {
BYTE sha1[SHA1_DIGEST_SIZE];
BYTE sha256[SHA256_DIGEST_SIZE];
BYTE sm3_256[SM3_256_DIGEST_SIZE];
BYTE sha384[SHA384_DIGEST_SIZE];
BYTE sha512[SHA512_DIGEST_SIZE];
};
struct TPMT_HA {
TPMI_ALG_HASH hash_alg;
TPMU_HA digest;
};
struct TPM2B_DIGEST {
UINT16 size;
BYTE buffer[sizeof(TPMU_HA)];
};
struct TPM2B_DATA {
UINT16 size;
BYTE buffer[sizeof(TPMT_HA)];
};
struct TPM2B_EVENT {
UINT16 size;
BYTE buffer[1024];
};
struct TPM2B_MAX_BUFFER {
UINT16 size;
BYTE buffer[MAX_DIGEST_BUFFER];
};
struct TPM2B_MAX_NV_BUFFER {
UINT16 size;
BYTE buffer[MAX_NV_BUFFER_SIZE];
};
struct TPM2B_TIMEOUT {
UINT16 size;
BYTE buffer[sizeof(UINT64)];
};
struct TPM2B_IV {
UINT16 size;
BYTE buffer[MAX_SYM_BLOCK_SIZE];
};
union TPMU_NAME {
TPMT_HA digest;
TPM_HANDLE handle;
};
struct TPM2B_NAME {
UINT16 size;
BYTE name[sizeof(TPMU_NAME)];
};
struct TPMS_PCR_SELECT {
UINT8 sizeof_select;
BYTE pcr_select[PCR_SELECT_MAX];
};
struct TPMS_PCR_SELECTION {
TPMI_ALG_HASH hash;
UINT8 sizeof_select;
BYTE pcr_select[PCR_SELECT_MAX];
};
struct TPMT_TK_CREATION {
TPM_ST tag;
TPMI_RH_HIERARCHY hierarchy;
TPM2B_DIGEST digest;
};
struct TPMT_TK_VERIFIED {
TPM_ST tag;
TPMI_RH_HIERARCHY hierarchy;
TPM2B_DIGEST digest;
};
struct TPMT_TK_AUTH {
TPMI_RH_HIERARCHY hierarchy;
TPM2B_DIGEST digest;
};
struct TPMT_TK_HASHCHECK {
TPM_ST tag;
TPMI_RH_HIERARCHY hierarchy;
TPM2B_DIGEST digest;
};
struct TPMS_ALG_PROPERTY {
TPM_ALG_ID alg;
TPMA_ALGORITHM alg_properties;
};
struct TPMS_TAGGED_PROPERTY {
TPM_PT property;
UINT32 value;
};
struct TPMS_TAGGED_PCR_SELECT {
TPM_PT tag;
UINT8 sizeof_select;
BYTE pcr_select[PCR_SELECT_MAX];
};
struct TPML_CC {
UINT32 count;
TPM_CC command_codes[MAX_CAP_CC];
};
struct TPML_CCA {
UINT32 count;
TPMA_CC command_attributes[MAX_CAP_CC];
};
struct TPML_ALG {
UINT32 count;
TPM_ALG_ID algorithms[MAX_ALG_LIST_SIZE];
};
struct TPML_HANDLE {
UINT32 count;
TPM_HANDLE handle[MAX_CAP_HANDLES];
};
struct TPML_DIGEST {
UINT32 count;
TPM2B_DIGEST digests[8];
};
struct TPML_DIGEST_VALUES {
UINT32 count;
TPMT_HA digests[HASH_COUNT];
};
struct TPM2B_DIGEST_VALUES {
UINT16 size;
BYTE buffer[sizeof(TPML_DIGEST_VALUES)];
};
struct TPML_PCR_SELECTION {
UINT32 count;
TPMS_PCR_SELECTION pcr_selections[HASH_COUNT];
};
struct TPML_ALG_PROPERTY {
UINT32 count;
TPMS_ALG_PROPERTY alg_properties[MAX_CAP_ALGS];
};
struct TPML_TAGGED_TPM_PROPERTY {
UINT32 count;
TPMS_TAGGED_PROPERTY tpm_property[MAX_TPM_PROPERTIES];
};
struct TPML_TAGGED_PCR_PROPERTY {
UINT32 count;
TPMS_TAGGED_PCR_SELECT pcr_property[MAX_PCR_PROPERTIES];
};
struct TPML_ECC_CURVE {
UINT32 count;
TPM_ECC_CURVE ecc_curves[MAX_ECC_CURVES];
};
union TPMU_CAPABILITIES {
TPML_ALG_PROPERTY algorithms;
TPML_HANDLE handles;
TPML_CCA command;
TPML_CC pp_commands;
TPML_CC audit_commands;
TPML_PCR_SELECTION assigned_pcr;
TPML_TAGGED_TPM_PROPERTY tpm_properties;
TPML_TAGGED_PCR_PROPERTY pcr_properties;
TPML_ECC_CURVE ecc_curves;
};
struct TPMS_CAPABILITY_DATA {
TPM_CAP capability;
TPMU_CAPABILITIES data;
};
struct TPMS_CLOCK_INFO {
UINT64 clock;
UINT32 reset_count;
UINT32 restart_count;
TPMI_YES_NO safe;
};
struct TPMS_TIME_INFO {
UINT64 time;
TPMS_CLOCK_INFO clock_info;
};
struct TPMS_TIME_ATTEST_INFO {
TPMS_TIME_INFO time;
UINT64 firmware_version;
};
struct TPMS_CERTIFY_INFO {
TPM2B_NAME name;
TPM2B_NAME qualified_name;
};
struct TPMS_QUOTE_INFO {
TPML_PCR_SELECTION pcr_select;
TPM2B_DIGEST pcr_digest;
};
struct TPMS_COMMAND_AUDIT_INFO {
UINT64 audit_counter;
TPM_ALG_ID digest_alg;
TPM2B_DIGEST audit_digest;
TPM2B_DIGEST command_digest;
};
struct TPMS_SESSION_AUDIT_INFO {
TPMI_YES_NO exclusive_session;
TPM2B_DIGEST session_digest;
};
struct TPMS_CREATION_INFO {
TPM2B_NAME object_name;
TPM2B_DIGEST creation_hash;
};
struct TPMS_NV_CERTIFY_INFO {
TPM2B_NAME index_name;
UINT16 offset;
TPM2B_MAX_NV_BUFFER nv_contents;
};
union TPMU_ATTEST {
TPMS_CERTIFY_INFO certify;
TPMS_CREATION_INFO creation;
TPMS_QUOTE_INFO quote;
TPMS_COMMAND_AUDIT_INFO command_audit;
TPMS_SESSION_AUDIT_INFO session_audit;
TPMS_TIME_ATTEST_INFO time;
TPMS_NV_CERTIFY_INFO nv;
};
struct TPMS_ATTEST {
TPM_GENERATED magic;
TPMI_ST_ATTEST type;
TPM2B_NAME qualified_signer;
TPM2B_DATA extra_data;
TPMS_CLOCK_INFO clock_info;
UINT64 firmware_version;
TPMU_ATTEST attested;
};
struct TPM2B_ATTEST {
UINT16 size;
BYTE attestation_data[sizeof(TPMS_ATTEST)];
};
struct TPMS_AUTH_COMMAND {
TPMI_SH_AUTH_SESSION session_handle;
TPM2B_NONCE nonce;
TPMA_SESSION session_attributes;
TPM2B_AUTH hmac;
};
struct TPMS_AUTH_RESPONSE {
TPM2B_NONCE nonce;
TPMA_SESSION session_attributes;
TPM2B_AUTH hmac;
};
union TPMU_SYM_KEY_BITS {
TPMI_AES_KEY_BITS aes;
TPMI_SM4_KEY_BITS sm4;
TPM_KEY_BITS sym;
TPMI_ALG_HASH xor_;
};
union TPMU_SYM_MODE {
TPMI_ALG_SYM_MODE aes;
TPMI_ALG_SYM_MODE sm4;
TPMI_ALG_SYM_MODE sym;
};
union TPMU_SYM_DETAILS {
};
struct TPMT_SYM_DEF {
TPMI_ALG_SYM algorithm;
TPMU_SYM_KEY_BITS key_bits;
TPMU_SYM_MODE mode;
TPMU_SYM_DETAILS details;
};
struct TPMT_SYM_DEF_OBJECT {
TPMI_ALG_SYM_OBJECT algorithm;
TPMU_SYM_KEY_BITS key_bits;
TPMU_SYM_MODE mode;
TPMU_SYM_DETAILS details;
};
struct TPM2B_SYM_KEY {
UINT16 size;
BYTE buffer[MAX_SYM_KEY_BYTES];
};
struct TPMS_SYMCIPHER_PARMS {
TPMT_SYM_DEF_OBJECT sym;
};
struct TPM2B_SENSITIVE_DATA {
UINT16 size;
BYTE buffer[MAX_SYM_DATA];
};
struct TPMS_SENSITIVE_CREATE {
TPM2B_AUTH user_auth;
TPM2B_SENSITIVE_DATA data;
};
struct TPM2B_SENSITIVE_CREATE {
UINT16 size;
TPMS_SENSITIVE_CREATE sensitive;
};
struct TPMS_SCHEME_SIGHASH {
TPMI_ALG_HASH hash_alg;
};
struct TPMS_SCHEME_XOR {
TPMI_ALG_HASH hash_alg;
TPMI_ALG_KDF kdf;
};
union TPMU_SCHEME_KEYEDHASH {
TPMS_SCHEME_HMAC hmac;
TPMS_SCHEME_XOR xor_;
};
struct TPMT_KEYEDHASH_SCHEME {
TPMI_ALG_KEYEDHASH_SCHEME scheme;
TPMU_SCHEME_KEYEDHASH details;
};
struct TPMS_SCHEME_ECDAA {
TPMI_ALG_HASH hash_alg;
UINT16 count;
};
union TPMU_SIG_SCHEME {
TPMS_SCHEME_RSASSA rsassa;
TPMS_SCHEME_RSAPSS rsapss;
TPMS_SCHEME_ECDSA ecdsa;
TPMS_SCHEME_SM2 sm2;
TPMS_SCHEME_ECDAA ecdaa;
TPMS_SCHEME_ECSCHNORR ec_schnorr;
TPMS_SCHEME_HMAC hmac;
TPMS_SCHEME_SIGHASH any;
};
struct TPMT_SIG_SCHEME {
TPMI_ALG_SIG_SCHEME scheme;
TPMU_SIG_SCHEME details;
};
struct TPMS_SCHEME_OAEP {
TPMI_ALG_HASH hash_alg;
};
struct TPMS_SCHEME_ECDH {
TPMI_ALG_HASH hash_alg;
};
struct TPMS_SCHEME_MGF1 {
TPMI_ALG_HASH hash_alg;
};
struct TPMS_SCHEME_KDF1_SP800_56a {
TPMI_ALG_HASH hash_alg;
};
struct TPMS_SCHEME_KDF2 {
TPMI_ALG_HASH hash_alg;
};
struct TPMS_SCHEME_KDF1_SP800_108 {
TPMI_ALG_HASH hash_alg;
};
union TPMU_KDF_SCHEME {
TPMS_SCHEME_MGF1 mgf1;
TPMS_SCHEME_KDF1_SP800_56a kdf1_sp800_56a;
TPMS_SCHEME_KDF2 kdf2;
TPMS_SCHEME_KDF1_SP800_108 kdf1_sp800_108;
};
struct TPMT_KDF_SCHEME {
TPMI_ALG_KDF scheme;
TPMU_KDF_SCHEME details;
};
union TPMU_ASYM_SCHEME {
TPMS_SCHEME_RSASSA rsassa;
TPMS_SCHEME_RSAPSS rsapss;
TPMS_SCHEME_OAEP oaep;
TPMS_SCHEME_ECDSA ecdsa;
TPMS_SCHEME_SM2 sm2;
TPMS_SCHEME_ECDAA ecdaa;
TPMS_SCHEME_ECSCHNORR ec_schnorr;
TPMS_SCHEME_ECDH ecdh;
TPMS_SCHEME_SIGHASH any_sig;
};
struct TPMT_ASYM_SCHEME {
TPMI_ALG_ASYM_SCHEME scheme;
TPMU_ASYM_SCHEME details;
};
struct TPMT_RSA_SCHEME {
TPMI_ALG_RSA_SCHEME scheme;
TPMU_ASYM_SCHEME details;
};
struct TPMT_RSA_DECRYPT {
TPMI_ALG_RSA_DECRYPT scheme;
TPMU_ASYM_SCHEME details;
};
struct TPM2B_PUBLIC_KEY_RSA {
UINT16 size;
BYTE buffer[MAX_RSA_KEY_BYTES];
};
struct TPM2B_PRIVATE_KEY_RSA {
UINT16 size;
BYTE buffer[MAX_RSA_KEY_BYTES/2];
};
struct TPM2B_ECC_PARAMETER {
UINT16 size;
BYTE buffer[MAX_ECC_KEY_BYTES];
};
struct TPMS_ECC_POINT {
TPM2B_ECC_PARAMETER x;
TPM2B_ECC_PARAMETER y;
};
struct TPM2B_ECC_POINT {
UINT16 size;
TPMS_ECC_POINT point;
};
struct TPMT_ECC_SCHEME {
TPMI_ALG_ECC_SCHEME scheme;
TPMU_SIG_SCHEME details;
};
struct TPMS_ALGORITHM_DETAIL_ECC {
TPM_ECC_CURVE curve_id;
UINT16 key_size;
TPMT_KDF_SCHEME kdf;
TPMT_ECC_SCHEME sign;
TPM2B_ECC_PARAMETER p;
TPM2B_ECC_PARAMETER a;
TPM2B_ECC_PARAMETER b;
TPM2B_ECC_PARAMETER g_x;
TPM2B_ECC_PARAMETER g_y;
TPM2B_ECC_PARAMETER n;
TPM2B_ECC_PARAMETER h;
};
struct TPMS_SIGNATURE_RSASSA {
TPMI_ALG_HASH hash;
TPM2B_PUBLIC_KEY_RSA sig;
};
struct TPMS_SIGNATURE_RSAPSS {
TPMI_ALG_HASH hash;
TPM2B_PUBLIC_KEY_RSA sig;
};
struct TPMS_SIGNATURE_ECDSA {
TPMI_ALG_HASH hash;
TPM2B_ECC_PARAMETER signature_r;
TPM2B_ECC_PARAMETER signature_s;
};
union TPMU_SIGNATURE {
TPMS_SIGNATURE_RSASSA rsassa;
TPMS_SIGNATURE_RSAPSS rsapss;
TPMS_SIGNATURE_ECDSA ecdsa;
TPMS_SIGNATURE_ECDSA sm2;
TPMS_SIGNATURE_ECDSA ecdaa;
TPMS_SIGNATURE_ECDSA ecschnorr;
TPMT_HA hmac;
TPMS_SCHEME_SIGHASH any;
};
struct TPMT_SIGNATURE {
TPMI_ALG_SIG_SCHEME sig_alg;
TPMU_SIGNATURE signature;
};
union TPMU_ENCRYPTED_SECRET {
BYTE ecc[sizeof(TPMS_ECC_POINT)];
BYTE rsa[MAX_RSA_KEY_BYTES];
BYTE symmetric[sizeof(TPM2B_DIGEST)];
BYTE keyed_hash[sizeof(TPM2B_DIGEST)];
};
struct TPM2B_ENCRYPTED_SECRET {
UINT16 size;
BYTE secret[sizeof(TPMU_ENCRYPTED_SECRET)];
};
struct TPMS_KEYEDHASH_PARMS {
TPMT_KEYEDHASH_SCHEME scheme;
};
struct TPMS_ASYM_PARMS {
TPMT_SYM_DEF_OBJECT symmetric;
TPMT_ASYM_SCHEME scheme;
};
struct TPMS_RSA_PARMS {
TPMT_SYM_DEF_OBJECT symmetric;
TPMT_RSA_SCHEME scheme;
TPMI_RSA_KEY_BITS key_bits;
UINT32 exponent;
};
struct TPMS_ECC_PARMS {
TPMT_SYM_DEF_OBJECT symmetric;
TPMT_ECC_SCHEME scheme;
TPMI_ECC_CURVE curve_id;
TPMT_KDF_SCHEME kdf;
};
union TPMU_PUBLIC_PARMS {
TPMS_KEYEDHASH_PARMS keyed_hash_detail;
TPMS_SYMCIPHER_PARMS sym_detail;
TPMS_RSA_PARMS rsa_detail;
TPMS_ECC_PARMS ecc_detail;
TPMS_ASYM_PARMS asym_detail;
};
struct TPMT_PUBLIC_PARMS {
TPMI_ALG_PUBLIC type;
TPMU_PUBLIC_PARMS parameters;
};
union TPMU_PUBLIC_ID {
TPM2B_DIGEST keyed_hash;
TPM2B_DIGEST sym;
TPM2B_PUBLIC_KEY_RSA rsa;
TPMS_ECC_POINT ecc;
};
struct TPMT_PUBLIC {
TPMI_ALG_PUBLIC type;
TPMI_ALG_HASH name_alg;
TPMA_OBJECT object_attributes;
TPM2B_DIGEST auth_policy;
TPMU_PUBLIC_PARMS parameters;
TPMU_PUBLIC_ID unique;
};
struct TPM2B_PUBLIC {
UINT16 size;
TPMT_PUBLIC public_area;
};
struct TPM2B_PRIVATE_VENDOR_SPECIFIC {
UINT16 size;
BYTE buffer[PRIVATE_VENDOR_SPECIFIC_BYTES];
};
union TPMU_SENSITIVE_COMPOSITE {
TPM2B_PRIVATE_KEY_RSA rsa;
TPM2B_ECC_PARAMETER ecc;
TPM2B_SENSITIVE_DATA bits;
TPM2B_SYM_KEY sym;
TPM2B_PRIVATE_VENDOR_SPECIFIC any;
};
struct TPMT_SENSITIVE {
TPMI_ALG_PUBLIC sensitive_type;
TPM2B_AUTH auth_value;
TPM2B_DIGEST seed_value;
TPMU_SENSITIVE_COMPOSITE sensitive;
};
struct TPM2B_SENSITIVE {
UINT16 size;
TPMT_SENSITIVE sensitive_area;
};
struct _PRIVATE {
TPM2B_DIGEST integrity_outer;
TPM2B_DIGEST integrity_inner;
TPMT_SENSITIVE sensitive;
};
struct TPM2B_PRIVATE {
UINT16 size;
BYTE buffer[sizeof(_PRIVATE)];
};
struct _ID_OBJECT {
TPM2B_DIGEST integrity_hmac;
TPM2B_DIGEST enc_identity;
};
struct TPM2B_ID_OBJECT {
UINT16 size;
BYTE credential[sizeof(_ID_OBJECT)];
};
struct TPMS_NV_PUBLIC {
TPMI_RH_NV_INDEX nv_index;
TPMI_ALG_HASH name_alg;
TPMA_NV attributes;
TPM2B_DIGEST auth_policy;
UINT16 data_size;
};
struct TPM2B_NV_PUBLIC {
UINT16 size;
TPMS_NV_PUBLIC nv_public;
};
struct TPM2B_CONTEXT_SENSITIVE {
UINT16 size;
BYTE buffer[MAX_CONTEXT_SIZE];
};
struct TPMS_CONTEXT_DATA {
TPM2B_DIGEST integrity;
TPM2B_CONTEXT_SENSITIVE encrypted;
};
struct TPM2B_CONTEXT_DATA {
UINT16 size;
BYTE buffer[sizeof(TPMS_CONTEXT_DATA)];
};
struct TPMS_CONTEXT {
UINT64 sequence;
TPMI_DH_CONTEXT saved_handle;
TPMI_RH_HIERARCHY hierarchy;
TPM2B_CONTEXT_DATA context_blob;
};
struct TPMS_CREATION_DATA {
TPML_PCR_SELECTION pcr_select;
TPM2B_DIGEST pcr_digest;
TPMA_LOCALITY locality;
TPM_ALG_ID parent_name_alg;
TPM2B_NAME parent_name;
TPM2B_NAME parent_qualified_name;
TPM2B_DATA outside_info;
};
struct TPM2B_CREATION_DATA {
UINT16 size;
TPMS_CREATION_DATA creation_data;
};
TRUNKS_EXPORT size_t GetNumberOfRequestHandles(TPM_CC command_code);
TRUNKS_EXPORT size_t GetNumberOfResponseHandles(TPM_CC command_code);
TRUNKS_EXPORT TPM_RC Serialize_uint8_t(
const uint8_t& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_uint8_t(
std::string* buffer,
uint8_t* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_int8_t(
const int8_t& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_int8_t(
std::string* buffer,
int8_t* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_int(
const int& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_int(
std::string* buffer,
int* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_uint16_t(
const uint16_t& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_uint16_t(
std::string* buffer,
uint16_t* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_int16_t(
const int16_t& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_int16_t(
std::string* buffer,
int16_t* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_uint32_t(
const uint32_t& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_uint32_t(
std::string* buffer,
uint32_t* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_int32_t(
const int32_t& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_int32_t(
std::string* buffer,
int32_t* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_uint64_t(
const uint64_t& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_uint64_t(
std::string* buffer,
uint64_t* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_int64_t(
const int64_t& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_int64_t(
std::string* buffer,
int64_t* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_UINT8(
const UINT8& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_UINT8(
std::string* buffer,
UINT8* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_BYTE(
const BYTE& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_BYTE(
std::string* buffer,
BYTE* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_INT8(
const INT8& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_INT8(
std::string* buffer,
INT8* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_BOOL(
const BOOL& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_BOOL(
std::string* buffer,
BOOL* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_UINT16(
const UINT16& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_UINT16(
std::string* buffer,
UINT16* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_INT16(
const INT16& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_INT16(
std::string* buffer,
INT16* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_UINT32(
const UINT32& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_UINT32(
std::string* buffer,
UINT32* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_INT32(
const INT32& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_INT32(
std::string* buffer,
INT32* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_UINT64(
const UINT64& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_UINT64(
std::string* buffer,
UINT64* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_INT64(
const INT64& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_INT64(
std::string* buffer,
INT64* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM_ALGORITHM_ID(
const TPM_ALGORITHM_ID& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM_ALGORITHM_ID(
std::string* buffer,
TPM_ALGORITHM_ID* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM_MODIFIER_INDICATOR(
const TPM_MODIFIER_INDICATOR& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM_MODIFIER_INDICATOR(
std::string* buffer,
TPM_MODIFIER_INDICATOR* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM_AUTHORIZATION_SIZE(
const TPM_AUTHORIZATION_SIZE& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM_AUTHORIZATION_SIZE(
std::string* buffer,
TPM_AUTHORIZATION_SIZE* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM_PARAMETER_SIZE(
const TPM_PARAMETER_SIZE& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM_PARAMETER_SIZE(
std::string* buffer,
TPM_PARAMETER_SIZE* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM_KEY_SIZE(
const TPM_KEY_SIZE& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM_KEY_SIZE(
std::string* buffer,
TPM_KEY_SIZE* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM_KEY_BITS(
const TPM_KEY_BITS& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM_KEY_BITS(
std::string* buffer,
TPM_KEY_BITS* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM_HANDLE(
const TPM_HANDLE& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM_HANDLE(
std::string* buffer,
TPM_HANDLE* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM2B_NONCE(
const TPM2B_NONCE& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM2B_NONCE(
std::string* buffer,
TPM2B_NONCE* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM2B_AUTH(
const TPM2B_AUTH& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM2B_AUTH(
std::string* buffer,
TPM2B_AUTH* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM2B_OPERAND(
const TPM2B_OPERAND& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM2B_OPERAND(
std::string* buffer,
TPM2B_OPERAND* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMS_SCHEME_HMAC(
const TPMS_SCHEME_HMAC& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMS_SCHEME_HMAC(
std::string* buffer,
TPMS_SCHEME_HMAC* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMS_SCHEME_RSASSA(
const TPMS_SCHEME_RSASSA& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMS_SCHEME_RSASSA(
std::string* buffer,
TPMS_SCHEME_RSASSA* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMS_SCHEME_RSAPSS(
const TPMS_SCHEME_RSAPSS& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMS_SCHEME_RSAPSS(
std::string* buffer,
TPMS_SCHEME_RSAPSS* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMS_SCHEME_ECDSA(
const TPMS_SCHEME_ECDSA& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMS_SCHEME_ECDSA(
std::string* buffer,
TPMS_SCHEME_ECDSA* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMS_SCHEME_SM2(
const TPMS_SCHEME_SM2& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMS_SCHEME_SM2(
std::string* buffer,
TPMS_SCHEME_SM2* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMS_SCHEME_ECSCHNORR(
const TPMS_SCHEME_ECSCHNORR& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMS_SCHEME_ECSCHNORR(
std::string* buffer,
TPMS_SCHEME_ECSCHNORR* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_YES_NO(
const TPMI_YES_NO& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_YES_NO(
std::string* buffer,
TPMI_YES_NO* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_DH_OBJECT(
const TPMI_DH_OBJECT& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_DH_OBJECT(
std::string* buffer,
TPMI_DH_OBJECT* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_DH_PERSISTENT(
const TPMI_DH_PERSISTENT& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_DH_PERSISTENT(
std::string* buffer,
TPMI_DH_PERSISTENT* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_DH_ENTITY(
const TPMI_DH_ENTITY& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_DH_ENTITY(
std::string* buffer,
TPMI_DH_ENTITY* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_DH_PCR(
const TPMI_DH_PCR& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_DH_PCR(
std::string* buffer,
TPMI_DH_PCR* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_SH_AUTH_SESSION(
const TPMI_SH_AUTH_SESSION& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_SH_AUTH_SESSION(
std::string* buffer,
TPMI_SH_AUTH_SESSION* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_SH_HMAC(
const TPMI_SH_HMAC& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_SH_HMAC(
std::string* buffer,
TPMI_SH_HMAC* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_SH_POLICY(
const TPMI_SH_POLICY& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_SH_POLICY(
std::string* buffer,
TPMI_SH_POLICY* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_DH_CONTEXT(
const TPMI_DH_CONTEXT& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_DH_CONTEXT(
std::string* buffer,
TPMI_DH_CONTEXT* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_RH_HIERARCHY(
const TPMI_RH_HIERARCHY& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_RH_HIERARCHY(
std::string* buffer,
TPMI_RH_HIERARCHY* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_RH_ENABLES(
const TPMI_RH_ENABLES& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_RH_ENABLES(
std::string* buffer,
TPMI_RH_ENABLES* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_RH_HIERARCHY_AUTH(
const TPMI_RH_HIERARCHY_AUTH& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_RH_HIERARCHY_AUTH(
std::string* buffer,
TPMI_RH_HIERARCHY_AUTH* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_RH_PLATFORM(
const TPMI_RH_PLATFORM& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_RH_PLATFORM(
std::string* buffer,
TPMI_RH_PLATFORM* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_RH_OWNER(
const TPMI_RH_OWNER& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_RH_OWNER(
std::string* buffer,
TPMI_RH_OWNER* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_RH_ENDORSEMENT(
const TPMI_RH_ENDORSEMENT& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_RH_ENDORSEMENT(
std::string* buffer,
TPMI_RH_ENDORSEMENT* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_RH_PROVISION(
const TPMI_RH_PROVISION& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_RH_PROVISION(
std::string* buffer,
TPMI_RH_PROVISION* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_RH_CLEAR(
const TPMI_RH_CLEAR& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_RH_CLEAR(
std::string* buffer,
TPMI_RH_CLEAR* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_RH_NV_AUTH(
const TPMI_RH_NV_AUTH& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_RH_NV_AUTH(
std::string* buffer,
TPMI_RH_NV_AUTH* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_RH_LOCKOUT(
const TPMI_RH_LOCKOUT& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_RH_LOCKOUT(
std::string* buffer,
TPMI_RH_LOCKOUT* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_RH_NV_INDEX(
const TPMI_RH_NV_INDEX& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_RH_NV_INDEX(
std::string* buffer,
TPMI_RH_NV_INDEX* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_ALG_HASH(
const TPMI_ALG_HASH& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_ALG_HASH(
std::string* buffer,
TPMI_ALG_HASH* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_ALG_ASYM(
const TPMI_ALG_ASYM& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_ALG_ASYM(
std::string* buffer,
TPMI_ALG_ASYM* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_ALG_SYM(
const TPMI_ALG_SYM& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_ALG_SYM(
std::string* buffer,
TPMI_ALG_SYM* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_ALG_SYM_OBJECT(
const TPMI_ALG_SYM_OBJECT& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_ALG_SYM_OBJECT(
std::string* buffer,
TPMI_ALG_SYM_OBJECT* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_ALG_SYM_MODE(
const TPMI_ALG_SYM_MODE& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_ALG_SYM_MODE(
std::string* buffer,
TPMI_ALG_SYM_MODE* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_ALG_KDF(
const TPMI_ALG_KDF& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_ALG_KDF(
std::string* buffer,
TPMI_ALG_KDF* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_ALG_SIG_SCHEME(
const TPMI_ALG_SIG_SCHEME& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_ALG_SIG_SCHEME(
std::string* buffer,
TPMI_ALG_SIG_SCHEME* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_ECC_KEY_EXCHANGE(
const TPMI_ECC_KEY_EXCHANGE& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_ECC_KEY_EXCHANGE(
std::string* buffer,
TPMI_ECC_KEY_EXCHANGE* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_ST_COMMAND_TAG(
const TPMI_ST_COMMAND_TAG& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_ST_COMMAND_TAG(
std::string* buffer,
TPMI_ST_COMMAND_TAG* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_ST_ATTEST(
const TPMI_ST_ATTEST& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_ST_ATTEST(
std::string* buffer,
TPMI_ST_ATTEST* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_AES_KEY_BITS(
const TPMI_AES_KEY_BITS& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_AES_KEY_BITS(
std::string* buffer,
TPMI_AES_KEY_BITS* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_SM4_KEY_BITS(
const TPMI_SM4_KEY_BITS& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_SM4_KEY_BITS(
std::string* buffer,
TPMI_SM4_KEY_BITS* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_ALG_KEYEDHASH_SCHEME(
const TPMI_ALG_KEYEDHASH_SCHEME& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_ALG_KEYEDHASH_SCHEME(
std::string* buffer,
TPMI_ALG_KEYEDHASH_SCHEME* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_ALG_ASYM_SCHEME(
const TPMI_ALG_ASYM_SCHEME& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_ALG_ASYM_SCHEME(
std::string* buffer,
TPMI_ALG_ASYM_SCHEME* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_ALG_RSA_SCHEME(
const TPMI_ALG_RSA_SCHEME& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_ALG_RSA_SCHEME(
std::string* buffer,
TPMI_ALG_RSA_SCHEME* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_ALG_RSA_DECRYPT(
const TPMI_ALG_RSA_DECRYPT& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_ALG_RSA_DECRYPT(
std::string* buffer,
TPMI_ALG_RSA_DECRYPT* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_RSA_KEY_BITS(
const TPMI_RSA_KEY_BITS& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_RSA_KEY_BITS(
std::string* buffer,
TPMI_RSA_KEY_BITS* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_ALG_ECC_SCHEME(
const TPMI_ALG_ECC_SCHEME& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_ALG_ECC_SCHEME(
std::string* buffer,
TPMI_ALG_ECC_SCHEME* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_ECC_CURVE(
const TPMI_ECC_CURVE& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_ECC_CURVE(
std::string* buffer,
TPMI_ECC_CURVE* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMI_ALG_PUBLIC(
const TPMI_ALG_PUBLIC& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMI_ALG_PUBLIC(
std::string* buffer,
TPMI_ALG_PUBLIC* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMA_ALGORITHM(
const TPMA_ALGORITHM& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMA_ALGORITHM(
std::string* buffer,
TPMA_ALGORITHM* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMA_OBJECT(
const TPMA_OBJECT& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMA_OBJECT(
std::string* buffer,
TPMA_OBJECT* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMA_SESSION(
const TPMA_SESSION& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMA_SESSION(
std::string* buffer,
TPMA_SESSION* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMA_LOCALITY(
const TPMA_LOCALITY& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMA_LOCALITY(
std::string* buffer,
TPMA_LOCALITY* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMA_PERMANENT(
const TPMA_PERMANENT& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMA_PERMANENT(
std::string* buffer,
TPMA_PERMANENT* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMA_STARTUP_CLEAR(
const TPMA_STARTUP_CLEAR& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMA_STARTUP_CLEAR(
std::string* buffer,
TPMA_STARTUP_CLEAR* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMA_MEMORY(
const TPMA_MEMORY& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMA_MEMORY(
std::string* buffer,
TPMA_MEMORY* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMA_CC(
const TPMA_CC& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMA_CC(
std::string* buffer,
TPMA_CC* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM_NV_INDEX(
const TPM_NV_INDEX& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM_NV_INDEX(
std::string* buffer,
TPM_NV_INDEX* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMA_NV(
const TPMA_NV& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMA_NV(
std::string* buffer,
TPMA_NV* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM_SPEC(
const TPM_SPEC& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM_SPEC(
std::string* buffer,
TPM_SPEC* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM_GENERATED(
const TPM_GENERATED& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM_GENERATED(
std::string* buffer,
TPM_GENERATED* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM_ALG_ID(
const TPM_ALG_ID& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM_ALG_ID(
std::string* buffer,
TPM_ALG_ID* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM_ECC_CURVE(
const TPM_ECC_CURVE& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM_ECC_CURVE(
std::string* buffer,
TPM_ECC_CURVE* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM_CC(
const TPM_CC& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM_CC(
std::string* buffer,
TPM_CC* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM_RC(
const TPM_RC& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM_RC(
std::string* buffer,
TPM_RC* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM_CLOCK_ADJUST(
const TPM_CLOCK_ADJUST& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM_CLOCK_ADJUST(
std::string* buffer,
TPM_CLOCK_ADJUST* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM_EO(
const TPM_EO& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM_EO(
std::string* buffer,
TPM_EO* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM_ST(
const TPM_ST& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM_ST(
std::string* buffer,
TPM_ST* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM_SU(
const TPM_SU& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM_SU(
std::string* buffer,
TPM_SU* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM_SE(
const TPM_SE& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM_SE(
std::string* buffer,
TPM_SE* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM_CAP(
const TPM_CAP& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM_CAP(
std::string* buffer,
TPM_CAP* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM_PT(
const TPM_PT& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM_PT(
std::string* buffer,
TPM_PT* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM_PT_PCR(
const TPM_PT_PCR& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM_PT_PCR(
std::string* buffer,
TPM_PT_PCR* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM_PS(
const TPM_PS& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM_PS(
std::string* buffer,
TPM_PS* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM_HT(
const TPM_HT& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM_HT(
std::string* buffer,
TPM_HT* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM_RH(
const TPM_RH& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM_RH(
std::string* buffer,
TPM_RH* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM_HC(
const TPM_HC& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM_HC(
std::string* buffer,
TPM_HC* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMS_ALGORITHM_DESCRIPTION(
const TPMS_ALGORITHM_DESCRIPTION& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMS_ALGORITHM_DESCRIPTION(
std::string* buffer,
TPMS_ALGORITHM_DESCRIPTION* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMT_HA(
const TPMT_HA& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMT_HA(
std::string* buffer,
TPMT_HA* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM2B_DIGEST(
const TPM2B_DIGEST& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM2B_DIGEST(
std::string* buffer,
TPM2B_DIGEST* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM2B_DIGEST Make_TPM2B_DIGEST(
const std::string& bytes);
TRUNKS_EXPORT std::string StringFrom_TPM2B_DIGEST(
const TPM2B_DIGEST& tpm2b);
TRUNKS_EXPORT TPM_RC Serialize_TPM2B_DATA(
const TPM2B_DATA& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM2B_DATA(
std::string* buffer,
TPM2B_DATA* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM2B_DATA Make_TPM2B_DATA(
const std::string& bytes);
TRUNKS_EXPORT std::string StringFrom_TPM2B_DATA(
const TPM2B_DATA& tpm2b);
TRUNKS_EXPORT TPM_RC Serialize_TPM2B_EVENT(
const TPM2B_EVENT& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM2B_EVENT(
std::string* buffer,
TPM2B_EVENT* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM2B_EVENT Make_TPM2B_EVENT(
const std::string& bytes);
TRUNKS_EXPORT std::string StringFrom_TPM2B_EVENT(
const TPM2B_EVENT& tpm2b);
TRUNKS_EXPORT TPM_RC Serialize_TPM2B_MAX_BUFFER(
const TPM2B_MAX_BUFFER& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM2B_MAX_BUFFER(
std::string* buffer,
TPM2B_MAX_BUFFER* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM2B_MAX_BUFFER Make_TPM2B_MAX_BUFFER(
const std::string& bytes);
TRUNKS_EXPORT std::string StringFrom_TPM2B_MAX_BUFFER(
const TPM2B_MAX_BUFFER& tpm2b);
TRUNKS_EXPORT TPM_RC Serialize_TPM2B_MAX_NV_BUFFER(
const TPM2B_MAX_NV_BUFFER& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM2B_MAX_NV_BUFFER(
std::string* buffer,
TPM2B_MAX_NV_BUFFER* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM2B_MAX_NV_BUFFER Make_TPM2B_MAX_NV_BUFFER(
const std::string& bytes);
TRUNKS_EXPORT std::string StringFrom_TPM2B_MAX_NV_BUFFER(
const TPM2B_MAX_NV_BUFFER& tpm2b);
TRUNKS_EXPORT TPM_RC Serialize_TPM2B_TIMEOUT(
const TPM2B_TIMEOUT& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM2B_TIMEOUT(
std::string* buffer,
TPM2B_TIMEOUT* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM2B_TIMEOUT Make_TPM2B_TIMEOUT(
const std::string& bytes);
TRUNKS_EXPORT std::string StringFrom_TPM2B_TIMEOUT(
const TPM2B_TIMEOUT& tpm2b);
TRUNKS_EXPORT TPM_RC Serialize_TPM2B_IV(
const TPM2B_IV& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM2B_IV(
std::string* buffer,
TPM2B_IV* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM2B_IV Make_TPM2B_IV(
const std::string& bytes);
TRUNKS_EXPORT std::string StringFrom_TPM2B_IV(
const TPM2B_IV& tpm2b);
TRUNKS_EXPORT TPM_RC Serialize_TPM2B_NAME(
const TPM2B_NAME& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM2B_NAME(
std::string* buffer,
TPM2B_NAME* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM2B_NAME Make_TPM2B_NAME(
const std::string& bytes);
TRUNKS_EXPORT std::string StringFrom_TPM2B_NAME(
const TPM2B_NAME& tpm2b);
TRUNKS_EXPORT TPM_RC Serialize_TPMS_PCR_SELECT(
const TPMS_PCR_SELECT& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMS_PCR_SELECT(
std::string* buffer,
TPMS_PCR_SELECT* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMS_PCR_SELECTION(
const TPMS_PCR_SELECTION& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMS_PCR_SELECTION(
std::string* buffer,
TPMS_PCR_SELECTION* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMT_TK_CREATION(
const TPMT_TK_CREATION& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMT_TK_CREATION(
std::string* buffer,
TPMT_TK_CREATION* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMT_TK_VERIFIED(
const TPMT_TK_VERIFIED& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMT_TK_VERIFIED(
std::string* buffer,
TPMT_TK_VERIFIED* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMT_TK_AUTH(
const TPMT_TK_AUTH& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMT_TK_AUTH(
std::string* buffer,
TPMT_TK_AUTH* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMT_TK_HASHCHECK(
const TPMT_TK_HASHCHECK& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMT_TK_HASHCHECK(
std::string* buffer,
TPMT_TK_HASHCHECK* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMS_ALG_PROPERTY(
const TPMS_ALG_PROPERTY& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMS_ALG_PROPERTY(
std::string* buffer,
TPMS_ALG_PROPERTY* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMS_TAGGED_PROPERTY(
const TPMS_TAGGED_PROPERTY& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMS_TAGGED_PROPERTY(
std::string* buffer,
TPMS_TAGGED_PROPERTY* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMS_TAGGED_PCR_SELECT(
const TPMS_TAGGED_PCR_SELECT& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMS_TAGGED_PCR_SELECT(
std::string* buffer,
TPMS_TAGGED_PCR_SELECT* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPML_CC(
const TPML_CC& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPML_CC(
std::string* buffer,
TPML_CC* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPML_CCA(
const TPML_CCA& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPML_CCA(
std::string* buffer,
TPML_CCA* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPML_ALG(
const TPML_ALG& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPML_ALG(
std::string* buffer,
TPML_ALG* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPML_HANDLE(
const TPML_HANDLE& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPML_HANDLE(
std::string* buffer,
TPML_HANDLE* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPML_DIGEST(
const TPML_DIGEST& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPML_DIGEST(
std::string* buffer,
TPML_DIGEST* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPML_DIGEST_VALUES(
const TPML_DIGEST_VALUES& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPML_DIGEST_VALUES(
std::string* buffer,
TPML_DIGEST_VALUES* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM2B_DIGEST_VALUES(
const TPM2B_DIGEST_VALUES& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM2B_DIGEST_VALUES(
std::string* buffer,
TPM2B_DIGEST_VALUES* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM2B_DIGEST_VALUES Make_TPM2B_DIGEST_VALUES(
const std::string& bytes);
TRUNKS_EXPORT std::string StringFrom_TPM2B_DIGEST_VALUES(
const TPM2B_DIGEST_VALUES& tpm2b);
TRUNKS_EXPORT TPM_RC Serialize_TPML_PCR_SELECTION(
const TPML_PCR_SELECTION& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPML_PCR_SELECTION(
std::string* buffer,
TPML_PCR_SELECTION* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPML_ALG_PROPERTY(
const TPML_ALG_PROPERTY& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPML_ALG_PROPERTY(
std::string* buffer,
TPML_ALG_PROPERTY* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPML_TAGGED_TPM_PROPERTY(
const TPML_TAGGED_TPM_PROPERTY& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPML_TAGGED_TPM_PROPERTY(
std::string* buffer,
TPML_TAGGED_TPM_PROPERTY* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPML_TAGGED_PCR_PROPERTY(
const TPML_TAGGED_PCR_PROPERTY& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPML_TAGGED_PCR_PROPERTY(
std::string* buffer,
TPML_TAGGED_PCR_PROPERTY* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPML_ECC_CURVE(
const TPML_ECC_CURVE& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPML_ECC_CURVE(
std::string* buffer,
TPML_ECC_CURVE* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMS_CAPABILITY_DATA(
const TPMS_CAPABILITY_DATA& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMS_CAPABILITY_DATA(
std::string* buffer,
TPMS_CAPABILITY_DATA* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMS_CLOCK_INFO(
const TPMS_CLOCK_INFO& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMS_CLOCK_INFO(
std::string* buffer,
TPMS_CLOCK_INFO* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMS_TIME_INFO(
const TPMS_TIME_INFO& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMS_TIME_INFO(
std::string* buffer,
TPMS_TIME_INFO* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMS_TIME_ATTEST_INFO(
const TPMS_TIME_ATTEST_INFO& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMS_TIME_ATTEST_INFO(
std::string* buffer,
TPMS_TIME_ATTEST_INFO* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMS_CERTIFY_INFO(
const TPMS_CERTIFY_INFO& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMS_CERTIFY_INFO(
std::string* buffer,
TPMS_CERTIFY_INFO* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMS_QUOTE_INFO(
const TPMS_QUOTE_INFO& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMS_QUOTE_INFO(
std::string* buffer,
TPMS_QUOTE_INFO* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMS_COMMAND_AUDIT_INFO(
const TPMS_COMMAND_AUDIT_INFO& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMS_COMMAND_AUDIT_INFO(
std::string* buffer,
TPMS_COMMAND_AUDIT_INFO* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMS_SESSION_AUDIT_INFO(
const TPMS_SESSION_AUDIT_INFO& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMS_SESSION_AUDIT_INFO(
std::string* buffer,
TPMS_SESSION_AUDIT_INFO* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMS_CREATION_INFO(
const TPMS_CREATION_INFO& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMS_CREATION_INFO(
std::string* buffer,
TPMS_CREATION_INFO* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMS_NV_CERTIFY_INFO(
const TPMS_NV_CERTIFY_INFO& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMS_NV_CERTIFY_INFO(
std::string* buffer,
TPMS_NV_CERTIFY_INFO* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMS_ATTEST(
const TPMS_ATTEST& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMS_ATTEST(
std::string* buffer,
TPMS_ATTEST* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM2B_ATTEST(
const TPM2B_ATTEST& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM2B_ATTEST(
std::string* buffer,
TPM2B_ATTEST* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM2B_ATTEST Make_TPM2B_ATTEST(
const std::string& bytes);
TRUNKS_EXPORT std::string StringFrom_TPM2B_ATTEST(
const TPM2B_ATTEST& tpm2b);
TRUNKS_EXPORT TPM_RC Serialize_TPMS_AUTH_COMMAND(
const TPMS_AUTH_COMMAND& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMS_AUTH_COMMAND(
std::string* buffer,
TPMS_AUTH_COMMAND* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMS_AUTH_RESPONSE(
const TPMS_AUTH_RESPONSE& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMS_AUTH_RESPONSE(
std::string* buffer,
TPMS_AUTH_RESPONSE* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMT_SYM_DEF(
const TPMT_SYM_DEF& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMT_SYM_DEF(
std::string* buffer,
TPMT_SYM_DEF* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPMT_SYM_DEF_OBJECT(
const TPMT_SYM_DEF_OBJECT& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPMT_SYM_DEF_OBJECT(
std::string* buffer,
TPMT_SYM_DEF_OBJECT* value,
std::string* value_bytes);
TRUNKS_EXPORT TPM_RC Serialize_TPM2B_SYM_KEY(
const TPM2B_SYM_KEY& value,
std::string* buffer);
TRUNKS_EXPORT TPM_RC Parse_TPM2B_SYM_KEY(
std::string* buffer,
TPM2B_SYM_KEY* value,
std::string* value_bytes<