Boolean circuits for HQC support sampling #
The candidate circuit implements the multiply-high expression in SampleSupport2 using the
existing modular multiplier and carry-lookahead adder. It widens intermediate products before
selecting the high bits, so its correctness theorem requires no overflow approximation.
Main definitions #
Cslib.Crypto.HQC.candidateCircuit: one bounded-word candidate at a specified offset.
Main results #
Cslib.Crypto.HQC.val_eval_candidateCircuit: exact candidate value.Cslib.Crypto.HQC.size_candidateCircuit: multiplier, adder and exactly six constant gates.Cslib.Crypto.HQC.size_candidateCircuit_le: a construction-derived Boolean gate bound.
References #
The candidate formula is HQC version 5.1, SampleSupport2, p. 19, line 5.
The circuit construction and its costs are original bridges to the existing Boolean compiler.
Compute one source candidate from its fair input word. Constants and zero padding use the
existing shared two-gate constant-word circuit. The total circuit truncates to bits outputs.
With a wide enough output word and a valid shrinking interval, the circuit computes the source's exact multiply-high candidate, not a modular-reduction approximation.
There are three two-gate constant words, plus the existing multiplier and adder. Output selections and input copies are free wires in the Boolean circuit model.