diff --git a/src/libsodium/crypto_ipcrypt/ipcrypt_aesni.c b/src/libsodium/crypto_ipcrypt/ipcrypt_aesni.c index fe02cba5..944edb3b 100644 --- a/src/libsodium/crypto_ipcrypt/ipcrypt_aesni.c +++ b/src/libsodium/crypto_ipcrypt/ipcrypt_aesni.c @@ -41,7 +41,7 @@ typedef __m128i BlockVec; typedef BlockVec KeySchedule[1 + ROUNDS]; static void -expand_key(KeySchedule rkeys, const uint8_t key[16]) +expand_key(BlockVec *rkeys, const uint8_t key[16]) { BlockVec t, s; size_t i = 0; @@ -68,7 +68,7 @@ expand_key(KeySchedule rkeys, const uint8_t key[16]) } static void -aes_encrypt(uint8_t out[16], const uint8_t in[16], const KeySchedule rkeys) +aes_encrypt(uint8_t out[16], const uint8_t in[16], const BlockVec *rkeys) { BlockVec t; size_t i; @@ -82,7 +82,7 @@ aes_encrypt(uint8_t out[16], const uint8_t in[16], const KeySchedule rkeys) } static void -aes_decrypt(uint8_t out[16], const uint8_t in[16], const KeySchedule rkeys) +aes_decrypt(uint8_t out[16], const uint8_t in[16], const BlockVec *rkeys) { KeySchedule rkeys_inv; BlockVec t; @@ -109,7 +109,7 @@ tweak_expand(const uint8_t tweak[8]) static void aes_encrypt_with_tweak(uint8_t out[16], const uint8_t in[16], const uint8_t tweak[8], - const KeySchedule rkeys) + const BlockVec *rkeys) { const BlockVec tweak_block = tweak_expand(tweak); BlockVec t; @@ -125,7 +125,7 @@ aes_encrypt_with_tweak(uint8_t out[16], const uint8_t in[16], const uint8_t twea static void aes_decrypt_with_tweak(uint8_t out[16], const uint8_t in[16], const uint8_t tweak[8], - const KeySchedule rkeys) + const BlockVec *rkeys) { KeySchedule rkeys_inv; const BlockVec tweak_block = tweak_expand(tweak); @@ -145,7 +145,7 @@ aes_decrypt_with_tweak(uint8_t out[16], const uint8_t in[16], const uint8_t twea } static BlockVec -aes_xex_tweak(const uint8_t tweak[16], const KeySchedule tkeys) +aes_xex_tweak(const uint8_t tweak[16], const BlockVec *tkeys) { BlockVec tt; size_t i; @@ -160,7 +160,7 @@ aes_xex_tweak(const uint8_t tweak[16], const KeySchedule tkeys) static void aes_xex_encrypt(uint8_t out[16], const uint8_t in[16], const uint8_t tweak[16], - const KeySchedule tkeys, const KeySchedule rkeys) + const BlockVec *tkeys, const BlockVec *rkeys) { const BlockVec tt = aes_xex_tweak(tweak, tkeys); BlockVec t; @@ -176,7 +176,7 @@ aes_xex_encrypt(uint8_t out[16], const uint8_t in[16], const uint8_t tweak[16], static void aes_xex_decrypt(uint8_t out[16], const uint8_t in[16], const uint8_t tweak[16], - const KeySchedule tkeys, const KeySchedule rkeys) + const BlockVec *tkeys, const BlockVec *rkeys) { KeySchedule rkeys_inv; const BlockVec tt = aes_xex_tweak(tweak, tkeys); diff --git a/src/libsodium/crypto_ipcrypt/ipcrypt_armcrypto.c b/src/libsodium/crypto_ipcrypt/ipcrypt_armcrypto.c index a7edfdbf..12481c74 100644 --- a/src/libsodium/crypto_ipcrypt/ipcrypt_armcrypto.c +++ b/src/libsodium/crypto_ipcrypt/ipcrypt_armcrypto.c @@ -68,7 +68,7 @@ AES_KEYGEN(BlockVec block_vec, const int rc) } static void -expand_key(KeySchedule rkeys, const uint8_t key[16]) +expand_key(BlockVec *rkeys, const uint8_t key[16]) { BlockVec t, s; size_t i = 0; @@ -95,7 +95,7 @@ expand_key(KeySchedule rkeys, const uint8_t key[16]) } static void -aes_encrypt(uint8_t out[16], const uint8_t in[16], const KeySchedule rkeys) +aes_encrypt(uint8_t out[16], const uint8_t in[16], const BlockVec *rkeys) { BlockVec t; size_t i; @@ -110,7 +110,7 @@ aes_encrypt(uint8_t out[16], const uint8_t in[16], const KeySchedule rkeys) } static void -aes_decrypt(uint8_t out[16], const uint8_t in[16], const KeySchedule rkeys) +aes_decrypt(uint8_t out[16], const uint8_t in[16], const BlockVec *rkeys) { KeySchedule rkeys_inv; BlockVec t; @@ -136,7 +136,7 @@ tweak_expand(const uint8_t tweak[8]) static void aes_encrypt_with_tweak(uint8_t out[16], const uint8_t in[16], const uint8_t tweak[8], - const KeySchedule rkeys) + const BlockVec *rkeys) { const BlockVec tweak_block = tweak_expand(tweak); BlockVec t; @@ -153,7 +153,7 @@ aes_encrypt_with_tweak(uint8_t out[16], const uint8_t in[16], const uint8_t twea static void aes_decrypt_with_tweak(uint8_t out[16], const uint8_t in[16], const uint8_t tweak[8], - const KeySchedule rkeys) + const BlockVec *rkeys) { KeySchedule rkeys_inv; const BlockVec tweak_block = tweak_expand(tweak); @@ -174,7 +174,7 @@ aes_decrypt_with_tweak(uint8_t out[16], const uint8_t in[16], const uint8_t twea } static BlockVec -aes_xex_tweak(const uint8_t tweak[16], const KeySchedule tkeys) +aes_xex_tweak(const uint8_t tweak[16], const BlockVec *tkeys) { BlockVec tt; size_t i; @@ -190,7 +190,7 @@ aes_xex_tweak(const uint8_t tweak[16], const KeySchedule tkeys) static void aes_xex_encrypt(uint8_t out[16], const uint8_t in[16], const uint8_t tweak[16], - const KeySchedule tkeys, const KeySchedule rkeys) + const BlockVec *tkeys, const BlockVec *rkeys) { const BlockVec tt = aes_xex_tweak(tweak, tkeys); BlockVec t; @@ -207,7 +207,7 @@ aes_xex_encrypt(uint8_t out[16], const uint8_t in[16], const uint8_t tweak[16], static void aes_xex_decrypt(uint8_t out[16], const uint8_t in[16], const uint8_t tweak[16], - const KeySchedule tkeys, const KeySchedule rkeys) + const BlockVec *tkeys, const BlockVec *rkeys) { KeySchedule rkeys_inv; const BlockVec tt = aes_xex_tweak(tweak, tkeys); diff --git a/src/libsodium/crypto_xof/shake128/xof_shake128.c b/src/libsodium/crypto_xof/shake128/xof_shake128.c index ae295fdf..c16c7628 100644 --- a/src/libsodium/crypto_xof/shake128/xof_shake128.c +++ b/src/libsodium/crypto_xof/shake128/xof_shake128.c @@ -24,8 +24,6 @@ int crypto_xof_shake128(unsigned char *out, size_t outlen, const unsigned char *in, unsigned long long inlen) { - shake128_state_internal state; - COMPILER_ASSERT(sizeof(crypto_xof_shake128_state) >= sizeof(shake128_state_internal)); return shake128_ref(out, outlen, in, (size_t) inlen); diff --git a/src/libsodium/crypto_xof/shake256/xof_shake256.c b/src/libsodium/crypto_xof/shake256/xof_shake256.c index e0f72f57..c5430ac3 100644 --- a/src/libsodium/crypto_xof/shake256/xof_shake256.c +++ b/src/libsodium/crypto_xof/shake256/xof_shake256.c @@ -24,8 +24,6 @@ int crypto_xof_shake256(unsigned char *out, size_t outlen, const unsigned char *in, unsigned long long inlen) { - shake256_state_internal state; - COMPILER_ASSERT(sizeof(crypto_xof_shake256_state) >= sizeof(shake256_state_internal)); return shake256_ref(out, outlen, in, (size_t) inlen); diff --git a/src/libsodium/crypto_xof/turboshake128/xof_turboshake128.c b/src/libsodium/crypto_xof/turboshake128/xof_turboshake128.c index bb583555..cbd80634 100644 --- a/src/libsodium/crypto_xof/turboshake128/xof_turboshake128.c +++ b/src/libsodium/crypto_xof/turboshake128/xof_turboshake128.c @@ -24,8 +24,6 @@ int crypto_xof_turboshake128(unsigned char *out, size_t outlen, const unsigned char *in, unsigned long long inlen) { - turboshake128_state_internal state; - COMPILER_ASSERT(sizeof(crypto_xof_turboshake128_state) >= sizeof(turboshake128_state_internal)); return turboshake128_ref(out, outlen, in, (size_t) inlen); diff --git a/src/libsodium/crypto_xof/turboshake256/xof_turboshake256.c b/src/libsodium/crypto_xof/turboshake256/xof_turboshake256.c index 33fd608d..a8771364 100644 --- a/src/libsodium/crypto_xof/turboshake256/xof_turboshake256.c +++ b/src/libsodium/crypto_xof/turboshake256/xof_turboshake256.c @@ -24,8 +24,6 @@ int crypto_xof_turboshake256(unsigned char *out, size_t outlen, const unsigned char *in, unsigned long long inlen) { - turboshake256_state_internal state; - COMPILER_ASSERT(sizeof(crypto_xof_turboshake256_state) >= sizeof(turboshake256_state_internal)); return turboshake256_ref(out, outlen, in, (size_t) inlen);