From 380be9610c598f3b0d69a47204c1adba762eeaee Mon Sep 17 00:00:00 2001 From: Kamil Sroka Date: Thu, 3 Jan 2019 19:27:38 +0100 Subject: [PATCH] [nrf52840] fix build with IAR (#3428) --- .../libraries/crypto/ecp_alt_cc310.c | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/third_party/NordicSemiconductor/libraries/crypto/ecp_alt_cc310.c b/third_party/NordicSemiconductor/libraries/crypto/ecp_alt_cc310.c index 9ebff782e..d2a657874 100644 --- a/third_party/NordicSemiconductor/libraries/crypto/ecp_alt_cc310.c +++ b/third_party/NordicSemiconductor/libraries/crypto/ecp_alt_cc310.c @@ -74,11 +74,13 @@ * - Hardware accelerated EC point multiplication. * - Hardware accelerated EC key pair generation. * - * Added lines [496 - 749] - * Changed code in [2620 - 2631] - * Changed code in [3005 - 3013] + * Added lines [103 - 107] + * Added lines [126 - 185] from ecp.h (lines [188 - 250] with lines [246 - 248] excluded) + * Added lines [502 - 749] + * Changed code in [2620 - 2631] to use HW acceleration if possible + * Changed code in [3005 - 3013] to use HW acceleration if possible * - * Original file (ecp.c) from d369956d42764dc8173a8bf8106ed0f1defedec6 + * Original files (ecp.c, ecp.h) from d369956d42764dc8173a8bf8106ed0f1defedec6 */ @@ -98,6 +100,12 @@ #if defined(MBEDTLS_ECP_ALT) +#include "cc310_mbedtls.h" +#include "crys_rnd.h" +#include "crys_ecpki_kg.h" +#include "crys_ecpki_domain.h" +#include "ssi_bitops.h" + #if defined(MBEDTLS_PLATFORM_C) #include "mbedtls/platform.h" #else @@ -182,9 +190,6 @@ int mbedtls_ecp_check_budget( const mbedtls_ecp_group *grp, #define MBEDTLS_ECP_BUDGET( ops ) /* no-op; for compatibility */ -/* We want to declare restartable versions of existing functions anyway */ -typedef void mbedtls_ecp_restart_ctx; - #endif /* MBEDTLS_ECP_RESTARTABLE */ #if defined(MBEDTLS_ECP_RESTARTABLE) @@ -495,12 +500,6 @@ static const mbedtls_ecp_curve_info ecp_supported_curves[] = static mbedtls_ecp_group_id ecp_supported_grp_id[ECP_NB_CURVES]; -#include "cc310_mbedtls.h" -#include "crys_rnd.h" -#include "crys_ecpki_kg.h" -#include "crys_ecpki_domain.h" -#include "ssi_bitops.h" - extern CRYSError_t PkaEcWrstScalarMult(const CRYS_ECPKI_Domain_t *pDomain, const uint32_t *scalar, uint32_t scalSizeInWords,