Scalar bit encoding, decoding, and binary noise bounds modulo 2 ^ w #
For modulus 2 ^ w, a bit μ is encoded as μ * 2 ^ (w - 1) (encodeBit) and decoded by
selecting the half-open middle half [2 ^ w / 4, 3 * 2 ^ w / 4) of the canonical residue
interval (decodeResidue, decode). Correctness holds whenever the additive integer error has
magnitude strictly below one quarter of 2 ^ w (decode_eq_of_error). This module also hosts the
common magnitude bound natAbs_binarySum_le for integer subset sums over Boolean coefficients.
Main definitions #
Cslib.Crypto.LWE.encodeBit: half-modulus encodingfalse ↦ 0,true ↦ 2 ^ (w - 1).Cslib.Crypto.LWE.decodeResidue: scalar bit decoder on natural residue representatives.Cslib.Crypto.LWE.decode: scalar bit decoder overZMod (2 ^ w).
Main results #
Cslib.Crypto.LWE.computableInPolyTime_decodeResidue: polynomial-time rounding of binary residue representatives for unary widthw.Cslib.Crypto.LWE.decode_eq_of_error: errors of magnitude strictly below one quarter of the modulus preserve the encoded bit.Cslib.Crypto.LWE.decode_eq_xor_highBits: for width at least two, decoding is exclusive-or of the two highest bits of the canonical residue, on every input.Cslib.Crypto.LWE.natAbs_binarySum_le_sum,Cslib.Crypto.LWE.natAbs_binarySum_le: integer noise bounds for binary subset sums shared across GSW and Regev encryption.
References #
- [O. Regev, On lattices, learning with errors, random linear codes, and cryptography] [Reg09], Section 5.
- C. Gentry, A. Sahai and B. Waters, Homomorphic Encryption from Learning with Errors: Conceptually-Simpler, Asymptotically-Faster, Attribute-Based, Section 3.1.
Decode a natural residue representative modulo 2 ^ w by selecting the half-open middle half
[2 ^ w / 4, 3 * 2 ^ w / 4) of [0, 2 ^ w).
At width zero, residue zero decodes to false.
Rounding a natural residue representative value modulo 2 ^ w via decodeResidue is
computable in polynomial time for unary w and binary value.
The half-open middle interval is exactly the set where the two highest bits differ. This identity holds on every residue, including both quarter-boundary ties.