From 1b9b0378161e7d20290179733e576a3cad43fcaa Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Mon, 13 Jul 2026 18:57:43 +0200 Subject: [PATCH] sha3: Fix applying second padding bit on big-endian platforms Fixes: 56f4b2096aec ("sha3: Fix Keccak when compiled with GCC 13.x") --- src/libstrongswan/plugins/sha3/sha3_keccak.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstrongswan/plugins/sha3/sha3_keccak.c b/src/libstrongswan/plugins/sha3/sha3_keccak.c index 480855692..df16c07ad 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);