Documentation

Complexity.Languages.Probabilistic.CenteredBinomial

Sampling centered binomial integers #

The sampler subtracts the true counts of two independent blocks of η fair bits. Its result is an integer, before any reduction modulo a ciphertext modulus. Every integer between -η and η, including both endpoints, has positive probability. The law is invariant under negation. This is the scalar centered-binomial construction of NIST, Section 4.2.2, Algorithm 8, extended to every natural parameter.

The exact distribution is specified by its finite fair-bit experiment. No Gaussian equivalence or encryption-security property is asserted. Native runtime is certified separately.

Main definitions #

Main results #

References #

Subtract the true counts of two independent blocks of η fair bits.

Instances For
    @[simp]

    With η = 0 the centered binomial sampler returns 0 without sampling.

    theorem Cslib.Probability.eval_sampleCenteredBinomial (η : ℕ) :
    (sampleCenteredBinomial η).eval = do let positive ← BitString.uniformList η let negative ← BitString.uniformList η pure (↑(List.count true positive) - ↑(List.count true negative))

    The exact law is the difference of the true counts of two independent uniform words.

    One word of exactly 2 * η fair bits supplies the two independent counts.

    Every integer of magnitude at most η occurs, and no other integer does.

    Swapping the independent counts negates the result without changing its law.