siv: add internal implementation based on Nettle

This adds an internal implementation of the AES-SIV-CMAC-256 cipher
based on GNU Nettle and the following patch (which was later reworked
and included in Nettle):

https://gitlab.com/gnutls/gnutls/uploads/1ab02c51e317264f9dba07ddfbc01d9a/0001-Added-support-for-AES_SIV_CMAC_256-and-AES_SIV_CMAC_.patch

This implementation will be dropped when the cipher is widely supported
by gnutls or Nettle.
This commit is contained in:
Miroslav Lichvar
2019-08-21 14:09:37 +02:00
parent 881d07fa0a
commit 2d798bc4cf
3 changed files with 460 additions and 2 deletions

6
configure vendored
View File

@@ -923,12 +923,14 @@ LIBS="$LIBS $HASH_LINK"
if true && \
echo "$HASH_LINK" | grep 'nettle' > /dev/null; then
EXTRA_OBJECTS="$EXTRA_OBJECTS siv_nettle.o"
add_def HAVE_SIV
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
add_def HAVE_NETTLE_SIV_CMAC
fi
fi