Commit 1b9b037816 for strongswan.org
commit 1b9b0378161e7d20290179733e576a3cad43fcaa
Author: Tobias Brunner <tobias@strongswan.org>
Date: Mon Jul 13 18:57:43 2026 +0200
sha3: Fix applying second padding bit on big-endian platforms
Fixes: 56f4b2096aec ("sha3: Fix Keccak when compiled with GCC 13.x")
diff --git a/src/libstrongswan/plugins/sha3/sha3_keccak.c b/src/libstrongswan/plugins/sha3/sha3_keccak.c
index 480855692a..df16c07ad8 100644
--- a/src/libstrongswan/plugins/sha3/sha3_keccak.c
+++ b/src/libstrongswan/plugins/sha3/sha3_keccak.c
@@ -435,7 +435,7 @@ METHOD(sha3_keccak_t, finalize, void,
* optimizations */
rate_lanes = (this->rate - 1) / sizeof(uint64_t);
remainder = (this->rate - 1) % sizeof(uint64_t);
- state_lanes[rate_lanes] ^= (0x80ULL << remainder * 8);
+ state_lanes[rate_lanes] ^= htole64(0x80ULL << remainder * 8);
/* Switch to the squeezing phase */
keccak_f1600_state_permute(this->state);