Cleanup unused TPM2B code
Cleanup some unused TPM2B defines.
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
diff --git a/include/sapi/implementation.h b/include/sapi/implementation.h
index 0f733ec..937afbd 100644
--- a/include/sapi/implementation.h
+++ b/include/sapi/implementation.h
@@ -420,8 +420,6 @@
#define HASH_COUNT 5
-TPM2B_TYPE(MAX_HASH_BLOCK, MAX_HASH_BLOCK_SIZE);
-
#ifndef MAX
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#endif
@@ -441,7 +439,4 @@
# error Bad size for MAX_SYM_KEY_BITS or MAX_SYM_BLOCK_SIZE
#endif
-// Define the 2B structure for a seed
-TPM2B_TYPE(SEED, PRIMARY_SEED_SIZE);
-
#endif // _IMPLEMENTATION_H_
diff --git a/include/sapi/tpmb.h b/include/sapi/tpmb.h
index 9dcb4f7..0852f7c 100644
--- a/include/sapi/tpmb.h
+++ b/include/sapi/tpmb.h
@@ -25,7 +25,6 @@
// THE POSSIBILITY OF SUCH DAMAGE.
//**********************************************************************;
-// This file contains extra TPM2B structures
#ifndef _TPMB_H
#define _TPMB_H
@@ -39,42 +38,22 @@
BYTE buffer[1];
} TPM2B;
-// This macro helps avoid having to type in the structure in order to create a new TPM2B type that
-// is used in a function.
-
-#define TPM2B_TYPE(name, bytes) \
- typedef union { \
- struct { \
- UINT16 size; \
- BYTE buffer[(bytes)]; \
- } t; \
- TPM2B b; \
+#define TPM2B_TYPE1(name, bytes, bufferName) \
+ typedef union { \
+ struct { \
+ UINT16 size; \
+ BYTE bufferName[bytes]; \
+ } t; \
+ TPM2B b; \
} TPM2B_##name
-#define TPM2B_TYPE1(name, bytes, bufferName) \
- typedef union { \
- struct { \
- UINT16 size; \
- BYTE bufferName[(bytes)]; \
- } t; \
- TPM2B b; \
+#define TPM2B_TYPE2(name, type, bufferName) \
+ typedef union { \
+ struct { \
+ UINT16 size; \
+ type bufferName; \
+ } t; \
+ TPM2B b; \
} TPM2B_##name
-#define TPM2B_TYPE2(name, type, bufferName ) \
- typedef union { \
- struct { \
- UINT16 size; \
- type bufferName; \
- } t; \
- TPM2B b; \
- } TPM2B_##name
-
-
-// Macro to instance and initialize a TPM2B value
-
-#define TPM2B_INIT(TYPE, name) \
- TPM2B_##TYPE name = {sizeof(name.t.buffer), {0}}
-
-#define TPM2B_BYTE_VALUE(bytes) TPM2B_TYPE(bytes##_BYTE_VALUE, bytes)
-
#endif