From 24102eb95fe8062931202e408d32f2d774da4000 Mon Sep 17 00:00:00 2001 From: toddouska Date: Tue, 31 Mar 2015 13:28:49 -0700 Subject: [PATCH] on x86_64 enable sha512, ecc, and increase max_bits by default --- configure.ac | 32 ++++++++++++++++++++++++++------ wolfssl/wolfcrypt/settings.h | 8 ++++++++ 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index babb4d214..2d76fdd2e 100644 --- a/configure.ac +++ b/configure.ac @@ -522,11 +522,18 @@ fi AM_CONDITIONAL([BUILD_BLAKE2], [test "x$ENABLED_BLAKE2" = "xyes"]) +# set sha512 default +SHA512_DEFAULT=no +if test "$host_cpu" = "x86_64" +then +SHA512_DEFAULT=yes +fi + # SHA512 AC_ARG_ENABLE([sha512], - [ --enable-sha512 Enable wolfSSL SHA-512 support (default: disabled)], + [AS_HELP_STRING([--enable-sha512],[Enable wolfSSL SHA-512 support (default: enabled on x86_64)])], [ ENABLED_SHA512=$enableval ], - [ ENABLED_SHA512=no ] + [ ENABLED_SHA512=$SHA512_DEFAULT ] ) if test "$ENABLED_SHA512" = "yes" @@ -638,11 +645,19 @@ fi AM_CONDITIONAL([BUILD_DSA], [test "x$ENABLED_DSA" = "xyes"]) -# ECC +# set ecc default +ECC_DEFAULT=no + +if test "$host_cpu" = "x86_64" +then +ECC_DEFAULT=yes +fi + +# ECC AC_ARG_ENABLE([ecc], - [ --enable-ecc Enable ECC (default: disabled)], + [AS_HELP_STRING([--enable-ecc],[Enable ECC (default: enabled on x86_64)])], [ ENABLED_ECC=$enableval ], - [ ENABLED_ECC=no ] + [ ENABLED_ECC=$ECC_DEFAULT ] ) if test "$ENABLED_ECC" = "yes" @@ -655,7 +670,7 @@ AM_CONDITIONAL([BUILD_ECC], [test "x$ENABLED_ECC" = "xyes"]) if test "$ENABLED_ECC" = "yes" && test "$ENABLED_SMALL" = "yes" then - AC_MSG_ERROR([cannot enable ecc and small, ecc requires TLS which small turns off.]) + AC_MSG_ERROR([cannot enable ecc and small, ecc requires TLS which small turns off.]) fi @@ -1677,6 +1692,11 @@ then AM_CFLAGS="$AM_CFLAGS -DUSE_FAST_MATH" ENABLED_SLOWMATH="no" fi + if test "$host_cpu" = "x86_64" + then + # Have settings.h set FP_MAX_BITS higher if user didn't set directly + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_X86_64_BUILD" + fi fi diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index b2edbe206..39b75f8e9 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -748,6 +748,14 @@ #endif #endif +/* if desktop type system and fastmath increase default max bits */ +#ifdef WOLFSSL_X86_64_BUILD + #ifdef USE_FAST_MATH + #ifndef FP_MAX_BITS + #define FP_MAX_BITS 8192 + #endif + #endif +#endif /* Place any other flags or defines here */