Security › hash-35 · Constant-time review · Performance: x86_1 · arm_1

Wish (hash-35)

CandidateWish
FamilySymmetric (AES-derived sponge hash)
ArchiveWish.zip (SHA-256: f878ea89f5b5929c26445a4b1967f21139c74600d5779e4eb5d0bd7f97bea4b5)
Specificationhash-35-spec.pdf PDF
Performancex86_1 · arm_1

hash-35-1: Secret-indexed S-box and variable-time field multiplication

SeverityLow
Scopeside-channel
StatusConfirmed
AffectedReference Wish512 and Wish1024
DiscoveryTrivial
ExploitationCache or branch side-channel dependent
CreditMarkku-Juhani O. Saarinen markku-juhani.saarinen@tuni.fi, with AI assistance
Date2026-09-23

Every permutation round reads S_Box[s[i]] with an evolving secret state byte (wish.c:98). Its 256-byte table spans cache lines. GF_Mul also loops until a secret-dependent multiplier becomes zero and branches on each multiplier bit (:86-91). This gives both memory-address and control-flow leakage; no full preimage recovery is claimed. See constant_time.md.

Constant-time fix (easy, hence Low): use aesenc/vaeseq as the specification intends, with a pshufb or bitsliced AES fallback; GF_Mul becomes a fixed eight-step shift and masked-XOR multiplication.

Reproducing

Commands below run in a checkout of the ngcc-harness repository with the candidate built (see its README).

Inspect wish.c:86-99 in either reference variant. With multiplier b=1, GF_Mul executes one iteration; with b=128, it executes eight.