Skip to content

Commit 35d5af0

Browse files
authored
AES-SIV support (128 and 256) as a composition of AES-CMAC and AES-CTR (#75)
* - Skeleton code to check for AES-CTR support, if available, AES-SIV is also available. - Completed encryption and decryption implementation with s2v routine to perform the AES-CMAC operations. - Currently working on testing & fixing bugs that I find along the way; * Fixed various bugs in the SIV computation, encryption/decryption fully works now, mainly these two: - gnutls merged siv + cipher text, now we handle the splitting between the two in the wrapper to decrypt correctly the cipher; - gnutls merges all the aads, instead of handling them separately, which we handle too in the wrapper by processing one single aads always (multiple ones into one buffer), updated the test with the corrected expected results; - updated teh test to test against 128 (32 bytes key, 16 bytes for the splitting), same for the key sizes for 256 (64 bytes); Testing some more before testing against chrony. * Skip A.1 test when running without provider (GNUTLS_NO_PROVIDER=1) because Nettle requires nonce >=1 bytes, but A.1 uses empty nonce * Minor updates of the comments in the test. * - copying plain_size instead of encr_size - WC_AES_BLOCK_SIZE when encr_size exceeds encr_size + WC_AES_BLOCK_SIZE (edge case not covered, caught by the siv testsuite of chrony); - addressing codespell from the CI/CD; - updated the deb.yml workflow to also defined WOLFSSL_AES_COUNTER in order to use AES-SIV. - Fix identation (spaces instead of tabs).
1 parent 2fe4d22 commit 35d5af0

7 files changed

Lines changed: 857 additions & 87 deletions

File tree

.github/workflows/deb.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
--enable-curve25519 --enable-curve448 \
4141
--enable-aesccm --enable-aesxts --enable-aescfb \
4242
--enable-keygen --enable-shake128 --enable-shake256 \
43-
'CFLAGS=-DWOLFSSL_PUBLIC_ASN -DHAVE_FFDHE_3072 -DHAVE_FFDHE_4096 -DWOLFSSL_DH_EXTRA -DWOLFSSL_PSS_SALT_LEN_DISCOVER -DWOLFSSL_PUBLIC_MP -DWOLFSSL_RSA_KEY_CHECK -DHAVE_FFDHE_Q -DHAVE_FFDHE_6144 -DHAVE_FFDHE_8192 -DWOLFSSL_ECDSA_DETERMINISTIC_K -DWOLFSSL_VALIDATE_ECC_IMPORT -DRSA_MIN_SIZE=1024'
43+
'CFLAGS=-DWOLFSSL_PUBLIC_ASN -DHAVE_FFDHE_3072 -DHAVE_FFDHE_4096 -DWOLFSSL_DH_EXTRA -DWOLFSSL_PSS_SALT_LEN_DISCOVER -DWOLFSSL_PUBLIC_MP -DWOLFSSL_RSA_KEY_CHECK -DHAVE_FFDHE_Q -DHAVE_FFDHE_6144 -DHAVE_FFDHE_8192 -DWOLFSSL_ECDSA_DETERMINISTIC_K -DWOLFSSL_VALIDATE_ECC_IMPORT -DRSA_MIN_SIZE=1024 -DWOLFSSL_AES_COUNTER'
4444
make -j"$(nproc)"
4545
sudo make deb
4646
sudo dpkg -i ../libwolfssl_*.deb ../libwolfssl-dev_*.deb ../libwolfssl-dbgsym_*.deb

setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ else
126126
cd ./wolfssl
127127
./autogen.sh
128128

129-
./configure --prefix=$WOLFSSL_INSTALL/ CC=clang --enable-cmac --with-eccminsz=192 --enable-ed25519 --enable-ed448 --enable-md5 --enable-curve25519 --enable-curve448 --enable-aesccm --enable-aesxts --enable-aescfb --enable-keygen --enable-shake128 --enable-shake256 'CFLAGS=-DWOLFSSL_PUBLIC_ASN -DHAVE_FFDHE_3072 -DHAVE_FFDHE_4096 -DWOLFSSL_DH_EXTRA -DWOLFSSL_PSS_SALT_LEN_DISCOVER -DWOLFSSL_PUBLIC_MP -DWOLFSSL_RSA_KEY_CHECK -DHAVE_FFDHE_Q -DHAVE_FFDHE_6144 -DHAVE_FFDHE_8192 -DWOLFSSL_ECDSA_DETERMINISTIC_K -DWOLFSSL_VALIDATE_ECC_IMPORT -DRSA_MIN_SIZE=1024'
129+
./configure --prefix=$WOLFSSL_INSTALL/ CC=clang --enable-cmac --with-eccminsz=192 --enable-ed25519 --enable-ed448 --enable-md5 --enable-curve25519 --enable-curve448 --enable-aesccm --enable-aesxts --enable-aescfb --enable-keygen --enable-shake128 --enable-shake256 'CFLAGS=-DWOLFSSL_PUBLIC_ASN -DHAVE_FFDHE_3072 -DHAVE_FFDHE_4096 -DWOLFSSL_DH_EXTRA -DWOLFSSL_PSS_SALT_LEN_DISCOVER -DWOLFSSL_PUBLIC_MP -DWOLFSSL_RSA_KEY_CHECK -DHAVE_FFDHE_Q -DHAVE_FFDHE_6144 -DHAVE_FFDHE_8192 -DWOLFSSL_ECDSA_DETERMINISTIC_K -DWOLFSSL_VALIDATE_ECC_IMPORT -DRSA_MIN_SIZE=1024 -DWOLFSSL_AES_COUNTER'
130130

131131
make
132132
sudo make install

0 commit comments

Comments
 (0)