From 0df5079f8b9a4616ba682509609969fc56fa823c Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 30 Oct 2020 12:46:14 -0700 Subject: [PATCH] Fixes for building with Microchip. The min/max patch allows non PIC32MZ parts to build in MPLABX. The cryptoauthlib already defines `SHA_BLOCK_SIZE`, so undef to prevent redef error. --- wolfssl/wolfcrypt/port/atmel/atmel.h | 4 +--- wolfssl/wolfcrypt/settings.h | 5 +++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/wolfssl/wolfcrypt/port/atmel/atmel.h b/wolfssl/wolfcrypt/port/atmel/atmel.h index 9b891f025..b917a8022 100644 --- a/wolfssl/wolfcrypt/port/atmel/atmel.h +++ b/wolfssl/wolfcrypt/port/atmel/atmel.h @@ -29,10 +29,8 @@ #if defined(WOLFSSL_ATECC508A) || defined(WOLFSSL_ATECC608A) || \ defined(WOLFSSL_ATECC_PKCB) - #undef SHA_BLOCK_SIZE - #define SHA_BLOCK_SIZE SHA_BLOCK_SIZE_REMAP - #include #undef SHA_BLOCK_SIZE + #include #endif /* ATECC508A/608A only supports ECC P-256 */ diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index fc9e3d783..7ee84a288 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -358,12 +358,13 @@ #define NO_FILESYSTEM #define USE_FAST_MATH #define TFM_TIMING_RESISTANT - #define WOLFSSL_HAVE_MIN - #define WOLFSSL_HAVE_MAX #define NO_BIG_INT #endif #ifdef WOLFSSL_MICROCHIP_PIC32MZ + #define WOLFSSL_HAVE_MIN + #define WOLFSSL_HAVE_MAX + #ifndef NO_PIC32MZ_CRYPT #define WOLFSSL_PIC32MZ_CRYPT #endif