sha3: Fix applying second padding bit on big-endian platforms
Fixes: 56f4b2096a ("sha3: Fix Keccak when compiled with GCC 13.x")
This commit is contained in:
@@ -435,7 +435,7 @@ METHOD(sha3_keccak_t, finalize, void,
|
|||||||
* optimizations */
|
* optimizations */
|
||||||
rate_lanes = (this->rate - 1) / sizeof(uint64_t);
|
rate_lanes = (this->rate - 1) / sizeof(uint64_t);
|
||||||
remainder = (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 */
|
/* Switch to the squeezing phase */
|
||||||
keccak_f1600_state_permute(this->state);
|
keccak_f1600_state_permute(this->state);
|
||||||
|
|||||||
Reference in New Issue
Block a user