From c4af58b97376eec0ce54b16fd5cfe62c2c3195eb Mon Sep 17 00:00:00 2001 From: David Garske Date: Thu, 22 Dec 2016 18:11:25 -0800 Subject: [PATCH] =?UTF-8?q?Refined=20the=20FIPS=20=E2=80=9Cmin=E2=80=9D=20?= =?UTF-8?q?logic.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wolfcrypt/src/misc.c | 4 +++- wolfssl/wolfcrypt/misc.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/src/misc.c b/wolfcrypt/src/misc.c index c61804123..a0581fe35 100644 --- a/wolfcrypt/src/misc.c +++ b/wolfcrypt/src/misc.c @@ -212,7 +212,9 @@ STATIC INLINE int ConstantCompare(const byte* a, const byte* b, int length) #ifndef WOLFSSL_HAVE_MIN #define WOLFSSL_HAVE_MIN - #define min min /* for ctaocrypt FIPS */ + #if defined(HAVE_FIPS) && !defined(min) + #define min min + #endif STATIC INLINE word32 min(word32 a, word32 b) { return a > b ? b : a; diff --git a/wolfssl/wolfcrypt/misc.h b/wolfssl/wolfcrypt/misc.h index 71069c6f5..c86fe2a6f 100644 --- a/wolfssl/wolfcrypt/misc.h +++ b/wolfssl/wolfcrypt/misc.h @@ -68,7 +68,9 @@ void ByteReverseWords64(word64*, const word64*, word32); #endif /* WORD64_AVAILABLE */ #ifndef WOLFSSL_HAVE_MIN - #define min min /* for ctaocrypt FIPS */ + #if defined(HAVE_FIPS) && !defined(min) + #define min min + #endif WOLFSSL_LOCAL word32 min(word32 a, word32 b); #endif