LIBS=$save_LIBS
AM_CONDITIONAL(NEED_CHACHA, [test "$have_chacha_set_counter" != "yes"])
+# Check for SIV-CMAC
+save_LIBS=$LIBS
+LIBS="$LIBS $NETTLE_LIBS"
+AC_CHECK_FUNCS(nettle_siv_cmac_aes128_set_key)
+LIBS=$save_LIBS
+AM_CONDITIONAL(NEED_SIV, [test "$ac_cv_func_nettle_siv_cmac_aes128_set_key" != "yes"])
+
# Check sonames of the linked libraries needed for FIPS selftests.
save_LIBS=$LIBS
LIBS="$LIBS $GMP_LIBS"
xts.h
xts-aes128.c
xts-aes256.c
+siv-cmac.c
+siv-cmac.h
+siv-cmac-aes128.c
+siv-cmac-aes256.c
"
PUBLIC="
;;
esac
case $dst in
- */cfb.c | */cmac.c | */xts.c)
+ */cfb.c | */cmac.c | */xts.c | */siv-cmac.c)
sed \
-e 's/"nettle-internal\.h"/"nettle-alloca.h"/' \
$dst > $dst-t && mv $dst-t $dst
$dst > $dst-t && mv $dst-t $dst
;;
esac
+ case $dst in
+ */siv-cmac*.[ch])
+ sed \
+ -e '/^#include "cmac\.h"/ { i\
+#ifdef HAVE_NETTLE_CMAC128_UPDATE\
+#include <nettle/cmac.h>\
+#else\
+#include "cmac.h"\
+#endif
+; d
+}' \
+ $dst > $dst-t && mv $dst-t $dst
+ ;;
+ esac
else
echo "Error: $src not found" 1>&2
exit 1
backport/poly1305.h backport/poly1305-internal.c \
backport/poly1305-internal.h
endif
+
+if NEED_SIV
+libcrypto_la_SOURCES += \
+ backport/siv-cmac-aes128.c backport/siv-cmac-aes256.c \
+ backport/siv-cmac.c backport/siv-cmac.h
+endif