siv: add support for Nettle

This commit is contained in:
Miroslav Lichvar
2019-08-21 14:02:49 +02:00
parent c5306bed39
commit 881d07fa0a
2 changed files with 150 additions and 0 deletions

12
configure vendored
View File

@@ -920,6 +920,18 @@ EXTRA_OBJECTS="$EXTRA_OBJECTS $HASH_OBJ"
EXTRA_CLI_OBJECTS="$EXTRA_CLI_OBJECTS $HASH_OBJ"
LIBS="$LIBS $HASH_LINK"
if true && \
echo "$HASH_LINK" | grep 'nettle' > /dev/null; then
if test_code 'SIV in nettle' \
'nettle/siv-cmac.h' "" "$LIBS" \
'siv_cmac_aes128_set_key(NULL, NULL);'
then
EXTRA_OBJECTS="$EXTRA_OBJECTS siv_nettle.o"
add_def HAVE_SIV
fi
fi
if [ $use_pthread = "1" ]; then
MYCFLAGS="$MYCFLAGS -pthread"
fi