Add some missing compilation guards
Add missing checks for defined(MBEDTLS_MD_C) around types and
functions that require it (HMAC, HKDF, TLS12_PRF).
Add missing checks for defined(MBEDTLS_ECDSA_DETERMINISTIC) around
code that calls mbedtls_ecdsa_sign_det().
Add missing checks for defined(MBEDTLS_ECDH_C) around ECDH-specific
functions.
diff --git a/include/psa/crypto_struct.h b/include/psa/crypto_struct.h
index f11b87c..44a1a60 100644
--- a/include/psa/crypto_struct.h
+++ b/include/psa/crypto_struct.h
@@ -85,7 +85,7 @@
} ctx;
};
-
+#if defined(MBEDTLS_MD_C)
typedef struct
{
/** The hash context. */
@@ -93,7 +93,7 @@
/** The HMAC part of the context. */
uint8_t opad[PSA_HMAC_MAX_HASH_BLOCK_SIZE];
} psa_hmac_internal_data;
-
+#endif /* MBEDTLS_MD_C */
struct psa_mac_operation_s
{
@@ -130,6 +130,7 @@
} ctx;
};
+#if defined(MBEDTLS_MD_C)
typedef struct
{
uint8_t *info;
@@ -143,7 +144,9 @@
uint8_t offset_in_block;
uint8_t block_number;
} psa_hkdf_generator_t;
+#endif /* MBEDTLS_MD_C */
+#if defined(MBEDTLS_MD_C)
typedef struct psa_tls12_prf_generator_s
{
/* The TLS 1.2 PRF uses the key for each HMAC iteration,
@@ -172,6 +175,7 @@
uint8_t block_number;
} psa_tls12_prf_generator_t;
+#endif /* MBEDTLS_MD_C */
struct psa_crypto_generator_s
{