Skip to content

Commit

Permalink
mu: Fill in missing TPMU variants
Browse files Browse the repository at this point in the history
This introduces support (at the marshal/unmarshal level) for:
 - the SHA3 family of hash algorithms
 - the EDDSA signing scheme (used by curve25519)
 - the tag TPM_ST_ATTEST_NV_DIGEST, for the new form of TPM2_NV_Certify
   that certifies a hash of the NV area
 - the legacy block cipher 3DES
 - the key derivation function KDF2

Also add some missing constants from the algorithm registry.

Signed-off-by: Fergus Dall <[email protected]>
  • Loading branch information
fergus-dall committed May 29, 2023
1 parent 8699ab3 commit 92a3e24
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 11 deletions.
34 changes: 31 additions & 3 deletions include/tss2/tss2_tpm2_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
#define TPM2_SHA384_DIGEST_SIZE 48
#define TPM2_SHA512_DIGEST_SIZE 64
#define TPM2_SM3_256_DIGEST_SIZE 32
#define TPM2_SHA3_256_DIGEST_SIZE 32
#define TPM2_SHA3_384_DIGEST_SIZE 48
#define TPM2_SHA3_512_DIGEST_SIZE 64

/* Encryption algorithm sizes */
#define TPM2_MAX_SYM_BLOCK_SIZE 16
Expand Down Expand Up @@ -105,17 +108,23 @@ typedef UINT16 TPM2_ALG_ID;
#define TPM2_ALG_ECC ((TPM2_ALG_ID) 0x0023)
#define TPM2_ALG_SYMCIPHER ((TPM2_ALG_ID) 0x0025)
#define TPM2_ALG_CAMELLIA ((TPM2_ALG_ID) 0x0026)
#define TPM2_ALG_CMAC ((TPM2_ALG_ID) 0x003F)
#define TPM2_ALG_CTR ((TPM2_ALG_ID) 0x0040)
#define TPM2_ALG_SHA3_256 ((TPM2_ALG_ID) 0x0027)
#define TPM2_ALG_SHA3_384 ((TPM2_ALG_ID) 0x0028)
#define TPM2_ALG_SHA3_512 ((TPM2_ALG_ID) 0x0029)
#define TPM2_ALG_CMAC ((TPM2_ALG_ID) 0x003F)
#define TPM2_ALG_CTR ((TPM2_ALG_ID) 0x0040)
#define TPM2_ALG_OFB ((TPM2_ALG_ID) 0x0041)
#define TPM2_ALG_CBC ((TPM2_ALG_ID) 0x0042)
#define TPM2_ALG_CFB ((TPM2_ALG_ID) 0x0043)
#define TPM2_ALG_ECB ((TPM2_ALG_ID) 0x0044)
#define TPM2_ALG_CCM ((TPM2_ALG_ID) 0x0050)
#define TPM2_ALG_GCM ((TPM2_ALG_ID) 0x0051)
#define TPM2_ALG_KW ((TPM2_ALG_ID) 0x0052)
#define TPM2_ALG_KWP ((TPM2_ALG_ID) 0x0053)
#define TPM2_ALG_EAX ((TPM2_ALG_ID) 0x0054)
#define TPM2_ALG_EDDSA ((TPM2_ALG_ID) 0x0060)
#define TPM2_ALG_FIRST ((TPM2_ALG_ID) 0x0001)
#define TPM2_ALG_LAST ((TPM2_ALG_ID) 0x0044)
#define TPM2_ALG_LAST ((TPM2_ALG_ID) 0x0060)

/* From TCG Algorithm Registry: Definition of TPM2_ECC_CURVE Constants */
typedef UINT16 TPM2_ECC_CURVE;
Expand All @@ -128,6 +137,10 @@ typedef UINT16 TPM2_ECC_CURVE;
#define TPM2_ECC_BN_P256 ((TPM2_ECC_CURVE) 0x0010)
#define TPM2_ECC_BN_P638 ((TPM2_ECC_CURVE) 0x0011)
#define TPM2_ECC_SM2_P256 ((TPM2_ECC_CURVE) 0x0020)
#define TPM2_ECC_BP_P256_R1 ((TPM2_ECC_CURVE) 0x0030)
#define TPM2_ECC_BP_P384_R1 ((TPM2_ECC_CURVE) 0x0031)
#define TPM2_ECC_BP_P512_R1 ((TPM2_ECC_CURVE) 0x0032)
#define TPM2_ECC_CURVE_25519 ((TPM2_ECC_CURVE) 0x0040)

/* From TPM 2.0 Part 2: Definition of TPM2_CC Constants */
typedef UINT32 TPM2_CC;
Expand Down Expand Up @@ -439,6 +452,7 @@ typedef UINT16 TPM2_ST;
#define TPM2_ST_ATTEST_TIME ((TPM2_ST) 0x8019) /* tag for an attestation structure */
#define TPM2_ST_ATTEST_CREATION ((TPM2_ST) 0x801A) /* tag for an attestation structure */
#define TPM2_ST_RESERVED3 ((TPM2_ST) 0x801B) /* do not use . NOTE This was previously assigned to TPM2_ST_ATTEST_NV. The tag is changed because the structure has changed */
#define TPM2_ST_ATTEST_NV_DIGEST ((TPM2_ST) 0x801C) /* tag for an attestation structure */
#define TPM2_ST_CREATION ((TPM2_ST) 0x8021) /* tag for a ticket type */
#define TPM2_ST_VERIFIED ((TPM2_ST) 0x8022) /* tag for a ticket type */
#define TPM2_ST_AUTH_SECRET ((TPM2_ST) 0x8023) /* tag for a ticket type */
Expand Down Expand Up @@ -946,6 +960,9 @@ union TPMU_HA {
BYTE sha384[TPM2_SHA384_DIGEST_SIZE];
BYTE sha512[TPM2_SHA512_DIGEST_SIZE];
BYTE sm3_256[TPM2_SM3_256_DIGEST_SIZE];
BYTE sha3_256[TPM2_SHA3_256_DIGEST_SIZE];
BYTE sha3_384[TPM2_SHA3_384_DIGEST_SIZE];
BYTE sha3_512[TPM2_SHA3_512_DIGEST_SIZE];
};

/* Definition of TPMT_HA Structure <INOUT> */
Expand Down Expand Up @@ -1318,6 +1335,7 @@ union TPMU_ATTEST {
TPMS_SESSION_AUDIT_INFO sessionAudit;
TPMS_TIME_ATTEST_INFO time;
TPMS_NV_CERTIFY_INFO nv;
TPMS_NV_DIGEST_CERTIFY_INFO nvDigest;
};

/* Definition of TPMS_ATTEST Structure <OUT> */
Expand Down Expand Up @@ -1365,12 +1383,16 @@ typedef TPM2_KEY_BITS TPMI_SM4_KEY_BITS;
/* Definition of CAMELLIA TPM2_KEY_BITS TPMI_CAMELLIA_KEY_BITS Type */
typedef TPM2_KEY_BITS TPMI_CAMELLIA_KEY_BITS;

/* Definition of TDES TPM2_KEY_BITS TPMI_TDES_KEY_BITS Type */
typedef TPM2_KEY_BITS TPMI_TDES_KEY_BITS;

/* Definition of TPMU_SYM_KEY_BITS Union */
typedef union TPMU_SYM_KEY_BITS TPMU_SYM_KEY_BITS;
union TPMU_SYM_KEY_BITS {
TPMI_AES_KEY_BITS aes; /* all symmetric algorithms */
TPMI_SM4_KEY_BITS sm4; /* all symmetric algorithms */
TPMI_CAMELLIA_KEY_BITS camellia; /* all symmetric algorithms */
TPMI_TDES_KEY_BITS tdes; /* all symmetric algorithms */
TPM2_KEY_BITS sym; /* when selector may be any of the symmetric block ciphers */
TPMI_ALG_HASH exclusiveOr; /* overload for using xor. NOTE TPM2_ALG_NULL is not allowed */
TPMS_EMPTY null; /* TPM2_ALG_NULL */
Expand All @@ -1382,6 +1404,7 @@ union TPMU_SYM_MODE {
TPMI_ALG_SYM_MODE aes;
TPMI_ALG_SYM_MODE sm4;
TPMI_ALG_SYM_MODE camellia;
TPMI_ALG_SYM_MODE tdes;
TPMI_ALG_SYM_MODE sym; /* when selector may be any of the symmetric block ciphers */
TPMS_EMPTY exclusiveOr; /* TPM2_ALG_XOR */
TPMS_EMPTY null; /* TPM2_ALG_NULL */
Expand Down Expand Up @@ -1515,6 +1538,7 @@ typedef TPMS_SCHEME_HASH TPMS_SIG_SCHEME_ECDSA; /* all asymmetric signing s
typedef TPMS_SCHEME_HASH TPMS_SIG_SCHEME_SM2; /* all asymmetric signing schemes */
typedef TPMS_SCHEME_HASH TPMS_SIG_SCHEME_ECSCHNORR; /* all asymmetric signing schemes */
typedef TPMS_SCHEME_ECDAA TPMS_SIG_SCHEME_ECDAA; /* schemes that need a hash and a count */
typedef TPMS_SCHEME_HASH TPMS_SIG_SCHEME_EDDSA; /* all asymmetric signing schemes */

/* Definition of TPMU_SIG_SCHEME Union <INOUT S> */
typedef union TPMU_SIG_SCHEME TPMU_SIG_SCHEME;
Expand All @@ -1525,6 +1549,7 @@ union TPMU_SIG_SCHEME {
TPMS_SIG_SCHEME_ECDAA ecdaa; /* all signing schemes including anonymous schemes */
TPMS_SIG_SCHEME_SM2 sm2; /* all signing schemes including anonymous schemes */
TPMS_SIG_SCHEME_ECSCHNORR ecschnorr; /* all signing schemes including anonymous schemes */
TPMS_SIG_SCHEME_EDDSA eddsa; /* all signing schemes including anonymous schemes */
TPMS_SCHEME_HMAC hmac; /* the HMAC scheme */
TPMS_SCHEME_HASH any; /* selector that allows access to digest for any signing scheme */
TPMS_EMPTY null; /* TPM2_ALG_NULL */
Expand Down Expand Up @@ -1582,6 +1607,7 @@ union TPMU_ASYM_SCHEME {
TPMS_SIG_SCHEME_ECDAA ecdaa; /* signing and anonymous signing */
TPMS_SIG_SCHEME_SM2 sm2; /* signing and anonymous signing */
TPMS_SIG_SCHEME_ECSCHNORR ecschnorr; /* signing and anonymous signing */
TPMS_SIG_SCHEME_EDDSA eddsa; /* signing and anonymous signing */
TPMS_ENC_SCHEME_RSAES rsaes; /* schemes with no hash */
TPMS_ENC_SCHEME_OAEP oaep; /* schemes with no hash */
TPMS_SCHEME_HASH anySig;
Expand Down Expand Up @@ -1706,6 +1732,7 @@ typedef TPMS_SIGNATURE_ECC TPMS_SIGNATURE_ECDSA;
typedef TPMS_SIGNATURE_ECC TPMS_SIGNATURE_ECDAA;
typedef TPMS_SIGNATURE_ECC TPMS_SIGNATURE_SM2;
typedef TPMS_SIGNATURE_ECC TPMS_SIGNATURE_ECSCHNORR;
typedef TPMS_SIGNATURE_ECC TPMS_SIGNATURE_EDDSA;

/* Definition of TPMU_SIGNATURE Union <INOUT S> */
typedef union TPMU_SIGNATURE TPMU_SIGNATURE;
Expand All @@ -1716,6 +1743,7 @@ union TPMU_SIGNATURE {
TPMS_SIGNATURE_ECDAA ecdaa; /* all asymmetric signatures */
TPMS_SIGNATURE_SM2 sm2; /* all asymmetric signatures */
TPMS_SIGNATURE_ECSCHNORR ecschnorr; /* all asymmetric signatures */
TPMS_SIGNATURE_EDDSA eddsa; /* all asymmetric signatures */
TPMT_HA hmac; /* HMAC signature required to be supported */
TPMS_SCHEME_HASH any; /* used to access the hash */
TPMS_EMPTY null; /* TPM2_ALG_NULL */
Expand Down
72 changes: 64 additions & 8 deletions src/tss2-mu/tpmu-types.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,24 @@ static TSS2_RC marshal_sm3_256(BYTE const *src, uint8_t buffer[],
return marshal_tab(src, buffer, buffer_size, offset, TPM2_SM3_256_DIGEST_SIZE);
}

static TSS2_RC marshal_hash_sha3_256(BYTE const *src, uint8_t buffer[],
size_t buffer_size, size_t *offset)
{
return marshal_tab(src, buffer, buffer_size, offset, TPM2_SHA3_256_DIGEST_SIZE);
}

static TSS2_RC marshal_hash_sha3_384(BYTE const *src, uint8_t buffer[],
size_t buffer_size, size_t *offset)
{
return marshal_tab(src, buffer, buffer_size, offset, TPM2_SHA3_384_DIGEST_SIZE);
}

static TSS2_RC marshal_hash_sha3_512(BYTE const *src, uint8_t buffer[],
size_t buffer_size, size_t *offset)
{
return marshal_tab(src, buffer, buffer_size, offset, TPM2_SHA3_512_DIGEST_SIZE);
}

static TSS2_RC marshal_ecc(BYTE const *src, uint8_t buffer[],
size_t buffer_size, size_t *offset)
{
Expand Down Expand Up @@ -197,6 +215,24 @@ static TSS2_RC unmarshal_sm3_256(uint8_t const buffer[], size_t buffer_size,
return unmarshal_tab(buffer, buffer_size, offset, dest, TPM2_SM3_256_DIGEST_SIZE);
}

static TSS2_RC unmarshal_hash_sha3_256(uint8_t const buffer[], size_t buffer_size,
size_t *offset, BYTE *dest)
{
return unmarshal_tab(buffer, buffer_size, offset, dest, TPM2_SHA3_256_DIGEST_SIZE);
}

static TSS2_RC unmarshal_hash_sha3_384(uint8_t const buffer[], size_t buffer_size,
size_t *offset, BYTE *dest)
{
return unmarshal_tab(buffer, buffer_size, offset, dest, TPM2_SHA3_384_DIGEST_SIZE);
}

static TSS2_RC unmarshal_hash_sha3_512(uint8_t const buffer[], size_t buffer_size,
size_t *offset, BYTE *dest)
{
return unmarshal_tab(buffer, buffer_size, offset, dest, TPM2_SHA3_512_DIGEST_SIZE);
}

static TSS2_RC unmarshal_ecc(uint8_t const buffer[], size_t buffer_size,
size_t *offset, BYTE *dest)
{
Expand Down Expand Up @@ -455,13 +491,19 @@ TPMU_MARSHAL2(TPMU_HA,
TPM2_ALG_SHA256, ADDR, sha256[0], marshal_hash_sha256,
TPM2_ALG_SHA384, ADDR, sha384[0], marshal_hash_sha384,
TPM2_ALG_SHA512, ADDR, sha512[0], marshal_hash_sha512,
TPM2_ALG_SM3_256, ADDR, sm3_256[0], marshal_sm3_256)
TPM2_ALG_SM3_256, ADDR, sm3_256[0], marshal_sm3_256,
TPM2_ALG_SHA3_256, ADDR, sha3_256[0], marshal_hash_sha3_256,
TPM2_ALG_SHA3_384, ADDR, sha3_384[0], marshal_hash_sha3_384,
TPM2_ALG_SHA3_512, ADDR, sha3_512[0], marshal_hash_sha3_512)
TPMU_UNMARSHAL2(TPMU_HA,
TPM2_ALG_SHA1, sha1[0], unmarshal_hash_sha,
TPM2_ALG_SHA256, sha256[0], unmarshal_hash_sha256,
TPM2_ALG_SHA384, sha384[0], unmarshal_hash_sha384,
TPM2_ALG_SHA512, sha512[0], unmarshal_hash_sha512,
TPM2_ALG_SM3_256, sm3_256[0], unmarshal_sm3_256)
TPM2_ALG_SM3_256, sm3_256[0], unmarshal_sm3_256,
TPM2_ALG_SHA3_256, sha3_256[0], unmarshal_hash_sha3_256,
TPM2_ALG_SHA3_384, sha3_384[0], unmarshal_hash_sha3_384,
TPM2_ALG_SHA3_512, sha3_512[0], unmarshal_hash_sha3_512)

TPMU_MARSHAL2(TPMU_CAPABILITIES,
TPM2_CAP_ALGS, ADDR, algorithms, Tss2_MU_TPML_ALG_PROPERTY_Marshal,
Expand Down Expand Up @@ -498,39 +540,45 @@ TPMU_MARSHAL2(TPMU_ATTEST,
TPM2_ST_ATTEST_COMMAND_AUDIT, ADDR, commandAudit, Tss2_MU_TPMS_COMMAND_AUDIT_INFO_Marshal,
TPM2_ST_ATTEST_SESSION_AUDIT, ADDR, sessionAudit, Tss2_MU_TPMS_SESSION_AUDIT_INFO_Marshal,
TPM2_ST_ATTEST_TIME, ADDR, time, Tss2_MU_TPMS_TIME_ATTEST_INFO_Marshal,
TPM2_ST_ATTEST_NV, ADDR, nv, Tss2_MU_TPMS_NV_CERTIFY_INFO_Marshal)
TPM2_ST_ATTEST_NV, ADDR, nv, Tss2_MU_TPMS_NV_CERTIFY_INFO_Marshal,
TPM2_ST_ATTEST_NV_DIGEST, ADDR, nvDigest, Tss2_MU_TPMS_NV_DIGEST_CERTIFY_INFO_Marshal)
TPMU_UNMARSHAL2(TPMU_ATTEST,
TPM2_ST_ATTEST_CERTIFY, certify, Tss2_MU_TPMS_CERTIFY_INFO_Unmarshal,
TPM2_ST_ATTEST_CREATION, creation, Tss2_MU_TPMS_CREATION_INFO_Unmarshal,
TPM2_ST_ATTEST_QUOTE, quote, Tss2_MU_TPMS_QUOTE_INFO_Unmarshal,
TPM2_ST_ATTEST_COMMAND_AUDIT, commandAudit, Tss2_MU_TPMS_COMMAND_AUDIT_INFO_Unmarshal,
TPM2_ST_ATTEST_SESSION_AUDIT, sessionAudit, Tss2_MU_TPMS_SESSION_AUDIT_INFO_Unmarshal,
TPM2_ST_ATTEST_TIME, time, Tss2_MU_TPMS_TIME_ATTEST_INFO_Unmarshal,
TPM2_ST_ATTEST_NV, nv, Tss2_MU_TPMS_NV_CERTIFY_INFO_Unmarshal)
TPM2_ST_ATTEST_NV, nv, Tss2_MU_TPMS_NV_CERTIFY_INFO_Unmarshal,
TPM2_ST_ATTEST_NV_DIGEST, nvDigest, Tss2_MU_TPMS_NV_DIGEST_CERTIFY_INFO_Unmarshal)

TPMU_MARSHAL2(TPMU_SYM_KEY_BITS,
TPM2_ALG_AES, VAL, aes, Tss2_MU_UINT16_Marshal,
TPM2_ALG_SM4, VAL, sm4, Tss2_MU_UINT16_Marshal,
TPM2_ALG_CAMELLIA, VAL, camellia, Tss2_MU_UINT16_Marshal,
TPM2_ALG_TDES, VAL, tdes, Tss2_MU_UINT16_Marshal,
TPM2_ALG_XOR, VAL, exclusiveOr, Tss2_MU_UINT16_Marshal,
TPM2_ALG_SYMCIPHER, VAL, sym, Tss2_MU_UINT16_Marshal)
TPMU_UNMARSHAL2(TPMU_SYM_KEY_BITS,
TPM2_ALG_AES, aes, Tss2_MU_UINT16_Unmarshal,
TPM2_ALG_SM4, sm4, Tss2_MU_UINT16_Unmarshal,
TPM2_ALG_CAMELLIA, camellia, Tss2_MU_UINT16_Unmarshal,
TPM2_ALG_TDES, tdes, Tss2_MU_UINT16_Unmarshal,
TPM2_ALG_XOR, exclusiveOr, Tss2_MU_UINT16_Unmarshal,
TPM2_ALG_SYMCIPHER, sym, Tss2_MU_UINT16_Unmarshal)

TPMU_MARSHAL2(TPMU_SYM_MODE,
TPM2_ALG_AES, VAL, aes, Tss2_MU_UINT16_Marshal,
TPM2_ALG_SM4, VAL, sm4, Tss2_MU_UINT16_Marshal,
TPM2_ALG_CAMELLIA, VAL, camellia, Tss2_MU_UINT16_Marshal,
TPM2_ALG_TDES, VAL, tdes, Tss2_MU_UINT16_Marshal,
TPM2_ALG_XOR, ADDR, sym, marshal_null,
TPM2_ALG_SYMCIPHER, VAL, sym, Tss2_MU_UINT16_Marshal)
TPMU_UNMARSHAL2(TPMU_SYM_MODE,
TPM2_ALG_AES, aes, Tss2_MU_UINT16_Unmarshal,
TPM2_ALG_SM4, sm4, Tss2_MU_UINT16_Unmarshal,
TPM2_ALG_CAMELLIA, camellia, Tss2_MU_UINT16_Unmarshal,
TPM2_ALG_TDES, tdes, Tss2_MU_UINT16_Unmarshal,
TPM2_ALG_XOR, sym, unmarshal_null,
TPM2_ALG_SYMCIPHER, sym, Tss2_MU_UINT16_Unmarshal)

Expand All @@ -541,6 +589,7 @@ TPMU_MARSHAL2(TPMU_SIG_SCHEME,
TPM2_ALG_ECDAA, ADDR, ecdaa, Tss2_MU_TPMS_SCHEME_ECDAA_Marshal,
TPM2_ALG_SM2, ADDR, sm2, Tss2_MU_TPMS_SCHEME_HASH_Marshal,
TPM2_ALG_ECSCHNORR, ADDR, ecschnorr, Tss2_MU_TPMS_SCHEME_HASH_Marshal,
TPM2_ALG_EDDSA, ADDR, eddsa, Tss2_MU_TPMS_SCHEME_HASH_Marshal,
TPM2_ALG_HMAC, ADDR, hmac, Tss2_MU_TPMS_SCHEME_HASH_Marshal)
TPMU_UNMARSHAL2(TPMU_SIG_SCHEME,
TPM2_ALG_RSASSA, rsassa, Tss2_MU_TPMS_SCHEME_HASH_Unmarshal,
Expand All @@ -549,16 +598,19 @@ TPMU_UNMARSHAL2(TPMU_SIG_SCHEME,
TPM2_ALG_ECDAA, ecdaa, Tss2_MU_TPMS_SCHEME_ECDAA_Unmarshal,
TPM2_ALG_SM2, sm2, Tss2_MU_TPMS_SCHEME_HASH_Unmarshal,
TPM2_ALG_ECSCHNORR, ecschnorr, Tss2_MU_TPMS_SCHEME_HASH_Unmarshal,
TPM2_ALG_EDDSA, eddsa, Tss2_MU_TPMS_SCHEME_HASH_Unmarshal,
TPM2_ALG_HMAC, hmac, Tss2_MU_TPMS_SCHEME_HASH_Unmarshal)

TPMU_MARSHAL2(TPMU_KDF_SCHEME,
TPM2_ALG_MGF1, ADDR, mgf1, Tss2_MU_TPMS_SCHEME_HASH_Marshal,
TPM2_ALG_KDF1_SP800_56A, ADDR, kdf1_sp800_56a, Tss2_MU_TPMS_SCHEME_HASH_Marshal,
TPM2_ALG_KDF1_SP800_108, ADDR, kdf1_sp800_108, Tss2_MU_TPMS_SCHEME_HASH_Marshal)
TPM2_ALG_KDF1_SP800_108, ADDR, kdf1_sp800_108, Tss2_MU_TPMS_SCHEME_HASH_Marshal,
TPM2_ALG_KDF2, ADDR, kdf2, Tss2_MU_TPMS_SCHEME_HASH_Marshal)
TPMU_UNMARSHAL2(TPMU_KDF_SCHEME,
TPM2_ALG_MGF1, mgf1, Tss2_MU_TPMS_SCHEME_HASH_Unmarshal,
TPM2_ALG_KDF1_SP800_56A, kdf1_sp800_56a, Tss2_MU_TPMS_SCHEME_HASH_Unmarshal,
TPM2_ALG_KDF1_SP800_108, kdf1_sp800_108, Tss2_MU_TPMS_SCHEME_HASH_Unmarshal)
TPM2_ALG_KDF1_SP800_108, kdf1_sp800_108, Tss2_MU_TPMS_SCHEME_HASH_Unmarshal,
TPM2_ALG_KDF2, kdf2, Tss2_MU_TPMS_SCHEME_HASH_Unmarshal)

TPMU_MARSHAL2(TPMU_ASYM_SCHEME,
TPM2_ALG_ECDH, ADDR, ecdh, Tss2_MU_TPMS_SCHEME_HASH_Marshal,
Expand All @@ -570,7 +622,8 @@ TPMU_MARSHAL2(TPMU_ASYM_SCHEME,
TPM2_ALG_SM2, ADDR, sm2, Tss2_MU_TPMS_SCHEME_HASH_Marshal,
TPM2_ALG_ECSCHNORR, ADDR, ecschnorr, Tss2_MU_TPMS_SCHEME_HASH_Marshal,
TPM2_ALG_RSAES, ADDR, rsaes, marshal_null,
TPM2_ALG_OAEP, ADDR, oaep, Tss2_MU_TPMS_SCHEME_HASH_Marshal)
TPM2_ALG_OAEP, ADDR, oaep, Tss2_MU_TPMS_SCHEME_HASH_Marshal,
TPM2_ALG_EDDSA, ADDR, eddsa, Tss2_MU_TPMS_SCHEME_HASH_Marshal)
TPMU_UNMARSHAL2(TPMU_ASYM_SCHEME,
TPM2_ALG_ECDH, ecdh, Tss2_MU_TPMS_SCHEME_HASH_Unmarshal,
TPM2_ALG_ECMQV, ecmqv, Tss2_MU_TPMS_SCHEME_HASH_Unmarshal,
Expand All @@ -581,7 +634,8 @@ TPMU_UNMARSHAL2(TPMU_ASYM_SCHEME,
TPM2_ALG_SM2, sm2, Tss2_MU_TPMS_SCHEME_HASH_Unmarshal,
TPM2_ALG_ECSCHNORR, ecschnorr, Tss2_MU_TPMS_SCHEME_HASH_Unmarshal,
TPM2_ALG_RSAES, rsaes, unmarshal_null,
TPM2_ALG_OAEP, oaep, Tss2_MU_TPMS_SCHEME_HASH_Unmarshal)
TPM2_ALG_OAEP, oaep, Tss2_MU_TPMS_SCHEME_HASH_Unmarshal,
TPM2_ALG_EDDSA, eddsa, Tss2_MU_TPMS_SCHEME_HASH_Unmarshal)

TPMU_MARSHAL2(TPMU_SCHEME_KEYEDHASH,
TPM2_ALG_HMAC, ADDR, hmac, Tss2_MU_TPMS_SCHEME_HASH_Marshal,
Expand All @@ -597,6 +651,7 @@ TPMU_MARSHAL2(TPMU_SIGNATURE,
TPM2_ALG_ECDAA, ADDR, ecdaa, Tss2_MU_TPMS_SIGNATURE_ECC_Marshal,
TPM2_ALG_SM2, ADDR, sm2, Tss2_MU_TPMS_SIGNATURE_ECC_Marshal,
TPM2_ALG_ECSCHNORR, ADDR, ecschnorr, Tss2_MU_TPMS_SIGNATURE_ECC_Marshal,
TPM2_ALG_EDDSA, ADDR, eddsa, Tss2_MU_TPMS_SIGNATURE_ECC_Marshal,
TPM2_ALG_HMAC, ADDR, hmac, Tss2_MU_TPMT_HA_Marshal)
TPMU_UNMARSHAL2(TPMU_SIGNATURE,
TPM2_ALG_RSASSA, rsassa, Tss2_MU_TPMS_SIGNATURE_RSA_Unmarshal,
Expand All @@ -605,6 +660,7 @@ TPMU_UNMARSHAL2(TPMU_SIGNATURE,
TPM2_ALG_ECDAA, ecdaa, Tss2_MU_TPMS_SIGNATURE_ECC_Unmarshal,
TPM2_ALG_SM2, sm2, Tss2_MU_TPMS_SIGNATURE_ECC_Unmarshal,
TPM2_ALG_ECSCHNORR, ecschnorr, Tss2_MU_TPMS_SIGNATURE_ECC_Unmarshal,
TPM2_ALG_EDDSA, eddsa, Tss2_MU_TPMS_SIGNATURE_ECC_Unmarshal,
TPM2_ALG_HMAC, hmac, Tss2_MU_TPMT_HA_Unmarshal)

TPMU_MARSHAL2(TPMU_SENSITIVE_COMPOSITE,
Expand Down

0 comments on commit 92a3e24

Please sign in to comment.