Documentation

CslibFrontier.Crypto.Computational.Falcon.BerExp

Falcon v1.2 BerExp threshold distribution #

Falcon v1.2 Algorithm 14 computes a 64-bit integer threshold z from floating-point inputs, then accepts exactly when a uniform 64-bit value is strictly below z. This module isolates that exact distributional boundary after z has already been computed. The resulting acceptance mass is z / 2^64 for every possible threshold, including both endpoints of the unsigned range.

berExpThresholdCoin uses the shared exact 64-fair-bit sampler. It is denotationally equivalent to Algorithm 14's threshold comparison, but does not model the reference implementation's lazy one-to-eight-byte consumption trace. It also does not formalize ApproxExp, bound floating-point error, construct BaseSampler or SamplerZ, prove a Gaussian law or termination, certify native resources, or establish a security reduction or the still-developing FN-DSA / FIPS 206 interface. NIST lists that interface as under development as of 13 November 2026 ([NIST26]).

Main definitions #

Main results #

References #

@[reducible, inline]

The 64-bit unsigned integer threshold produced before Algorithm 14's uniform comparison.

Algorithm 14 accepts a uniform word exactly when it is strictly below the threshold.

The probabilistic experiment supplies a sample below 2 ^ 64; accepting a natural number keeps this predicate as the single comparison implementation used by both the experiment and direct clients.

@[simp]
theorem Cslib.Crypto.Falcon.berExpThresholdAccepts_eq_true_iff (threshold : BerExpThreshold) (sample : ℕ) :
berExpThresholdAccepts threshold sample = true ↔ sample < ↑threshold

The deterministic threshold comparison accepts exactly below the threshold.

@[simp]
theorem Cslib.Crypto.Falcon.berExpThresholdAccepts_eq_false_iff (threshold : BerExpThreshold) (sample : ℕ) :
berExpThresholdAccepts threshold sample = false ↔ ↑threshold ≤ sample

The deterministic threshold comparison rejects exactly at or above the threshold.

The exact distributional threshold step of Falcon v1.2 BerExp.

This draws a fixed 64 fair bits through the shared sampler. The reference implementation compares successive bytes lazily; that operational consumption trace is deliberately outside this denotational interface.

theorem Cslib.Crypto.Falcon.eval_berExpThresholdCoin_true (threshold : BerExpThreshold) :
(berExpThresholdCoin threshold).eval true = ↑↑threshold / 2 ^ 64

Algorithm 14's threshold step accepts with exact mass z / 2^64.

Real-valued form of the exact BerExp threshold acceptance mass.

Rejection has the complementary real mass 1 - z / 2^64.