From e3ec769107f9f3295f511ae9a2d406abbb5522ba Mon Sep 17 00:00:00 2001 From: "Erik M. Bray" Date: Sun, 4 Dec 2016 15:23:51 +0100 Subject: [PATCH] Adds an --enable-aesctr flag to the configure script to explicitly compile with -DWOLFSSL_AES_COUNTER and -DWOLFSSL_AES_DIRECT If --enable-fortress or --enable-mcapi are used they effectively force --enable-aesctr --- configure.ac | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 8afb2db4d..6e5324a30 100644 --- a/configure.ac +++ b/configure.ac @@ -148,6 +148,7 @@ then enable_pkcallbacks=yes enable_aesgcm=yes enable_aesccm=yes + enable_aesctr=yes enable_camellia=yes enable_ripemd=yes enable_sha512=yes @@ -562,6 +563,23 @@ fi AM_CONDITIONAL([BUILD_AESCCM], [test "x$ENABLED_AESCCM" = "xyes"]) +# AES-CTR +AC_ARG_ENABLE([aesctr], + [ --enable-aesctr Enable wolfSSL AES-CTR support (default: disabled)], + [ ENABLED_AESCTR=$enableval ], + [ ENABLED_AESCTR=no ] + ) + +if test "$ENABLED_AESCTR" = "yes" +then + if test "x$ENABLED_FORTRESS" != "xyes" + then + # This is already implied by fortress build + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_COUNTER -DWOLFSSL_AES_DIRECT" + fi +fi + + # AES-ARM AC_ARG_ENABLE([armasm], [AS_HELP_STRING([--enable-armasm],[Enable wolfSSL ARMv8 ASM support (default: disabled)])], @@ -1298,6 +1316,10 @@ then then AC_MSG_ERROR([AESCCM requires AES.]) fi + if test "$ENABLED_AESCTR" = "yes" + then + AC_MSG_ERROR([AESCTR requires AES.]) + fi else # turn off AES if leanpsk on if test "$ENABLED_LEANPSK" = "yes" @@ -2850,7 +2872,12 @@ AC_ARG_ENABLE([mcapi], if test "$ENABLED_MCAPI" = "yes" then - AM_CFLAGS="$AM_CFLAGS -DHAVE_MCAPI -DWOLFSSL_AES_COUNTER -DWOLFSSL_AES_DIRECT" + AM_CFLAGS="$AM_CFLAGS -DHAVE_MCAPI" + if test "x$ENABLED_AESCTR" != "xyes" + then + # These flags are already implied by --enable-aesctr + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_COUNTER -DWOLFSSL_AES_DIRECT" + fi fi if test "$ENABLED_MCAPI" = "yes" && test "$ENABLED_SHA512" = "no" @@ -3308,6 +3335,7 @@ echo " * AES: $ENABLED_AES" echo " * AES-NI: $ENABLED_AESNI" echo " * AES-GCM: $ENABLED_AESGCM" echo " * AES-CCM: $ENABLED_AESCCM" +echo " * AES-CTR: $ENABLED_AESCTR" echo " * DES3: $ENABLED_DES3" echo " * IDEA: $ENABLED_IDEA" echo " * Camellia: $ENABLED_CAMELLIA"