From 584f61dcd43234e936e9009e10ba48367f31a303 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 4 Dec 2024 17:22:07 +0100 Subject: [PATCH 1/2] Use uint64_t sizes in aegis*_mac() No-op in libsodium for now, but useful if we introduce a streaming API later. --- src/libsodium/crypto_aead/aegis128l/aegis128l_common.h | 4 ++-- src/libsodium/crypto_aead/aegis256/aegis256_common.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libsodium/crypto_aead/aegis128l/aegis128l_common.h b/src/libsodium/crypto_aead/aegis128l/aegis128l_common.h index 6e503dc3..cfdbaf32 100644 --- a/src/libsodium/crypto_aead/aegis128l/aegis128l_common.h +++ b/src/libsodium/crypto_aead/aegis128l/aegis128l_common.h @@ -33,12 +33,12 @@ aegis128l_init(const uint8_t *key, const uint8_t *nonce, aes_block_t *const stat } static int -aegis128l_mac(uint8_t *mac, size_t maclen, size_t adlen, size_t mlen, aes_block_t *const state) +aegis128l_mac(uint8_t *mac, size_t maclen, uint64_t adlen, uint64_t mlen, aes_block_t *const state) { aes_block_t tmp; int i; - tmp = AES_BLOCK_LOAD_64x2(((uint64_t) mlen) << 3, ((uint64_t) adlen) << 3); + tmp = AES_BLOCK_LOAD_64x2(mlen << 3, adlen << 3); tmp = AES_BLOCK_XOR(tmp, state[2]); for (i = 0; i < 7; i++) { diff --git a/src/libsodium/crypto_aead/aegis256/aegis256_common.h b/src/libsodium/crypto_aead/aegis256/aegis256_common.h index adf837a9..508c5adb 100644 --- a/src/libsodium/crypto_aead/aegis256/aegis256_common.h +++ b/src/libsodium/crypto_aead/aegis256/aegis256_common.h @@ -35,12 +35,12 @@ aegis256_init(const uint8_t *key, const uint8_t *nonce, aes_block_t *const state } static int -aegis256_mac(uint8_t *mac, size_t maclen, size_t adlen, size_t mlen, aes_block_t *const state) +aegis256_mac(uint8_t *mac, size_t maclen, uint64_t adlen, uint64_t mlen, aes_block_t *const state) { aes_block_t tmp; int i; - tmp = AES_BLOCK_LOAD_64x2(((uint64_t) mlen) << 3, ((uint64_t) adlen) << 3); + tmp = AES_BLOCK_LOAD_64x2(mlen << 3, adlen << 3); tmp = AES_BLOCK_XOR(tmp, state[3]); for (i = 0; i < 7; i++) { From 39d280b2beab92073a3adb3dadb50c0ea5054e96 Mon Sep 17 00:00:00 2001 From: nil4 Date: Wed, 4 Dec 2024 13:37:19 +0100 Subject: [PATCH 2/2] Fix `buildbase.bat` for ARM64: - update version check to use **greater-than-or-equal**, i.e. to include VS 2019 **and** 2022 (or later versions) - select the `ARM64` environment (`x86_arm64` is not valid) --- builds/msvc/build/buildbase.bat | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builds/msvc/build/buildbase.bat b/builds/msvc/build/buildbase.bat index d65a876a..4e3933fb 100644 --- a/builds/msvc/build/buildbase.bat +++ b/builds/msvc/build/buildbase.bat @@ -93,9 +93,9 @@ ECHO Configuration=StaticRelease msbuild /m /v:n /p:Configuration=StaticRelease /p:Platform=x64 %solution% >> %log% IF errorlevel 1 GOTO error -@REM Build ARM64 packages only for Visual studio 19 and later -IF %version% == 16 ( - CALL !environment! x86_arm64 > nul +@REM Build ARM64 packages only for Visual studio 2019 and later +IF %version% GEQ 16 ( + CALL !environment! ARM64 > nul ECHO Platform=ARM64 ECHO Configuration=DynDebug