implementation.h: Remove preprocessor magic to selectively enable algorithms.
We should be supporting all algorithms. The TPM will reject and
algorithm identifiers that it doesn't support. Our only job is to send /
create TPM2 command buffers and receive / parse TPM2 response buffers.
Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
diff --git a/include/sapi/implementation.h b/include/sapi/implementation.h
index e4e3296..9985bd8 100644
--- a/include/sapi/implementation.h
+++ b/include/sapi/implementation.h
@@ -38,9 +38,6 @@
#undef TRUE
#undef FALSE
-// This table is built in to TpmStructures() Change these definitions to turn all algorithms or commands on or off
-#define ALG_YES YES
-#define ALG_NO NO
#define CC_YES YES
#define CC_NO NO
@@ -59,41 +56,6 @@
#define LITTLE_ENDIAN_TPM YES /* to YES or NO according to the processor */
#define NO_AUTO_ALIGN NO /* to YES if the processor does not allow unaligned accesses */
-// From Vendor-Specific: Table 2 - Defines for Implemented Algorithms
-
-#define ALG_RSA ALG_YES
-#define ALG_SHA1 ALG_YES
-#define ALG_HMAC ALG_YES
-#define ALG_AES ALG_YES
-#define ALG_MGF1 ALG_YES
-#define ALG_XOR ALG_YES
-#define ALG_KEYEDHASH ALG_YES
-#define ALG_SHA256 ALG_YES
-#define ALG_SHA384 ALG_YES
-#define ALG_SHA512 ALG_YES
-#define ALG_SM3_256 ALG_YES
-#define ALG_SM4 ALG_YES
-#define ALG_RSASSA (ALG_YES*ALG_RSA)
-#define ALG_RSAES (ALG_YES*ALG_RSA)
-#define ALG_RSAPSS (ALG_YES*ALG_RSA)
-#define ALG_OAEP (ALG_YES*ALG_RSA)
-#define ALG_ECC ALG_YES
-#define ALG_ECDH (ALG_YES*ALG_ECC)
-#define ALG_ECDSA (ALG_YES*ALG_ECC)
-#define ALG_ECDAA (ALG_YES*ALG_ECC)
-#define ALG_SM2 (ALG_YES*ALG_ECC)
-#define ALG_ECSCHNORR (ALG_YES*ALG_ECC)
-#define ALG_ECMQV (ALG_NO*ALG_ECC)
-#define ALG_SYMCIPHER ALG_YES
-#define ALG_KDF1_SP800_56A (ALG_YES*ALG_ECC)
-#define ALG_KDF2 ALG_NO
-#define ALG_KDF1_SP800_108 ALG_YES
-#define ALG_CTR ALG_YES
-#define ALG_OFB ALG_YES
-#define ALG_CBC ALG_YES
-#define ALG_CFB ALG_YES
-#define ALG_ECB ALG_YES
-
// From Vendor-Specific: Table 4 - Defines for Key Size Constants
#define RSA_KEY_SIZES_BITS {1024,2048}
@@ -146,7 +108,7 @@
#define CC_ClearControl CC_YES
#define CC_ClockRateAdjust CC_YES
#define CC_ClockSet CC_YES
-#define CC_Commit (CC_YES*ALG_ECC)
+#define CC_Commit CC_YES
#define CC_ContextLoad CC_YES
#define CC_ContextSave CC_YES
#define CC_Create CC_YES
@@ -154,9 +116,9 @@
#define CC_DictionaryAttackLockReset CC_YES
#define CC_DictionaryAttackParameters CC_YES
#define CC_Duplicate CC_YES
-#define CC_ECC_Parameters (CC_YES*ALG_ECC)
-#define CC_ECDH_KeyGen (CC_YES*ALG_ECC)
-#define CC_ECDH_ZGen (CC_YES*ALG_ECC)
+#define CC_ECC_Parameters CC_YES
+#define CC_ECDH_KeyGen CC_YES
+#define CC_ECDH_ZGen CC_YES
#define CC_EncryptDecrypt CC_YES
#define CC_EventSequenceComplete CC_YES
#define CC_EvictControl CC_YES
@@ -226,8 +188,8 @@
#define CC_ReadClock CC_YES
#define CC_ReadPublic CC_YES
#define CC_Rewrap CC_YES
-#define CC_RSA_Decrypt (CC_YES*ALG_RSA)
-#define CC_RSA_Encrypt (CC_YES*ALG_RSA)
+#define CC_RSA_Decrypt CC_YES
+#define CC_RSA_Encrypt CC_YES
#define CC_SelfTest CC_YES
#define CC_SequenceComplete CC_YES
#define CC_SequenceUpdate CC_YES
@@ -242,8 +204,8 @@
#define CC_TestParms CC_YES
#define CC_Unseal CC_YES
#define CC_VerifySignature CC_YES
-#define CC_ZGen_2Phase (CC_YES*ALG_ECC)
-#define CC_EC_Ephemeral (CC_YES*ALG_ECC)
+#define CC_ZGen_2Phase CC_YES
+#define CC_EC_Ephemeral CC_YES
#define CC_PolicyNvWritten CC_YES
#define CC_Vendor_TCG_Test CC_YES
@@ -322,161 +284,46 @@
typedef UINT16 TPM_ALG_ID;
#define TPM_ALG_ERROR (TPM_ALG_ID)(0x0000)
-#define ALG_ERROR_VALUE 0x0000
-#if defined ALG_RSA && ALG_RSA == YES
#define TPM_ALG_RSA (TPM_ALG_ID)(0x0001)
-#endif
-#define ALG_RSA_VALUE 0x0001
-#if defined ALG_SHA && ALG_SHA == YES
#define TPM_ALG_SHA (TPM_ALG_ID)(0x0004)
-#endif
-#define ALG_SHA_VALUE 0x0004
-#if defined ALG_SHA1 && ALG_SHA1 == YES
#define TPM_ALG_SHA1 (TPM_ALG_ID)(0x0004)
-#endif
-#define ALG_SHA1_VALUE 0x0004
-#if defined ALG_HMAC && ALG_HMAC == YES
#define TPM_ALG_HMAC (TPM_ALG_ID)(0x0005)
-#endif
-#define ALG_HMAC_VALUE 0x0005
-#if defined ALG_AES && ALG_AES == YES
#define TPM_ALG_AES (TPM_ALG_ID)(0x0006)
-#endif
-#define ALG_AES_VALUE 0x0006
-#if defined ALG_MGF1 && ALG_MGF1 == YES
#define TPM_ALG_MGF1 (TPM_ALG_ID)(0x0007)
-#endif
-#define ALG_MGF1_VALUE 0x0007
-#if defined ALG_KEYEDHASH && ALG_KEYEDHASH == YES
#define TPM_ALG_KEYEDHASH (TPM_ALG_ID)(0x0008)
-#endif
-#define ALG_KEYEDHASH_VALUE 0x0008
-#if defined ALG_XOR && ALG_XOR == YES
#define TPM_ALG_XOR (TPM_ALG_ID)(0x000A)
-#endif
-#define ALG_XOR_VALUE 0x000A
-#if defined ALG_SHA256 && ALG_SHA256 == YES
#define TPM_ALG_SHA256 (TPM_ALG_ID)(0x000B)
-#endif
-#define ALG_SHA256_VALUE 0x000B
-#if defined ALG_SHA384 && ALG_SHA384 == YES
#define TPM_ALG_SHA384 (TPM_ALG_ID)(0x000C)
-#endif
-#define ALG_SHA384_VALUE 0x000C
-#if defined ALG_SHA512 && ALG_SHA512 == YES
#define TPM_ALG_SHA512 (TPM_ALG_ID)(0x000D)
-#endif
-#define ALG_SHA512_VALUE 0x000D
#define TPM_ALG_NULL (TPM_ALG_ID)(0x0010)
-#define ALG_NULL_VALUE 0x0010
-#if defined ALG_SM3_256 && ALG_SM3_256 == YES
#define TPM_ALG_SM3_256 (TPM_ALG_ID)(0x0012)
-#endif
-#define ALG_SM3_256_VALUE 0x0012
-#if defined ALG_SM4 && ALG_SM4 == YES
#define TPM_ALG_SM4 (TPM_ALG_ID)(0x0013)
-#endif
-#define ALG_SM4_VALUE 0x0013
-#if defined ALG_RSASSA && ALG_RSASSA == YES
#define TPM_ALG_RSASSA (TPM_ALG_ID)(0x0014)
-#endif
-#define ALG_RSASSA_VALUE 0x0014
-#if defined ALG_RSAES && ALG_RSAES == YES
#define TPM_ALG_RSAES (TPM_ALG_ID)(0x0015)
-#endif
-#define ALG_RSAES_VALUE 0x0015
-#if defined ALG_RSAPSS && ALG_RSAPSS == YES
#define TPM_ALG_RSAPSS (TPM_ALG_ID)(0x0016)
-#endif
-#define ALG_RSAPSS_VALUE 0x0016
-#if defined ALG_OAEP && ALG_OAEP == YES
#define TPM_ALG_OAEP (TPM_ALG_ID)(0x0017)
-#endif
-#define ALG_OAEP_VALUE 0x0017
-#if defined ALG_ECDSA && ALG_ECDSA == YES
#define TPM_ALG_ECDSA (TPM_ALG_ID)(0x0018)
-#endif
-#define ALG_ECDSA_VALUE 0x0018
-#if defined ALG_ECDH && ALG_ECDH == YES
#define TPM_ALG_ECDH (TPM_ALG_ID)(0x0019)
-#endif
-#define ALG_ECDH_VALUE 0x0019
-#if defined ALG_ECDAA && ALG_ECDAA == YES
#define TPM_ALG_ECDAA (TPM_ALG_ID)(0x001A)
-#endif
-#define ALG_ECDAA_VALUE 0x001A
-#if defined ALG_SM2 && ALG_SM2 == YES
#define TPM_ALG_SM2 (TPM_ALG_ID)(0x001B)
-#endif
-#define ALG_SM2_VALUE 0x001B
-#if defined ALG_ECSCHNORR && ALG_ECSCHNORR == YES
#define TPM_ALG_ECSCHNORR (TPM_ALG_ID)(0x001C)
-#endif
-#define ALG_ECSCHNORR_VALUE 0x001C
-#if defined ALG_ECMQV && ALG_ECMQV == YES
#define TPM_ALG_ECMQV (TPM_ALG_ID)(0x001D)
-#endif
-#define ALG_ECMQV_VALUE 0x001D
-#if defined ALG_KDF1_SP800_56A && ALG_KDF1_SP800_56A == YES
#define TPM_ALG_KDF1_SP800_56A (TPM_ALG_ID)(0x0020)
-#endif
-#define ALG_KDF1_SP800_56A_VALUE 0x0020
-#if defined ALG_KDF2 && ALG_KDF2 == YES
#define TPM_ALG_KDF2 (TPM_ALG_ID)(0x0021)
-#endif
-#define ALG_KDF2_VALUE 0x0021
-#if defined ALG_KDF1_SP800_108 && ALG_KDF1_SP800_108 == YES
#define TPM_ALG_KDF1_SP800_108 (TPM_ALG_ID)(0x0022)
-#endif
-#define ALG_KDF1_SP800_108_VALUE 0x0022
-#if defined ALG_ECC && ALG_ECC == YES
#define TPM_ALG_ECC (TPM_ALG_ID)(0x0023)
-#endif
-#define ALG_ECC_VALUE 0x0023
-#if defined ALG_SYMCIPHER && ALG_SYMCIPHER == YES
#define TPM_ALG_SYMCIPHER (TPM_ALG_ID)(0x0025)
-#endif
-#define ALG_SYMCIPHER_VALUE 0x0025
-#if defined ALG_CAMELLIA && ALG_CAMELLIA == YES
#define TPM_ALG_CAMELLIA (TPM_ALG_ID)(0x0026)
-#endif
-#define ALG_CAMELLIA_VALUE 0x0026
-#if defined ALG_CTR && ALG_CTR == YES
#define TPM_ALG_CTR (TPM_ALG_ID)(0x0040)
-#endif
-#if defined ALG_SHA3_256 && ALG_SHA3_256 == YES
#define TPM_ALG_SHA3_256 (TPM_ALG_ID)0x27
-#endif
-#define ALG_SHA3_256_VALUE 0x27
-#if defined ALG_SHA3_384 && ALG_SHA3_384 == YES
#define TPM_ALG_SHA3_384 (TPM_ALG_ID)0x28
-#endif
-#define ALG_SHA3_384_VALUE 0x28
-#if defined ALG_SHA3_512 && ALG_SHA3_512 == YES
#define TPM_ALG_SHA3_512 (TPM_ALG_ID)0x29
-#endif
-#define ALG_SHA3_512_VALUE 0x29
-#define ALG_CTR_VALUE 0x0040
-#if defined ALG_OFB && ALG_OFB == YES
#define TPM_ALG_OFB (TPM_ALG_ID)(0x0041)
-#endif
-#define ALG_OFB_VALUE 0x0041
-#if defined ALG_CBC && ALG_CBC == YES
#define TPM_ALG_CBC (TPM_ALG_ID)(0x0042)
-#endif
-#define ALG_CBC_VALUE 0x0042
-#if defined ALG_CFB && ALG_CFB == YES
#define TPM_ALG_CFB (TPM_ALG_ID)(0x0043)
-#endif
-#define ALG_CFB_VALUE 0x0043
-#if defined ALG_ECB && ALG_ECB == YES
#define TPM_ALG_ECB (TPM_ALG_ID)(0x0044)
-#endif
-#define ALG_ECB_VALUE 0x0044
#define TPM_ALG_FIRST (TPM_ALG_ID)(0x0001)
-#define ALG_FIRST_VALUE 0x0001
#define TPM_ALG_LAST (TPM_ALG_ID)(0x0044)
-#define ALG_LAST_VALUE 0x0044
// From TCG Algorithm Registry: Table 3 - Definition of TPM_ECC_CURVE Constants
typedef UINT16 TPM_ECC_CURVE;
@@ -1355,74 +1202,43 @@
#endif
#define MAX_HASH_BLOCK_SIZE ( \
- MAX(ALG_SHA1 * SHA1_BLOCK_SIZE, \
- MAX(ALG_SHA256 * SHA256_BLOCK_SIZE, \
- MAX(ALG_SHA384 * SHA384_BLOCK_SIZE, \
- MAX(ALG_SM3_256 * SM3_256_BLOCK_SIZE, \
- MAX(ALG_SHA512 * SHA512_BLOCK_SIZE, \
+ MAX(SHA1_BLOCK_SIZE, \
+ MAX(SHA256_BLOCK_SIZE, \
+ MAX(SHA384_BLOCK_SIZE, \
+ MAX(SM3_256_BLOCK_SIZE, \
+ MAX(SHA512_BLOCK_SIZE, \
0 ))))))
#define MAX_DIGEST_SIZE ( \
- MAX(ALG_SHA1 * SHA1_DIGEST_SIZE, \
- MAX(ALG_SHA256 * SHA256_DIGEST_SIZE, \
- MAX(ALG_SHA384 * SHA384_DIGEST_SIZE, \
- MAX(ALG_SM3_256 * SM3_256_DIGEST_SIZE, \
- MAX(ALG_SHA512 * SHA512_DIGEST_SIZE, \
+ MAX(SHA1_DIGEST_SIZE, \
+ MAX(SHA256_DIGEST_SIZE, \
+ MAX(SHA384_DIGEST_SIZE, \
+ MAX(SM3_256_DIGEST_SIZE, \
+ MAX(SHA512_DIGEST_SIZE, \
0 ))))))
#if MAX_DIGEST_SIZE == 0 || MAX_HASH_BLOCK_SIZE == 0
#error "Hash data not valid"
#endif
-#define HASH_COUNT (ALG_SHA1+ALG_SHA256+ALG_SHA384+ALG_SM3_256+ALG_SHA512)
+#define HASH_COUNT 5
TPM2B_TYPE(MAX_HASH_BLOCK, MAX_HASH_BLOCK_SIZE);
-// Following typedef is for some old code
-
-typedef TPM2B_MAX_HASH_BLOCK TPM2B_HASH_BLOCK;
-
#ifndef MAX
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#endif
-#ifndef ALG_CAMELLIA
-# define ALG_CAMELLIA NO
-#endif
-
-#ifndef MAX_CAMELLIA_KEY_BITS
-# define MAX_CAMELLIA_KEY_BITS 0
-# define MAX_CAMELLIA_BLOCK_SIZE_BYTES 0
-#endif
-
-#ifndef ALG_SM4
-# define ALG_SM4 NO
-#endif
-
-#ifndef MAX_SM4_KEY_BITS
-# define MAX_SM4_KEY_BITS 0
-# define MAX_SM4_BLOCK_SIZE_BYTES 0
-#endif
-
-#ifndef ALG_AES
-# define ALG_AES NO
-#endif
-
-#ifndef MAX_AES_KEY_BITS
-# define MAX_AES_KEY_BITS 0
-# define MAX_AES_BLOCK_SIZE_BYTES 0
-#endif
-
#define MAX_SYM_KEY_BITS ( \
- MAX(MAX_CAMELLIA_KEY_BITS * ALG_CAMELLIA, \
- MAX(MAX_SM4_KEY_BITS * ALG_SM4, \
- MAX(MAX_AES_KEY_BITS * ALG_AES, \
+ MAX(MAX_CAMELLIA_KEY_BITS, \
+ MAX(MAX_SM4_KEY_BITS, \
+ MAX(MAX_AES_KEY_BITS, \
0))))
#define MAX_SYM_KEY_BYTES ((MAX_SYM_KEY_BITS + 7) / 8)
#define MAX_SYM_BLOCK_SIZE ( \
- MAX(MAX_CAMELLIA_BLOCK_SIZE_BYTES * ALG_CAMELLIA, \
- MAX(MAX_SM4_BLOCK_SIZE_BYTES * ALG_SM4, \
- MAX(MAX_AES_BLOCK_SIZE_BYTES * ALG_AES, \
+ MAX(MAX_CAMELLIA_BLOCK_SIZE_BYTES, \
+ MAX(MAX_SM4_BLOCK_SIZE_BYTES, \
+ MAX(MAX_AES_BLOCK_SIZE_BYTES, \
0))))
#if MAX_SYM_KEY_BITS == 0 || MAX_SYM_BLOCK_SIZE == 0
# error Bad size for MAX_SYM_KEY_BITS or MAX_SYM_BLOCK_SIZE
diff --git a/include/sapi/tss2_tpm2_types.h b/include/sapi/tss2_tpm2_types.h
index b908d60..5d83343 100644
--- a/include/sapi/tss2_tpm2_types.h
+++ b/include/sapi/tss2_tpm2_types.h
@@ -41,7 +41,7 @@
#define CLEAR 0
#define MAX_CAP_DATA (MAX_CAP_BUFFER-sizeof(TPM_CAP)-sizeof(UINT32))
-#define MAX_CAP_ALGS (ALG_LAST_VALUE - ALG_FIRST_VALUE + 1)
+#define MAX_CAP_ALGS (TPM_ALG_LAST - TPM_ALG_FIRST + 1)
#define MAX_CAP_HANDLES (MAX_CAP_DATA/sizeof(TPM_HANDLE))
#define MAX_CAP_CC (COMMAND_COUNT)
#define MAX_TPM_PROPERTIES (MAX_CAP_DATA/sizeof(TPMS_TAGGED_PROPERTY))
@@ -987,24 +987,11 @@
/* Table 70 Definition of TPMU_HA Union <INOUT S> */
typedef union {
-#ifdef TPM_ALG_SHA
- BYTE sha[SHA_DIGEST_SIZE]; /* all hashes */
-#endif
-#ifdef TPM_ALG_SHA1
BYTE sha1[SHA1_DIGEST_SIZE]; /* all hashes */
-#endif
-#ifdef TPM_ALG_SHA256
BYTE sha256[SHA256_DIGEST_SIZE]; /* all hashes */
-#endif
-#ifdef TPM_ALG_SHA384
BYTE sha384[SHA384_DIGEST_SIZE]; /* all hashes */
-#endif
-#ifdef TPM_ALG_SHA512
BYTE sha512[SHA512_DIGEST_SIZE]; /* all hashes */
-#endif
-#ifdef TPM_ALG_SM3_256
BYTE sm3_256[SM3_256_DIGEST_SIZE]; /* all hashes */
-#endif
} TPMU_HA;
/* Table 71 Definition of TPMT_HA Structure <INOUT> */
@@ -1313,30 +1300,18 @@
/* Table 125 Definition of TPMU_SYM_KEY_BITS Union */
typedef union {
-#ifdef TPM_ALG_AES
TPMI_AES_KEY_BITS aes; /* all symmetric algorithms */
-#endif
-#ifdef TPM_ALG_SM4
TPMI_SM4_KEY_BITS sm4; /* all symmetric algorithms */
-#endif
-#ifdef TPM_ALG_CAMELLIA
TPMI_CAMELLIA_KEY_BITS camellia; /* all symmetric algorithms */
-#endif
TPM_KEY_BITS sym; /* when selector may be any of the symmetric block ciphers */
TPMI_ALG_HASH exclusiveOr; /* overload for using xorNOTE TPM_ALG_NULL is not allowed */
} TPMU_SYM_KEY_BITS;
/* Table 126 Definition of TPMU_SYM_MODE Union */
typedef union {
-#ifdef TPM_ALG_AES
TPMI_ALG_SYM_MODE aes; /* */
-#endif
-#ifdef TPM_ALG_SM4
TPMI_ALG_SYM_MODE sm4; /* */
-#endif
-#ifdef TPM_ALG_CAMELLIA
TPMI_ALG_SYM_MODE camellia; /* */
-#endif
TPMI_ALG_SYM_MODE sym; /* when selector may be any of the symmetric block ciphers */
} TPMU_SYM_MODE;
@@ -1421,24 +1396,12 @@
/* Table 144 Definition of TPMU_SIG_SCHEME Union <INOUT S> */
typedef union {
-#ifdef TPM_ALG_RSASSA
TPMS_SIG_SCHEME_RSASSA rsassa; /* all signing schemes including anonymous schemes */
-#endif
-#ifdef TPM_ALG_RSAPSS
TPMS_SIG_SCHEME_RSAPSS rsapss; /* all signing schemes including anonymous schemes */
-#endif
-#ifdef TPM_ALG_ECDSA
TPMS_SIG_SCHEME_ECDSA ecdsa; /* all signing schemes including anonymous schemes */
-#endif
-#ifdef TPM_ALG_ECDAA
TPMS_SIG_SCHEME_ECDAA ecdaa; /* all signing schemes including anonymous schemes */
-#endif
-#ifdef TPM_ALG_SM2
TPMS_SIG_SCHEME_SM2 sm2; /* all signing schemes including anonymous schemes */
-#endif
-#ifdef TPM_ALG_ECSCHNORR
TPMS_SIG_SCHEME_ECSCHNORR ecschnorr; /* all signing schemes including anonymous schemes */
-#endif
TPMS_SCHEME_HMAC hmac; /* the HMAC scheme */
TPMS_SCHEME_HASH any; /* selector that allows access to digest for any signing scheme */
} TPMU_SIG_SCHEME;
@@ -1465,18 +1428,10 @@
/* Table 149 Definition of TPMU_KDF_SCHEME Union <INOUT S> */
typedef union {
-#ifdef TPM_ALG_MGF1
TPMS_SCHEME_MGF1 mgf1; /* */
-#endif
-#ifdef TPM_ALG_KDF1_SP800_56A
TPMS_SCHEME_KDF1_SP800_56A kdf1_sp800_56a; /* */
-#endif
-#ifdef TPM_ALG_KDF2
TPMS_SCHEME_KDF2 kdf2; /* */
-#endif
-#ifdef TPM_ALG_KDF1_SP800_108
TPMS_SCHEME_KDF1_SP800_108 kdf1_sp800_108; /* */
-#endif
} TPMU_KDF_SCHEME;
/* Table 150 Definition of TPMT_KDF_SCHEME Structure */
@@ -1490,36 +1445,16 @@
/* Table 152 Definition of TPMU_ASYM_SCHEME Union */
typedef union {
-#ifdef TPM_ALG_ECDH
TPMS_KEY_SCHEME_ECDH ecdh; /* */
-#endif
-#ifdef TPM_ALG_ECMQV
TPMS_KEY_SCHEME_ECMQV ecmqv; /* */
-#endif
-#ifdef TPM_ALG_RSASSA
TPMS_SIG_SCHEME_RSASSA rsassa; /* signing and anonymous signing */
-#endif
-#ifdef TPM_ALG_RSAPSS
TPMS_SIG_SCHEME_RSAPSS rsapss; /* signing and anonymous signing */
-#endif
-#ifdef TPM_ALG_ECDSA
TPMS_SIG_SCHEME_ECDSA ecdsa; /* signing and anonymous signing */
-#endif
-#ifdef TPM_ALG_ECDAA
TPMS_SIG_SCHEME_ECDAA ecdaa; /* signing and anonymous signing */
-#endif
-#ifdef TPM_ALG_SM2
TPMS_SIG_SCHEME_SM2 sm2; /* signing and anonymous signing */
-#endif
-#ifdef TPM_ALG_ECSCHNORR
TPMS_SIG_SCHEME_ECSCHNORR ecschnorr; /* signing and anonymous signing */
-#endif
-#ifdef TPM_ALG_RSAES
TPMS_ENC_SCHEME_RSAES rsaes; /* schemes with no hash */
-#endif
-#ifdef TPM_ALG_OAEP
TPMS_ENC_SCHEME_OAEP oaep; /* schemes with no hash */
-#endif
TPMS_SCHEME_HASH anySig; /* */
} TPMU_ASYM_SCHEME;
@@ -1620,24 +1555,12 @@
/* Table 172 Definition of TPMU_SIGNATURE Union <INOUT S> */
typedef union {
-#ifdef TPM_ALG_RSASSA
TPMS_SIGNATURE_RSASSA rsassa; /* all asymmetric signatures */
-#endif
-#ifdef TPM_ALG_RSAPSS
TPMS_SIGNATURE_RSAPSS rsapss; /* all asymmetric signatures */
-#endif
-#ifdef TPM_ALG_ECDSA
TPMS_SIGNATURE_ECDSA ecdsa; /* all asymmetric signatures */
-#endif
-#ifdef TPM_ALG_ECDAA
TPMS_SIGNATURE_ECDAA ecdaa; /* all asymmetric signatures */
-#endif
-#ifdef TPM_ALG_SM2
TPMS_SIGNATURE_SM2 sm2; /* all asymmetric signatures */
-#endif
-#ifdef TPM_ALG_ECSCHNORR
TPMS_SIGNATURE_ECSCHNORR ecschnorr; /* all asymmetric signatures */
-#endif
TPMT_HA hmac; /* HMAC signature required to be supported */
TPMS_SCHEME_HASH any; /* used to access the hash */
} TPMU_SIGNATURE;
diff --git a/sysapi/sysapi_util/GetDigestSize.c b/sysapi/sysapi_util/GetDigestSize.c
index a192df4..27e65bc 100644
--- a/sysapi/sysapi_util/GetDigestSize.c
+++ b/sysapi/sysapi_util/GetDigestSize.c
@@ -37,12 +37,8 @@
HASH_SIZE_INFO hashSizes[] = {
{TPM_ALG_SHA1, SHA1_DIGEST_SIZE},
{TPM_ALG_SHA256, SHA256_DIGEST_SIZE},
-#ifdef TPM_ALG_SHA384
{TPM_ALG_SHA384, SHA384_DIGEST_SIZE},
-#endif
-#ifdef TPM_ALG_SHA512
{TPM_ALG_SHA512, SHA512_DIGEST_SIZE},
-#endif
{TPM_ALG_SM3_256, SM3_256_DIGEST_SIZE},
{TPM_ALG_NULL,0}
};
diff --git a/sysapi/sysapi_util/Marshal_TPMU_ASYM_SCHEME.c b/sysapi/sysapi_util/Marshal_TPMU_ASYM_SCHEME.c
index bd2444a..0dce118 100644
--- a/sysapi/sysapi_util/Marshal_TPMU_ASYM_SCHEME.c
+++ b/sysapi/sysapi_util/Marshal_TPMU_ASYM_SCHEME.c
@@ -39,60 +39,38 @@
switch( selector )
{
-#ifdef TPM_ALG_ECDH
case TPM_ALG_ECDH:
Marshal_TPMS_KEY_SCHEME_ECDH( sysContext, &asymScheme->ecdh );
break;
-#endif
-#ifdef TPM_ALG_ECMQV
case TPM_ALG_ECMQV:
Marshal_TPMS_KEY_SCHEME_ECMQV( sysContext, &asymScheme->ecmqv );
break;
-#endif
-#ifdef TPM_ALG_RSASSA
case TPM_ALG_RSASSA:
Marshal_TPMS_SIG_SCHEME_RSASSA( sysContext, &asymScheme->rsassa );
break;
-#endif
-#ifdef TPM_ALG_RSAPSS
case TPM_ALG_RSAPSS:
Marshal_TPMS_SIG_SCHEME_RSAPSS( sysContext, &asymScheme->rsapss );
break;
-#endif
-#ifdef TPM_ALG_ECDSA
case TPM_ALG_ECDSA:
Marshal_TPMS_SIG_SCHEME_ECDSA( sysContext, &asymScheme->ecdsa );
break;
-#endif
-#ifdef TPM_ALG_ECDAA
case TPM_ALG_ECDAA:
Marshal_TPMS_SIG_SCHEME_ECDAA( sysContext, &asymScheme->ecdaa );
break;
-#endif
-#ifdef TPM_ALG_SM2
case TPM_ALG_SM2:
Marshal_TPMS_SIG_SCHEME_SM2( sysContext, &asymScheme->sm2 );
break;
-#endif
-#ifdef TPM_ALG_ECSCHNORR
case TPM_ALG_ECSCHNORR:
Marshal_TPMS_SIG_SCHEME_ECSCHNORR( sysContext, &asymScheme->ecschnorr );
break;
-#endif
-#ifdef TPM_ALG_RSAES
case TPM_ALG_RSAES:
Marshal_TPMS_ENC_SCHEME_RSAES( sysContext, &asymScheme->rsaes );
break;
-#endif
-#ifdef TPM_ALG_OAEP
case TPM_ALG_OAEP:
Marshal_TPMS_ENC_SCHEME_OAEP( sysContext, &asymScheme->oaep );
break;
-#endif
-#ifdef TPM_ALG_NULL
case TPM_ALG_NULL:
break;
-#endif
}
return;
}
diff --git a/sysapi/sysapi_util/Marshal_TPMU_HA.c b/sysapi/sysapi_util/Marshal_TPMU_HA.c
index ce2a4ff..0d05b34 100644
--- a/sysapi/sysapi_util/Marshal_TPMU_HA.c
+++ b/sysapi/sysapi_util/Marshal_TPMU_HA.c
@@ -41,16 +41,6 @@
switch( selector )
{
-#ifdef TPM_ALG_SHA
- case TPM_ALG_SHA:
-
- for( i = 0; i < SHA_DIGEST_SIZE; i++ )
- {
- Marshal_UINT8( SYS_CONTEXT->tpmInBuffPtr, SYS_CONTEXT->maxCommandSize, &(SYS_CONTEXT->nextData), ha->sha[i], &( SYS_CONTEXT->rval ) );
- }
- break;
-#endif
-#ifdef TPM_ALG_SHA1
case TPM_ALG_SHA1:
for( i = 0; i < SHA1_DIGEST_SIZE; i++ )
@@ -58,8 +48,6 @@
Marshal_UINT8( SYS_CONTEXT->tpmInBuffPtr, SYS_CONTEXT->maxCommandSize, &(SYS_CONTEXT->nextData), ha->sha1[i], &( SYS_CONTEXT->rval ) );
}
break;
-#endif
-#ifdef TPM_ALG_SHA256
case TPM_ALG_SHA256:
for( i = 0; i < SHA256_DIGEST_SIZE; i++ )
@@ -67,8 +55,6 @@
Marshal_UINT8( SYS_CONTEXT->tpmInBuffPtr, SYS_CONTEXT->maxCommandSize, &(SYS_CONTEXT->nextData), ha->sha256[i], &( SYS_CONTEXT->rval ) );
}
break;
-#endif
-#ifdef TPM_ALG_SHA384
case TPM_ALG_SHA384:
for( i = 0; i < SHA384_DIGEST_SIZE; i++ )
@@ -76,8 +62,6 @@
Marshal_UINT8( SYS_CONTEXT->tpmInBuffPtr, SYS_CONTEXT->maxCommandSize, &(SYS_CONTEXT->nextData), ha->sha384[i], &( SYS_CONTEXT->rval ) );
}
break;
-#endif
-#ifdef TPM_ALG_SHA512
case TPM_ALG_SHA512:
for( i = 0; i < SHA512_DIGEST_SIZE; i++ )
@@ -85,8 +69,6 @@
Marshal_UINT8( SYS_CONTEXT->tpmInBuffPtr, SYS_CONTEXT->maxCommandSize, &(SYS_CONTEXT->nextData), ha->sha512[i], &( SYS_CONTEXT->rval ) );
}
break;
-#endif
-#ifdef TPM_ALG_SM3_256
case TPM_ALG_SM3_256:
for( i = 0; i < SM3_256_DIGEST_SIZE; i++ )
@@ -94,11 +76,8 @@
Marshal_UINT8( SYS_CONTEXT->tpmInBuffPtr, SYS_CONTEXT->maxCommandSize, &(SYS_CONTEXT->nextData), ha->sm3_256[i], &( SYS_CONTEXT->rval ) );
}
break;
-#endif
-#ifdef TPM_ALG_NULL
case TPM_ALG_NULL:
break;
-#endif
}
return;
}
diff --git a/sysapi/sysapi_util/Marshal_TPMU_KDF_SCHEME.c b/sysapi/sysapi_util/Marshal_TPMU_KDF_SCHEME.c
index 3492f22..e787068 100644
--- a/sysapi/sysapi_util/Marshal_TPMU_KDF_SCHEME.c
+++ b/sysapi/sysapi_util/Marshal_TPMU_KDF_SCHEME.c
@@ -39,30 +39,20 @@
switch( selector )
{
-#ifdef TPM_ALG_MGF1
case TPM_ALG_MGF1:
Marshal_TPMS_SCHEME_MGF1( sysContext, &kdfScheme->mgf1 );
break;
-#endif
-#ifdef TPM_ALG_KDF1_SP800_56A
case TPM_ALG_KDF1_SP800_56A:
Marshal_TPMS_SCHEME_KDF1_SP800_56A( sysContext, &kdfScheme->kdf1_sp800_56a );
break;
-#endif
-#ifdef TPM_ALG_KDF2
case TPM_ALG_KDF2:
Marshal_TPMS_SCHEME_KDF2( sysContext, &kdfScheme->kdf2 );
break;
-#endif
-#ifdef TPM_ALG_KDF1_SP800_108
case TPM_ALG_KDF1_SP800_108:
Marshal_TPMS_SCHEME_KDF1_SP800_108( sysContext, &kdfScheme->kdf1_sp800_108 );
break;
-#endif
-#ifdef TPM_ALG_NULL
case TPM_ALG_NULL:
break;
-#endif
}
return;
}
diff --git a/sysapi/sysapi_util/Marshal_TPMU_PUBLIC_ID.c b/sysapi/sysapi_util/Marshal_TPMU_PUBLIC_ID.c
index 3e425bf..d2c76d3 100644
--- a/sysapi/sysapi_util/Marshal_TPMU_PUBLIC_ID.c
+++ b/sysapi/sysapi_util/Marshal_TPMU_PUBLIC_ID.c
@@ -39,26 +39,18 @@
switch( selector )
{
-#ifdef TPM_ALG_KEYEDHASH
case TPM_ALG_KEYEDHASH:
MARSHAL_SIMPLE_TPM2B( sysContext, (TPM2B *)&publicVarId->keyedHash );
break;
-#endif
-#ifdef TPM_ALG_SYMCIPHER
case TPM_ALG_SYMCIPHER:
MARSHAL_SIMPLE_TPM2B( sysContext, (TPM2B *)&publicVarId->sym );
break;
-#endif
-#ifdef TPM_ALG_RSA
case TPM_ALG_RSA:
MARSHAL_SIMPLE_TPM2B( sysContext, (TPM2B *)&publicVarId->rsa );
break;
-#endif
-#ifdef TPM_ALG_ECC
case TPM_ALG_ECC:
Marshal_TPMS_ECC_POINT( sysContext, &publicVarId->ecc );
break;
-#endif
}
return;
}
diff --git a/sysapi/sysapi_util/Marshal_TPMU_PUBLIC_PARMS.c b/sysapi/sysapi_util/Marshal_TPMU_PUBLIC_PARMS.c
index 6828519..65188ae 100644
--- a/sysapi/sysapi_util/Marshal_TPMU_PUBLIC_PARMS.c
+++ b/sysapi/sysapi_util/Marshal_TPMU_PUBLIC_PARMS.c
@@ -39,26 +39,18 @@
switch( selector )
{
-#ifdef TPM_ALG_KEYEDHASH
case TPM_ALG_KEYEDHASH:
Marshal_TPMS_KEYEDHASH_PARMS( sysContext, &publicVarParms->keyedHashDetail );
break;
-#endif
-#ifdef TPM_ALG_SYMCIPHER
case TPM_ALG_SYMCIPHER:
Marshal_TPMS_SYMCIPHER_PARMS( sysContext, &publicVarParms->symDetail );
break;
-#endif
-#ifdef TPM_ALG_RSA
case TPM_ALG_RSA:
Marshal_TPMS_RSA_PARMS( sysContext, &publicVarParms->rsaDetail );
break;
-#endif
-#ifdef TPM_ALG_ECC
case TPM_ALG_ECC:
Marshal_TPMS_ECC_PARMS( sysContext, &publicVarParms->eccDetail );
break;
-#endif
}
return;
}
diff --git a/sysapi/sysapi_util/Marshal_TPMU_SCHEME_KEYEDHASH.c b/sysapi/sysapi_util/Marshal_TPMU_SCHEME_KEYEDHASH.c
index decc8c9..d7fc095 100644
--- a/sysapi/sysapi_util/Marshal_TPMU_SCHEME_KEYEDHASH.c
+++ b/sysapi/sysapi_util/Marshal_TPMU_SCHEME_KEYEDHASH.c
@@ -39,20 +39,14 @@
switch( selector )
{
-#ifdef TPM_ALG_HMAC
case TPM_ALG_HMAC:
Marshal_TPMS_SCHEME_HMAC( sysContext, &schemeKeyedhash->hmac );
break;
-#endif
-#ifdef TPM_ALG_XOR
case TPM_ALG_XOR:
Marshal_TPMS_SCHEME_XOR( sysContext, &schemeKeyedhash->exclusiveOr );
break;
-#endif
-#ifdef TPM_ALG_NULL
case TPM_ALG_NULL:
break;
-#endif
}
return;
}
diff --git a/sysapi/sysapi_util/Marshal_TPMU_SENSITIVE_COMPOSITE.c b/sysapi/sysapi_util/Marshal_TPMU_SENSITIVE_COMPOSITE.c
index 83f6089..aeef69d 100644
--- a/sysapi/sysapi_util/Marshal_TPMU_SENSITIVE_COMPOSITE.c
+++ b/sysapi/sysapi_util/Marshal_TPMU_SENSITIVE_COMPOSITE.c
@@ -39,26 +39,18 @@
switch( selector )
{
-#ifdef TPM_ALG_RSA
case TPM_ALG_RSA:
MARSHAL_SIMPLE_TPM2B( sysContext, (TPM2B *)&sensitiveComposite->rsa );
break;
-#endif
-#ifdef TPM_ALG_ECC
case TPM_ALG_ECC:
MARSHAL_SIMPLE_TPM2B( sysContext, (TPM2B *)&sensitiveComposite->ecc );
break;
-#endif
-#ifdef TPM_ALG_KEYEDHASH
case TPM_ALG_KEYEDHASH:
MARSHAL_SIMPLE_TPM2B( sysContext, (TPM2B *)&sensitiveComposite->bits );
break;
-#endif
-#ifdef TPM_ALG_SYMCIPHER
case TPM_ALG_SYMCIPHER:
MARSHAL_SIMPLE_TPM2B( sysContext, (TPM2B *)&sensitiveComposite->sym );
break;
-#endif
}
return;
}
diff --git a/sysapi/sysapi_util/Marshal_TPMU_SIGNATURE.c b/sysapi/sysapi_util/Marshal_TPMU_SIGNATURE.c
index bbd4a87..9d93b6a 100644
--- a/sysapi/sysapi_util/Marshal_TPMU_SIGNATURE.c
+++ b/sysapi/sysapi_util/Marshal_TPMU_SIGNATURE.c
@@ -39,45 +39,29 @@
switch( selector )
{
-#ifdef TPM_ALG_RSASSA
case TPM_ALG_RSASSA:
Marshal_TPMS_SIGNATURE_RSASSA( sysContext, &signature->rsassa );
break;
-#endif
-#ifdef TPM_ALG_RSAPSS
case TPM_ALG_RSAPSS:
Marshal_TPMS_SIGNATURE_RSAPSS( sysContext, &signature->rsapss );
break;
-#endif
-#ifdef TPM_ALG_ECDSA
case TPM_ALG_ECDSA:
Marshal_TPMS_SIGNATURE_ECDSA( sysContext, &signature->ecdsa );
break;
-#endif
-#ifdef TPM_ALG_ECDAA
case TPM_ALG_ECDAA:
Marshal_TPMS_SIGNATURE_ECDAA( sysContext, &signature->ecdaa );
break;
-#endif
-#ifdef TPM_ALG_SM2
case TPM_ALG_SM2:
Marshal_TPMS_SIGNATURE_SM2( sysContext, &signature->sm2 );
break;
-#endif
-#ifdef TPM_ALG_ECSCHNORR
case TPM_ALG_ECSCHNORR:
Marshal_TPMS_SIGNATURE_ECSCHNORR( sysContext, &signature->ecschnorr );
break;
-#endif
-#ifdef TPM_ALG_HMAC
case TPM_ALG_HMAC:
Marshal_TPMT_HA( sysContext, &signature->hmac );
break;
-#endif
-#ifdef TPM_ALG_NULL
case TPM_ALG_NULL:
break;
-#endif
}
return;
}
diff --git a/sysapi/sysapi_util/Marshal_TPMU_SIG_SCHEME.c b/sysapi/sysapi_util/Marshal_TPMU_SIG_SCHEME.c
index 0ed0c73..34b5f07 100644
--- a/sysapi/sysapi_util/Marshal_TPMU_SIG_SCHEME.c
+++ b/sysapi/sysapi_util/Marshal_TPMU_SIG_SCHEME.c
@@ -39,45 +39,29 @@
switch( selector )
{
-#ifdef TPM_ALG_RSASSA
case TPM_ALG_RSASSA:
Marshal_TPMS_SIG_SCHEME_RSASSA( sysContext, &sigScheme->rsassa );
break;
-#endif
-#ifdef TPM_ALG_RSAPSS
case TPM_ALG_RSAPSS:
Marshal_TPMS_SIG_SCHEME_RSAPSS( sysContext, &sigScheme->rsapss );
break;
-#endif
-#ifdef TPM_ALG_ECDSA
case TPM_ALG_ECDSA:
Marshal_TPMS_SIG_SCHEME_ECDSA( sysContext, &sigScheme->ecdsa );
break;
-#endif
-#ifdef TPM_ALG_ECDAA
case TPM_ALG_ECDAA:
Marshal_TPMS_SIG_SCHEME_ECDAA( sysContext, &sigScheme->ecdaa );
break;
-#endif
-#ifdef TPM_ALG_SM2
case TPM_ALG_SM2:
Marshal_TPMS_SIG_SCHEME_SM2( sysContext, &sigScheme->sm2 );
break;
-#endif
-#ifdef TPM_ALG_ECSCHNORR
case TPM_ALG_ECSCHNORR:
Marshal_TPMS_SIG_SCHEME_ECSCHNORR( sysContext, &sigScheme->ecschnorr );
break;
-#endif
-#ifdef TPM_ALG_HMAC
case TPM_ALG_HMAC:
Marshal_TPMS_SCHEME_HMAC( sysContext, &sigScheme->hmac );
break;
-#endif
-#ifdef TPM_ALG_NULL
case TPM_ALG_NULL:
break;
-#endif
}
return;
}
diff --git a/sysapi/sysapi_util/Marshal_TPMU_SYM_KEY_BITS.c b/sysapi/sysapi_util/Marshal_TPMU_SYM_KEY_BITS.c
index e2723c5..755e116 100644
--- a/sysapi/sysapi_util/Marshal_TPMU_SYM_KEY_BITS.c
+++ b/sysapi/sysapi_util/Marshal_TPMU_SYM_KEY_BITS.c
@@ -39,30 +39,20 @@
switch( selector )
{
-#ifdef TPM_ALG_AES
case TPM_ALG_AES:
Marshal_UINT16( SYS_CONTEXT->tpmInBuffPtr, SYS_CONTEXT->maxCommandSize, &(SYS_CONTEXT->nextData), symKeyBits->aes, &( SYS_CONTEXT->rval ) );
break;
-#endif
-#ifdef TPM_ALG_SM4
case TPM_ALG_SM4:
Marshal_UINT16( SYS_CONTEXT->tpmInBuffPtr, SYS_CONTEXT->maxCommandSize, &(SYS_CONTEXT->nextData), symKeyBits->sm4, &( SYS_CONTEXT->rval ) );
break;
-#endif
-#ifdef TPM_ALG_CAMELLIA
case TPM_ALG_CAMELLIA:
Marshal_UINT16( SYS_CONTEXT->tpmInBuffPtr, SYS_CONTEXT->maxCommandSize, &(SYS_CONTEXT->nextData), symKeyBits->camellia, &( SYS_CONTEXT->rval ) );
break;
-#endif
-#ifdef TPM_ALG_XOR
case TPM_ALG_XOR:
Marshal_UINT16( SYS_CONTEXT->tpmInBuffPtr, SYS_CONTEXT->maxCommandSize, &(SYS_CONTEXT->nextData), symKeyBits->exclusiveOr, &( SYS_CONTEXT->rval ) );
break;
-#endif
-#ifdef TPM_ALG_NULL
case TPM_ALG_NULL:
break;
-#endif
}
return;
}
diff --git a/sysapi/sysapi_util/Marshal_TPMU_SYM_MODE.c b/sysapi/sysapi_util/Marshal_TPMU_SYM_MODE.c
index 7a345d1..3f0a345 100644
--- a/sysapi/sysapi_util/Marshal_TPMU_SYM_MODE.c
+++ b/sysapi/sysapi_util/Marshal_TPMU_SYM_MODE.c
@@ -39,29 +39,19 @@
switch( selector )
{
-#ifdef TPM_ALG_AES
case TPM_ALG_AES:
Marshal_UINT16( SYS_CONTEXT->tpmInBuffPtr, SYS_CONTEXT->maxCommandSize, &(SYS_CONTEXT->nextData), symMode->aes, &( SYS_CONTEXT->rval ) );
break;
-#endif
-#ifdef TPM_ALG_SM4
case TPM_ALG_SM4:
Marshal_UINT16( SYS_CONTEXT->tpmInBuffPtr, SYS_CONTEXT->maxCommandSize, &(SYS_CONTEXT->nextData), symMode->sm4, &( SYS_CONTEXT->rval ) );
break;
-#endif
-#ifdef TPM_ALG_CAMELLIA
case TPM_ALG_CAMELLIA:
Marshal_UINT16( SYS_CONTEXT->tpmInBuffPtr, SYS_CONTEXT->maxCommandSize, &(SYS_CONTEXT->nextData), symMode->camellia, &( SYS_CONTEXT->rval ) );
break;
-#endif
-#ifdef TPM_ALG_XOR
case TPM_ALG_XOR:
break;
-#endif
-#ifdef TPM_ALG_NULL
case TPM_ALG_NULL:
break;
-#endif
}
return;
}
diff --git a/sysapi/sysapi_util/Unmarshal_TPMU_ASYM_SCHEME.c b/sysapi/sysapi_util/Unmarshal_TPMU_ASYM_SCHEME.c
index 4b4a216..402e20d 100644
--- a/sysapi/sysapi_util/Unmarshal_TPMU_ASYM_SCHEME.c
+++ b/sysapi/sysapi_util/Unmarshal_TPMU_ASYM_SCHEME.c
@@ -42,60 +42,38 @@
switch( selector )
{
-#ifdef TPM_ALG_ECDH
case TPM_ALG_ECDH:
Unmarshal_TPMS_KEY_SCHEME_ECDH( sysContext, &asymScheme->ecdh );
break;
-#endif
-#ifdef TPM_ALG_ECMQV
case TPM_ALG_ECMQV:
Unmarshal_TPMS_KEY_SCHEME_ECMQV( sysContext, &asymScheme->ecmqv );
break;
-#endif
-#ifdef TPM_ALG_RSASSA
case TPM_ALG_RSASSA:
Unmarshal_TPMS_SIG_SCHEME_RSASSA( sysContext, &asymScheme->rsassa );
break;
-#endif
-#ifdef TPM_ALG_RSAPSS
case TPM_ALG_RSAPSS:
Unmarshal_TPMS_SIG_SCHEME_RSAPSS( sysContext, &asymScheme->rsapss );
break;
-#endif
-#ifdef TPM_ALG_ECDSA
case TPM_ALG_ECDSA:
Unmarshal_TPMS_SIG_SCHEME_ECDSA( sysContext, &asymScheme->ecdsa );
break;
-#endif
-#ifdef TPM_ALG_ECDAA
case TPM_ALG_ECDAA:
Unmarshal_TPMS_SIG_SCHEME_ECDAA( sysContext, &asymScheme->ecdaa );
break;
-#endif
-#ifdef TPM_ALG_SM2
case TPM_ALG_SM2:
Unmarshal_TPMS_SIG_SCHEME_SM2( sysContext, &asymScheme->sm2 );
break;
-#endif
-#ifdef TPM_ALG_ECSCHNORR
case TPM_ALG_ECSCHNORR:
Unmarshal_TPMS_SIG_SCHEME_ECSCHNORR( sysContext, &asymScheme->ecschnorr );
break;
-#endif
-#ifdef TPM_ALG_RSAES
case TPM_ALG_RSAES:
Unmarshal_TPMS_ENC_SCHEME_RSAES( sysContext, &asymScheme->rsaes );
break;
-#endif
-#ifdef TPM_ALG_OAEP
case TPM_ALG_OAEP:
Unmarshal_TPMS_ENC_SCHEME_OAEP( sysContext, &asymScheme->oaep );
break;
-#endif
-#ifdef TPM_ALG_NULL
case TPM_ALG_NULL:
break;
-#endif
}
return;
}
diff --git a/sysapi/sysapi_util/Unmarshal_TPMU_ATTEST.c b/sysapi/sysapi_util/Unmarshal_TPMU_ATTEST.c
index 3711e02..0196286 100644
--- a/sysapi/sysapi_util/Unmarshal_TPMU_ATTEST.c
+++ b/sysapi/sysapi_util/Unmarshal_TPMU_ATTEST.c
@@ -42,41 +42,27 @@
switch( selector )
{
-#ifdef TPM_ST_ATTEST_CERTIFY
case TPM_ST_ATTEST_CERTIFY:
Unmarshal_TPMS_CERTIFY_INFO( sysContext, &attest->certify );
break;
-#endif
-#ifdef TPM_ST_ATTEST_CREATION
case TPM_ST_ATTEST_CREATION:
Unmarshal_TPMS_CREATION_INFO( sysContext, &attest->creation );
break;
-#endif
-#ifdef TPM_ST_ATTEST_QUOTE
case TPM_ST_ATTEST_QUOTE:
Unmarshal_TPMS_QUOTE_INFO( sysContext, &attest->quote );
break;
-#endif
-#ifdef TPM_ST_ATTEST_COMMAND_AUDIT
case TPM_ST_ATTEST_COMMAND_AUDIT:
Unmarshal_TPMS_COMMAND_AUDIT_INFO( sysContext, &attest->commandAudit );
break;
-#endif
-#ifdef TPM_ST_ATTEST_SESSION_AUDIT
case TPM_ST_ATTEST_SESSION_AUDIT:
Unmarshal_TPMS_SESSION_AUDIT_INFO( sysContext, &attest->sessionAudit );
break;
-#endif
-#ifdef TPM_ST_ATTEST_TIME
case TPM_ST_ATTEST_TIME:
Unmarshal_TPMS_TIME_ATTEST_INFO( sysContext, &attest->time );
break;
-#endif
-#ifdef TPM_ST_ATTEST_NV
case TPM_ST_ATTEST_NV:
Unmarshal_TPMS_NV_CERTIFY_INFO( sysContext, &attest->nv );
break;
-#endif
}
return;
}
diff --git a/sysapi/sysapi_util/Unmarshal_TPMU_CAPABILITIES.c b/sysapi/sysapi_util/Unmarshal_TPMU_CAPABILITIES.c
index 38b633b..5497b80 100644
--- a/sysapi/sysapi_util/Unmarshal_TPMU_CAPABILITIES.c
+++ b/sysapi/sysapi_util/Unmarshal_TPMU_CAPABILITIES.c
@@ -42,51 +42,33 @@
switch( selector )
{
-#ifdef TPM_CAP_ALGS
case TPM_CAP_ALGS:
Unmarshal_TPML_ALG_PROPERTY( sysContext, &capabilities->algorithms );
break;
-#endif
-#ifdef TPM_CAP_HANDLES
case TPM_CAP_HANDLES:
Unmarshal_TPML_HANDLE( sysContext, &capabilities->handles );
break;
-#endif
-#ifdef TPM_CAP_COMMANDS
case TPM_CAP_COMMANDS:
Unmarshal_TPML_CCA( sysContext, &capabilities->command );
break;
-#endif
-#ifdef TPM_CAP_PP_COMMANDS
case TPM_CAP_PP_COMMANDS:
Unmarshal_TPML_CC( sysContext, &capabilities->ppCommands );
break;
-#endif
-#ifdef TPM_CAP_AUDIT_COMMANDS
case TPM_CAP_AUDIT_COMMANDS:
Unmarshal_TPML_CC( sysContext, &capabilities->auditCommands );
break;
-#endif
-#ifdef TPM_CAP_PCRS
case TPM_CAP_PCRS:
Unmarshal_TPML_PCR_SELECTION( sysContext, &capabilities->assignedPCR );
break;
-#endif
-#ifdef TPM_CAP_TPM_PROPERTIES
case TPM_CAP_TPM_PROPERTIES:
Unmarshal_TPML_TAGGED_TPM_PROPERTY( sysContext, &capabilities->tpmProperties );
break;
-#endif
-#ifdef TPM_CAP_PCR_PROPERTIES
case TPM_CAP_PCR_PROPERTIES:
Unmarshal_TPML_TAGGED_PCR_PROPERTY( sysContext, &capabilities->pcrProperties );
break;
-#endif
-#ifdef TPM_CAP_ECC_CURVES
case TPM_CAP_ECC_CURVES:
Unmarshal_TPML_ECC_CURVE( sysContext, &capabilities->eccCurves );
break;
-#endif
}
return;
}
diff --git a/sysapi/sysapi_util/Unmarshal_TPMU_HA.c b/sysapi/sysapi_util/Unmarshal_TPMU_HA.c
index 2b4b902..1c1724b 100644
--- a/sysapi/sysapi_util/Unmarshal_TPMU_HA.c
+++ b/sysapi/sysapi_util/Unmarshal_TPMU_HA.c
@@ -44,16 +44,6 @@
switch( selector )
{
-#ifdef TPM_ALG_SHA
- case TPM_ALG_SHA:
-
- for( i = 0; i < SHA_DIGEST_SIZE; i++ )
- {
- Unmarshal_UINT8( SYS_CONTEXT->tpmOutBuffPtr, SYS_CONTEXT->maxResponseSize, &(SYS_CONTEXT->nextData), &ha->sha[i], &( SYS_CONTEXT->rval ) );
- }
- break;
-#endif
-#ifdef TPM_ALG_SHA1
case TPM_ALG_SHA1:
for( i = 0; i < SHA1_DIGEST_SIZE; i++ )
@@ -61,8 +51,6 @@
Unmarshal_UINT8( SYS_CONTEXT->tpmOutBuffPtr, SYS_CONTEXT->maxResponseSize, &(SYS_CONTEXT->nextData), &ha->sha1[i], &( SYS_CONTEXT->rval ) );
}
break;
-#endif
-#ifdef TPM_ALG_SHA256
case TPM_ALG_SHA256:
for( i = 0; i < SHA256_DIGEST_SIZE; i++ )
@@ -70,8 +58,6 @@
Unmarshal_UINT8( SYS_CONTEXT->tpmOutBuffPtr, SYS_CONTEXT->maxResponseSize, &(SYS_CONTEXT->nextData), &ha->sha256[i], &( SYS_CONTEXT->rval ) );
}
break;
-#endif
-#ifdef TPM_ALG_SHA384
case TPM_ALG_SHA384:
for( i = 0; i < SHA384_DIGEST_SIZE; i++ )
@@ -79,8 +65,6 @@
Unmarshal_UINT8( SYS_CONTEXT->tpmOutBuffPtr, SYS_CONTEXT->maxResponseSize, &(SYS_CONTEXT->nextData), &ha->sha384[i], &( SYS_CONTEXT->rval ) );
}
break;
-#endif
-#ifdef TPM_ALG_SHA512
case TPM_ALG_SHA512:
for( i = 0; i < SHA512_DIGEST_SIZE; i++ )
@@ -88,8 +72,6 @@
Unmarshal_UINT8( SYS_CONTEXT->tpmOutBuffPtr, SYS_CONTEXT->maxResponseSize, &(SYS_CONTEXT->nextData), &ha->sha512[i], &( SYS_CONTEXT->rval ) );
}
break;
-#endif
-#ifdef TPM_ALG_SM3_256
case TPM_ALG_SM3_256:
for( i = 0; i < SM3_256_DIGEST_SIZE; i++ )
@@ -97,11 +79,8 @@
Unmarshal_UINT8( SYS_CONTEXT->tpmOutBuffPtr, SYS_CONTEXT->maxResponseSize, &(SYS_CONTEXT->nextData), &ha->sm3_256[i], &( SYS_CONTEXT->rval ) );
}
break;
-#endif
-#ifdef TPM_ALG_NULL
case TPM_ALG_NULL:
break;
-#endif
}
return;
}
diff --git a/sysapi/sysapi_util/Unmarshal_TPMU_KDF_SCHEME.c b/sysapi/sysapi_util/Unmarshal_TPMU_KDF_SCHEME.c
index c5c56cb..bc42e09 100644
--- a/sysapi/sysapi_util/Unmarshal_TPMU_KDF_SCHEME.c
+++ b/sysapi/sysapi_util/Unmarshal_TPMU_KDF_SCHEME.c
@@ -42,30 +42,20 @@
switch( selector )
{
-#ifdef TPM_ALG_MGF1
case TPM_ALG_MGF1:
Unmarshal_TPMS_SCHEME_MGF1( sysContext, &kdfScheme->mgf1 );
break;
-#endif
-#ifdef TPM_ALG_KDF1_SP800_56A
case TPM_ALG_KDF1_SP800_56A:
Unmarshal_TPMS_SCHEME_KDF1_SP800_56A( sysContext, &kdfScheme->kdf1_sp800_56a );
break;
-#endif
-#ifdef TPM_ALG_KDF2
case TPM_ALG_KDF2:
Unmarshal_TPMS_SCHEME_KDF2( sysContext, &kdfScheme->kdf2 );
break;
-#endif
-#ifdef TPM_ALG_KDF1_SP800_108
case TPM_ALG_KDF1_SP800_108:
Unmarshal_TPMS_SCHEME_KDF1_SP800_108( sysContext, &kdfScheme->kdf1_sp800_108 );
break;
-#endif
-#ifdef TPM_ALG_NULL
case TPM_ALG_NULL:
break;
-#endif
}
return;
}
diff --git a/sysapi/sysapi_util/Unmarshal_TPMU_PUBLIC_ID.c b/sysapi/sysapi_util/Unmarshal_TPMU_PUBLIC_ID.c
index 6c85e23..9ae2ad8 100644
--- a/sysapi/sysapi_util/Unmarshal_TPMU_PUBLIC_ID.c
+++ b/sysapi/sysapi_util/Unmarshal_TPMU_PUBLIC_ID.c
@@ -42,26 +42,18 @@
switch( selector )
{
-#ifdef TPM_ALG_KEYEDHASH
case TPM_ALG_KEYEDHASH:
UNMARSHAL_SIMPLE_TPM2B_NO_SIZE_CHECK( sysContext, (TPM2B *)&publicVarId->keyedHash );
break;
-#endif
-#ifdef TPM_ALG_SYMCIPHER
case TPM_ALG_SYMCIPHER:
UNMARSHAL_SIMPLE_TPM2B_NO_SIZE_CHECK( sysContext, (TPM2B *)&publicVarId->sym );
break;
-#endif
-#ifdef TPM_ALG_RSA
case TPM_ALG_RSA:
UNMARSHAL_SIMPLE_TPM2B_NO_SIZE_CHECK( sysContext, (TPM2B *)&publicVarId->rsa );
break;
-#endif
-#ifdef TPM_ALG_ECC
case TPM_ALG_ECC:
Unmarshal_TPMS_ECC_POINT( sysContext, &publicVarId->ecc );
break;
-#endif
}
return;
}
diff --git a/sysapi/sysapi_util/Unmarshal_TPMU_PUBLIC_PARMS.c b/sysapi/sysapi_util/Unmarshal_TPMU_PUBLIC_PARMS.c
index dde22f9..c0aadbb 100644
--- a/sysapi/sysapi_util/Unmarshal_TPMU_PUBLIC_PARMS.c
+++ b/sysapi/sysapi_util/Unmarshal_TPMU_PUBLIC_PARMS.c
@@ -42,26 +42,18 @@
switch( selector )
{
-#ifdef TPM_ALG_KEYEDHASH
case TPM_ALG_KEYEDHASH:
Unmarshal_TPMS_KEYEDHASH_PARMS( sysContext, &publicVarParms->keyedHashDetail );
break;
-#endif
-#ifdef TPM_ALG_SYMCIPHER
case TPM_ALG_SYMCIPHER:
Unmarshal_TPMS_SYMCIPHER_PARMS( sysContext, &publicVarParms->symDetail );
break;
-#endif
-#ifdef TPM_ALG_RSA
case TPM_ALG_RSA:
Unmarshal_TPMS_RSA_PARMS( sysContext, &publicVarParms->rsaDetail );
break;
-#endif
-#ifdef TPM_ALG_ECC
case TPM_ALG_ECC:
Unmarshal_TPMS_ECC_PARMS( sysContext, &publicVarParms->eccDetail );
break;
-#endif
}
return;
}
diff --git a/sysapi/sysapi_util/Unmarshal_TPMU_SCHEME_KEYEDHASH.c b/sysapi/sysapi_util/Unmarshal_TPMU_SCHEME_KEYEDHASH.c
index 8e5e8de..6e385ed 100644
--- a/sysapi/sysapi_util/Unmarshal_TPMU_SCHEME_KEYEDHASH.c
+++ b/sysapi/sysapi_util/Unmarshal_TPMU_SCHEME_KEYEDHASH.c
@@ -42,20 +42,14 @@
switch( selector )
{
-#ifdef TPM_ALG_HMAC
case TPM_ALG_HMAC:
Unmarshal_TPMS_SCHEME_HMAC( sysContext, &schemeKeyedhash->hmac );
break;
-#endif
-#ifdef TPM_ALG_XOR
case TPM_ALG_XOR:
Unmarshal_TPMS_SCHEME_XOR( sysContext, &schemeKeyedhash->exclusiveOr );
break;
-#endif
-#ifdef TPM_ALG_NULL
case TPM_ALG_NULL:
break;
-#endif
}
return;
}
diff --git a/sysapi/sysapi_util/Unmarshal_TPMU_SENSITIVE_COMPOSITE.c b/sysapi/sysapi_util/Unmarshal_TPMU_SENSITIVE_COMPOSITE.c
index 8f6f3ee..547b4fc 100644
--- a/sysapi/sysapi_util/Unmarshal_TPMU_SENSITIVE_COMPOSITE.c
+++ b/sysapi/sysapi_util/Unmarshal_TPMU_SENSITIVE_COMPOSITE.c
@@ -42,26 +42,18 @@
switch( selector )
{
-#ifdef TPM_ALG_RSA
case TPM_ALG_RSA:
UNMARSHAL_SIMPLE_TPM2B_NO_SIZE_CHECK( sysContext, (TPM2B *)&sensitiveComposite->rsa );
break;
-#endif
-#ifdef TPM_ALG_ECC
case TPM_ALG_ECC:
UNMARSHAL_SIMPLE_TPM2B_NO_SIZE_CHECK( sysContext, (TPM2B *)&sensitiveComposite->ecc );
break;
-#endif
-#ifdef TPM_ALG_KEYEDHASH
case TPM_ALG_KEYEDHASH:
UNMARSHAL_SIMPLE_TPM2B_NO_SIZE_CHECK( sysContext, (TPM2B *)&sensitiveComposite->bits );
break;
-#endif
-#ifdef TPM_ALG_SYMCIPHER
case TPM_ALG_SYMCIPHER:
UNMARSHAL_SIMPLE_TPM2B_NO_SIZE_CHECK( sysContext, (TPM2B *)&sensitiveComposite->sym );
break;
-#endif
}
return;
}
diff --git a/sysapi/sysapi_util/Unmarshal_TPMU_SIGNATURE.c b/sysapi/sysapi_util/Unmarshal_TPMU_SIGNATURE.c
index 1255c08..851c1ed 100644
--- a/sysapi/sysapi_util/Unmarshal_TPMU_SIGNATURE.c
+++ b/sysapi/sysapi_util/Unmarshal_TPMU_SIGNATURE.c
@@ -42,45 +42,29 @@
switch( selector )
{
-#ifdef TPM_ALG_RSASSA
case TPM_ALG_RSASSA:
Unmarshal_TPMS_SIGNATURE_RSASSA( sysContext, &signature->rsassa );
break;
-#endif
-#ifdef TPM_ALG_RSAPSS
case TPM_ALG_RSAPSS:
Unmarshal_TPMS_SIGNATURE_RSAPSS( sysContext, &signature->rsapss );
break;
-#endif
-#ifdef TPM_ALG_ECDSA
case TPM_ALG_ECDSA:
Unmarshal_TPMS_SIGNATURE_ECDSA( sysContext, &signature->ecdsa );
break;
-#endif
-#ifdef TPM_ALG_ECDAA
case TPM_ALG_ECDAA:
Unmarshal_TPMS_SIGNATURE_ECDAA( sysContext, &signature->ecdaa );
break;
-#endif
-#ifdef TPM_ALG_SM2
case TPM_ALG_SM2:
Unmarshal_TPMS_SIGNATURE_SM2( sysContext, &signature->sm2 );
break;
-#endif
-#ifdef TPM_ALG_ECSCHNORR
case TPM_ALG_ECSCHNORR:
Unmarshal_TPMS_SIGNATURE_ECSCHNORR( sysContext, &signature->ecschnorr );
break;
-#endif
-#ifdef TPM_ALG_HMAC
case TPM_ALG_HMAC:
Unmarshal_TPMT_HA( sysContext, &signature->hmac );
break;
-#endif
-#ifdef TPM_ALG_NULL
case TPM_ALG_NULL:
break;
-#endif
}
return;
}
diff --git a/sysapi/sysapi_util/Unmarshal_TPMU_SIG_SCHEME.c b/sysapi/sysapi_util/Unmarshal_TPMU_SIG_SCHEME.c
index e758efd..68effb0 100644
--- a/sysapi/sysapi_util/Unmarshal_TPMU_SIG_SCHEME.c
+++ b/sysapi/sysapi_util/Unmarshal_TPMU_SIG_SCHEME.c
@@ -42,45 +42,29 @@
switch( selector )
{
-#ifdef TPM_ALG_RSASSA
case TPM_ALG_RSASSA:
Unmarshal_TPMS_SIG_SCHEME_RSASSA( sysContext, &sigScheme->rsassa );
break;
-#endif
-#ifdef TPM_ALG_RSAPSS
case TPM_ALG_RSAPSS:
Unmarshal_TPMS_SIG_SCHEME_RSAPSS( sysContext, &sigScheme->rsapss );
break;
-#endif
-#ifdef TPM_ALG_ECDSA
case TPM_ALG_ECDSA:
Unmarshal_TPMS_SIG_SCHEME_ECDSA( sysContext, &sigScheme->ecdsa );
break;
-#endif
-#ifdef TPM_ALG_ECDAA
case TPM_ALG_ECDAA:
Unmarshal_TPMS_SIG_SCHEME_ECDAA( sysContext, &sigScheme->ecdaa );
break;
-#endif
-#ifdef TPM_ALG_SM2
case TPM_ALG_SM2:
Unmarshal_TPMS_SIG_SCHEME_SM2( sysContext, &sigScheme->sm2 );
break;
-#endif
-#ifdef TPM_ALG_ECSCHNORR
case TPM_ALG_ECSCHNORR:
Unmarshal_TPMS_SIG_SCHEME_ECSCHNORR( sysContext, &sigScheme->ecschnorr );
break;
-#endif
-#ifdef TPM_ALG_HMAC
case TPM_ALG_HMAC:
Unmarshal_TPMS_SCHEME_HMAC( sysContext, &sigScheme->hmac );
break;
-#endif
-#ifdef TPM_ALG_NULL
case TPM_ALG_NULL:
break;
-#endif
}
return;
}
diff --git a/sysapi/sysapi_util/Unmarshal_TPMU_SYM_KEY_BITS.c b/sysapi/sysapi_util/Unmarshal_TPMU_SYM_KEY_BITS.c
index ef5ae3e..79f7a9b 100644
--- a/sysapi/sysapi_util/Unmarshal_TPMU_SYM_KEY_BITS.c
+++ b/sysapi/sysapi_util/Unmarshal_TPMU_SYM_KEY_BITS.c
@@ -42,30 +42,20 @@
switch( selector )
{
-#ifdef TPM_ALG_AES
case TPM_ALG_AES:
Unmarshal_UINT16( SYS_CONTEXT->tpmOutBuffPtr, SYS_CONTEXT->maxResponseSize, &(SYS_CONTEXT->nextData), &symKeyBits->aes, &( SYS_CONTEXT->rval ) );
break;
-#endif
-#ifdef TPM_ALG_SM4
case TPM_ALG_SM4:
Unmarshal_UINT16( SYS_CONTEXT->tpmOutBuffPtr, SYS_CONTEXT->maxResponseSize, &(SYS_CONTEXT->nextData), &symKeyBits->sm4, &( SYS_CONTEXT->rval ) );
break;
-#endif
-#ifdef TPM_ALG_CAMELLIA
case TPM_ALG_CAMELLIA:
Unmarshal_UINT16( SYS_CONTEXT->tpmOutBuffPtr, SYS_CONTEXT->maxResponseSize, &(SYS_CONTEXT->nextData), &symKeyBits->camellia, &( SYS_CONTEXT->rval ) );
break;
-#endif
-#ifdef TPM_ALG_XOR
case TPM_ALG_XOR:
Unmarshal_UINT16( SYS_CONTEXT->tpmOutBuffPtr, SYS_CONTEXT->maxResponseSize, &(SYS_CONTEXT->nextData), &symKeyBits->exclusiveOr, &( SYS_CONTEXT->rval ) );
break;
-#endif
-#ifdef TPM_ALG_NULL
case TPM_ALG_NULL:
break;
-#endif
}
return;
}
diff --git a/sysapi/sysapi_util/Unmarshal_TPMU_SYM_MODE.c b/sysapi/sysapi_util/Unmarshal_TPMU_SYM_MODE.c
index 09570b7..2561a8d 100644
--- a/sysapi/sysapi_util/Unmarshal_TPMU_SYM_MODE.c
+++ b/sysapi/sysapi_util/Unmarshal_TPMU_SYM_MODE.c
@@ -42,29 +42,19 @@
switch( selector )
{
-#ifdef TPM_ALG_AES
case TPM_ALG_AES:
Unmarshal_UINT16( SYS_CONTEXT->tpmOutBuffPtr, SYS_CONTEXT->maxResponseSize, &(SYS_CONTEXT->nextData), &symMode->aes, &( SYS_CONTEXT->rval ) );
break;
-#endif
-#ifdef TPM_ALG_SM4
case TPM_ALG_SM4:
Unmarshal_UINT16( SYS_CONTEXT->tpmOutBuffPtr, SYS_CONTEXT->maxResponseSize, &(SYS_CONTEXT->nextData), &symMode->sm4, &( SYS_CONTEXT->rval ) );
break;
-#endif
-#ifdef TPM_ALG_CAMELLIA
case TPM_ALG_CAMELLIA:
Unmarshal_UINT16( SYS_CONTEXT->tpmOutBuffPtr, SYS_CONTEXT->maxResponseSize, &(SYS_CONTEXT->nextData), &symMode->camellia, &( SYS_CONTEXT->rval ) );
break;
-#endif
-#ifdef TPM_ALG_XOR
case TPM_ALG_XOR:
break;
-#endif
-#ifdef TPM_ALG_NULL
case TPM_ALG_NULL:
break;
-#endif
}
return;
}