]> git.ipfire.org Git - thirdparty/strongswan.git/commit
sha3: Fix Keccak when compiled with GCC 13.x
authorTobias Brunner <tobias@strongswan.org>
Thu, 28 Mar 2024 10:51:15 +0000 (11:51 +0100)
committerTobias Brunner <tobias@strongswan.org>
Tue, 2 Apr 2024 12:19:40 +0000 (14:19 +0200)
commit56f4b2096aecda21b3e0afcc279702eb42f5026e
tree8c916b5bc95a3130b022f2e62b6e4c04bd5af489
parentac713746c9dd2ccc4b5ad0372b82806907f5d73c
sha3: Fix Keccak when compiled with GCC 13.x

With GCC 13, the compiler apparently applies new aliasing optimizations
when compiled with -O2 and without -fno-strict-aliasing.  This caused
the application of the second padding bit, where the state was accessed
via uint8_t[], to be moved before the loop that absorbs the buffer into
the state, where the state is accessed via uint64_t[], resulting in
incorrect output.  By only accessing the state via uint64_t[] here the
compiler won't reorder the instructions.
src/libstrongswan/plugins/sha3/sha3_keccak.c