From 7e62c31097723d8cffa056362c06f5af24e9f813 Mon Sep 17 00:00:00 2001 From: Andrzej Kurek Date: Wed, 14 Oct 2020 12:02:40 +0200 Subject: [PATCH] Guard the tinycrypt code with MBEDTLS_USE_TINYCRYPT Signed-off-by: Andrzej Kurek --- tinycrypt/ecc.c | 2 ++ tinycrypt/ecc_dh.c | 2 ++ tinycrypt/ecc_dsa.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/tinycrypt/ecc.c b/tinycrypt/ecc.c index cfc527b2f..6c944d33f 100644 --- a/tinycrypt/ecc.c +++ b/tinycrypt/ecc.c @@ -63,6 +63,7 @@ #include MBEDTLS_CONFIG_FILE #endif +#if defined(MBEDTLS_USE_TINYCRYPT) #include #include "mbedtls/platform_util.h" #include "mbedtls/sha256.h" @@ -1853,3 +1854,4 @@ int uECC_compute_public_key(const uint8_t *private_key, uint8_t *public_key) return ret; } +#endif /* MBEDTLS_USE_TINYCRYPT */ diff --git a/tinycrypt/ecc_dh.c b/tinycrypt/ecc_dh.c index 6285cf357..b6b1898d3 100644 --- a/tinycrypt/ecc_dh.c +++ b/tinycrypt/ecc_dh.c @@ -66,6 +66,7 @@ #include MBEDTLS_CONFIG_FILE #endif +#if defined(MBEDTLS_USE_TINYCRYPT) #include #include #include @@ -195,3 +196,4 @@ int uECC_shared_secret(const uint8_t *public_key, const uint8_t *private_key, return UECC_FAULT_DETECTED; } +#endif /* MBEDTLS_USE_TINYCRYPT */ diff --git a/tinycrypt/ecc_dsa.c b/tinycrypt/ecc_dsa.c index d432a2e6a..fe3952c2d 100644 --- a/tinycrypt/ecc_dsa.c +++ b/tinycrypt/ecc_dsa.c @@ -64,6 +64,7 @@ #include MBEDTLS_CONFIG_FILE #endif +#if defined(MBEDTLS_USE_TINYCRYPT) #include #include #include "mbedtls/platform_util.h" @@ -314,3 +315,4 @@ int uECC_verify(const uint8_t *public_key, const uint8_t *message_hash, return UECC_FAILURE; } +#endif /* MBEDTLS_USE_TINYCRYPT */