GPV Trapdoors and NTRU Preimage Sampling: Why Falcon Signatures Are 3.6× Smaller
Build a 2D NTRU trapdoor basis by hand, demonstrate how naive Babai rounding leaks the secret basis, and see how spherical Gaussian sampling fixes it.
Prerequisite: Falcon / FN-DSA
Compare the two NIST lattice signature families at Level 1: ML-DSA-44 needs a 1,312-byte public key and a 2,420-byte signature (3,732 B combined), whereas Falcon-512 (FN-DSA) needs an 897-byte public key and a 666-byte signature (1,563 B combined — 2.4× smaller combined, 3.6× smaller signature). Why can Falcon omit the huge masking vectors that bloat ML-DSA? Because Falcon possesses a genuine geometric lattice trapdoor.
Step 1: Build two bases of the same NTRU lattice by hand
Strip polynomial rings down to integers () modulo so every vector lives in the plane . Pick short coprime secret integers and , and publish their modular ratio:
Check . Anyone holding can write down the public row basis of the NTRU lattice :
Notice how bad is for decoding: its rows have Euclidean norms and , nearly parallel in angle! Meanwhile, the key owner uses the extended Euclidean algorithm on (, scaled by to ) and size-reduces against by subtracting copies of , obtaining :
Both rows of satisfy (check ), and their determinant is , so generates the exact same lattice — but with nearly orthogonal short vectors of lengths and !
Step 2: Hash-and-Sign and why naive Babai leaks the secret key
To sign a message with salt , hash and form the target point . Any lattice point close to defines a short difference vector satisfying:
The verifier doesn't even need to send ! Given only and , the verifier recomputes , recovers , and checks that . Compressing a single short polynomial with Golomb-Rice coding is why Falcon-512 fits in 666 bytes!
The fatal trap (NTRUSign, broken by Nguyen & Regev in 2006): What if the signer finds by deterministic rounding ? Then every signature is uniformly distributed over the fundamental parallelepiped . Its covariance matrix across many signatures is , and its extreme corners literally align with !
Step 3: How GPV spherical Gaussian sampling erases the parallelepiped
Gentry, Peikert, and Vaikuntanathan (2008) proved how to sample without leaking a single bit of : run randomized Klein / Fast-Fourier Nearest Plane where each scalar rounding step samples from a 1D discrete Gaussian whose width is scaled inversely by the Gram–Schmidt norm so the combined 2D/2n-D residual follows a perfectly spherical discrete Gaussian whenever exceeds the smoothing parameter . Because a sphere looks identical from every basis angle, the signature distribution depends only on the public lattice and public width .
Demonstrate the Babai covariance leak vs. GPV symmetry in Python
import math, random
q = 197
B_sec = [[7, 5], [-10, 21]] # det = 197, Gram-Schmidt norms: sqrt(74)=8.60, 197/sqrt(74)=22.90
def babai_round_sign(c: int) -> tuple[int, int]:
# t = (0, c); B_sec^-1 = [[21, -5], [10, 7]] / 197
u0 = round((-10 * c) / q) # wait: t * B_sec^-1 = c * [-10/197, 7/197]? Let's check exact inverse!
# B_sec = [[7, 5], [-10, 21]] -> inv = [[21, -5], [10, 7]] / 197 -> [0, c] * inv = [10*c/197, 7*c/197]
k0, k1 = round((10 * c) / q), round((7 * c) / q)
v = (k0 * 7 + k1 * (-10), k0 * 5 + k1 * 21)
return (-v[0], c - v[1])
def gpv_klein_sign(c: int, sigma: float, rng: random.Random) -> tuple[int, int]:
# Gram-Schmidt of B_sec: b1* = (7, 5), mu_21 = (-70 + 105)/74 = 35/74, b2* = (-995/74, 1379/74)
def dgauss(center: float, s: float) -> int:
lo, hi = math.floor(center - 6 * s), math.ceil(center + 6 * s)
xs = list(range(lo, hi + 1))
weights = [math.exp(-math.pi * ((x - center) / s) ** 2) for x in xs]
return rng.choices(xs, weights=weights)[0]
# Step 1: project t=(0, c) onto b2*: <t, b2*>/<b2*, b2*> = c * (1379/74) / (197^2 / 74) = 7*c / 197
norm_b2 = q / math.sqrt(74)
k1 = dgauss((7 * c) / q, sigma / norm_b2)
# Step 2: subtract k1 * b2 from t -> t' = (10*k1, c - 21*k1), project onto b1 = (7, 5)
t_rem = (10 * k1, c - 21 * k1)
center0 = (7 * t_rem[0] + 5 * t_rem[1]) / 74.0
k0 = dgauss(center0, sigma / math.sqrt(74))
v = (k0 * 7 - k1 * 10, k0 * 5 + k1 * 21)
return (-v[0], c - v[1])
rng = random.Random(7)
babai_sigs = [babai_round_sign(c) for c in range(q)]
gpv_sigs = [gpv_klein_sign(rng.randrange(q), sigma=45.0, rng=rng) for _ in range(2000)]
def corr(pts):
mx = sum(x for x, _ in pts) / len(pts)
my = sum(y for _, y in pts) / len(pts)
vx = sum((x - mx)**2 for x, _ in pts) / len(pts)
vy = sum((y - my)**2 for _, y in pts) / len(pts)
cov = sum((x - mx)*(y - my) for x, y in pts) / len(pts)
return round(vx / vy, 2), round(cov / math.sqrt(vx * vy), 3)
print("Babai (var_x/var_y, corr):", corr(babai_sigs), "<- anisotropic! Leaks B_sec^T B_sec")
print("GPV (var_x/var_y, corr):", corr(gpv_sigs), "<- isotropic (~1.0, ~0.0)! Zero basis leak")In degree or , running Klein's sequential Gram–Schmidt orthogonalization over integer matrices would cost time and megabytes of key storage. Falcon exploits the tower structure of via Fast Fourier Orthogonalization (ffSampling) in floating-point operations — trading wire compactness for the constant-time FPU engineering discussed in Choosing a Post-Quantum Signature Scheme.