From 11cb2637e70d71694f3f5cddef9d3ee15460a86f Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Mon, 2 Sep 2019 11:55:45 +0100 Subject: [PATCH] TinyCrypt PK wrap: Simplify guards in pk_wrap.c With TinyCrypt and legacy ECC mutually exclusive, we don't have to use #if TINYCRYPT #else #if LEGACY #endif #endif anymore, but can add the TC and legacy based ECC implementations independently. --- library/pk_wrap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/pk_wrap.c b/library/pk_wrap.c index d683895fc..48eb602fd 100644 --- a/library/pk_wrap.c +++ b/library/pk_wrap.c @@ -38,7 +38,8 @@ #include "tinycrypt/ecc_dsa.h" #include "mbedtls/asn1.h" #include "mbedtls/asn1write.h" -#else +#endif /* MBEDTLS_USE_TINYCRYPT */ + #if defined(MBEDTLS_ECP_C) #include "mbedtls/ecp.h" #endif @@ -46,7 +47,6 @@ #if defined(MBEDTLS_ECDSA_C) #include "mbedtls/ecdsa.h" #endif -#endif /* MBEDTLS_USE_TINYCRYPT */ #if defined(MBEDTLS_PK_RSA_ALT_SUPPORT) #include "mbedtls/platform_util.h" @@ -714,7 +714,8 @@ const mbedtls_pk_info_t mbedtls_uecc_eckey_info = { uecc_eckey_free_wrap, NULL, }; -#else +#endif /* MBEDTLS_USE_TINYCRYPT */ + #if defined(MBEDTLS_ECDSA_C) static int ecdsa_can_do( mbedtls_pk_type_t type ) { @@ -837,7 +838,6 @@ const mbedtls_pk_info_t mbedtls_ecdsa_info = { eckey_debug, /* Compatible key structures */ }; #endif /* MBEDTLS_ECDSA_C */ -#endif /* MBEDTLS_USE_TINYCRYPT */ #if defined(MBEDTLS_PK_RSA_ALT_SUPPORT) /*