Manuscript Offprint
arXiv:2610.13043Provably Subexponential Algorithms for Bounded-Error LWE with Few Samples
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
We show that a variant of the Wagner/BKW-style algorithm for LWE of Kirchner and Fouque [KF15] solves decision and search LWE with secrets of size over prime moduli , for any fixed , with errors bounded by , in time given original samples. Further, if each coordinate of the secret is also bounded by , the same time bound holds with errors bounded by and only samples.
Earlier, it was known that Kirchner and Fouque's algorithm could solve LWE with these parameters in subexponential time with a much larger number of samples [HKM18]. Ducas et al. [DEL25] showed that an adaptation of this algorithm could solve the corresponding dual, the SIS problem, with a suitable norm bound and variables in subexponential time. Whereas their analysis involves interpreting the algorithm in terms of chains of lattices, our approach is quite elementary and is based on bounding the lower moments of a Fourier statistic.
This work was supported by the National Research Foundation, Singapore, under its NRF Fellowship programme, award no. NRF-NRFF14-2022-0010.
Contents
1 Introduction 3
1.1 Our results 3
1.2 Prior work 5
2 The full algorithm and its guarantees 7
2.1 Constructing the lists 7
2.2 The decision algorithm 8
2.3 Correctness 9
2.4 Time and space complexity 11
2.5 Search and arbitrary secrets 12
3 Correctness under sample reuse 13
3.1 Describing entries by leaf selections 14
3.2 The moment bounds 15
3.3 The survival advantage of a linear dependency among leaf vectors 16
3.4 Shared subtrees and their weights 17
3.5 Comparing the actual and ideal means, covariance, and the uniform case 19
3.6 Applying the moments to decision 22
4 Proof of the time and space bounds 22
4.1 Enumerating compatible pairs efficiently 22
4.2 Exact sampling and the total cap 24
4.3 Numerical evaluation of the Fourier statistic 25
4.4 Resources of the reductions 27
5 Parameter choices 28
5.1 Computing the parameters 28
5.2 The mean in the ideal model 29
5.3 Verifying the guarantees 30
6 AI Acknowledgments 33
A Standard reductions with a fixed number of original samples 37
A.1 Bounded-secret search on the same samples 37
A.2 Normal form from the reserved samples 38
B Concurrent work 39
1.1 Our results
Building on the Wagner/BKW approach to LWE [KF15] and its provable SIS variant [DEL25], we prove that a variant of the k-tree algorithm gives decision and search algorithms using a sublinear number of original samples for secrets bounded by and errors bounded by , and only a sublinear excess over the secret dimension for arbitrary secrets and errors bounded by . With these sample counts, our algorithms succeed with high probability for every fixed secret-error pair satisfying the stated bounds (and not just random secrets and errors).
Model and theorem. In LWE, the input consists of noisy linear equations , with unknown secret and error . We collect their public vectors as the columns of and their right-hand sides in , so , where . The search problem is to recover ; the decision problem is to distinguish such from the case where is uniform independently of . We take to be uniformly random and fix the secret-error pair independently of (note that the error coordinates need not be independent). We denote by the bounds on the absolute values of each coordinate of the secret and error, respectively.
Theorem 1.1 (LWE with few samples). Fix and , and let run through primes. Consider the LWE problem with equations, secret of length , and modulus , with and being bounds on the absolute values of the secret and error coordinates, respectively. There is a decision (resp. search) algorithm for LWE in each of the following regimes that succeeds with advantage (resp. probability) for all large enough :
•
• and
The expected running time of these algorithms is , and the same bound holds with probability at least . They work for uniformly random A and any (even worst-case) s and e fixed independently of A, as long as they satisfy the above bounds.
We prove Theorem 1.1 at the end of Section 2.5. The core is a decision algorithm for bounded secrets and errors. We obtain the search algorithm by adapting Regev's coordinate-guess reduction [Reg05], and reduce arbitrary-secret instances to bounded-secret ones using the normal-form transformation of Applebaum–Cash–Peikert–Sahai [ACPS09]. The second regime has the tighter error bound because normal form makes the original errors the new secret, which must satisfy the first regime's secret bound. The algorithm is essentially a careful application of Wagner's k-tree algorithm [Wag02]. The formal decision algorithm is Algorithm 2, with its correctness stated in Proposition 2.3; Section 2.5 gives the extensions to search and arbitrary secrets, and Proposition 2.7 bounds the resources of the full algorithms.
The k-tree algorithm. Wagner’s k-tree algorithm addresses the generalized birthday problem: choose one entry from each of k lists of vectors so that their sum is zero [Wag02]. Its idea is to build candidate sums in stages. For four lists of binary vectors, with addition modulo two, first combine lists 1 and 2 and lists 3 and 4, keeping only sums that vanish on a chosen block of coordinates. Then combine the resulting two lists to find sums that vanish on the remaining coordinates as well. When k is a power of two, these pairwise merges form a binary tree, with the input lists at its leaves and the final list at its root. Filtering limits intermediate list growth, while sums remain zero on coordinates processed at earlier levels.
For bounded-secret LWE decision, we use the first original equations and write for their restrictions. The goal is to find coefficient vectors that control error amplification and the secret’s contribution through , yielding a detectable LWE signal. We draw initial lists at level zero, each with independently sampled coefficient vectors. Each vector specifies one weight for each equation. When combining two lists, adding entry vectors adds the corresponding weighted equations. At level , the submatrix formed from rows of filters these sums, keeping only those for which every coordinate of lies in the centered interval mod (for a choice of ’s described later). We then independently subsample the passing sums, keeping each with probability . Different levels use disjoint sets of rows, and the parameters are chosen to keep intermediate list sizes around the target size .
Figure 1 illustrates the case k = 4. First merge lists 1 and 2, and lists 3 and 4; then merge the two resulting lists. At each merge, every compatible pair with one entry from the left list and one from the right list is enumerated. Every entry remains available for every compatible pair, so one entry can contribute to many combinations. Each final entry is the sum of exactly one coefficient vector from each of the k initial lists.
: merge and
all pairs, one entry from each list
filter with , then
randomly subsample
: merge and
all pairs, one entry from each list
filter with , then
randomly subsample
: merge and
all pairs, one entry from each list
filter with , then
randomly subsample
: initial list
N vectors
: initial list
N vectors
: initial list
N vectors
: initial list
N vectors
Figure 1: The construction with four initial lists. Each merge adds one entry from each incoming list, filters the sum, and independently decides whether to keep it. Using an entry leaves it available for other pairs; equal vector values produced by different pairs remain separate entries.
The decision algorithm. A coefficient vector combines the equations as:
The two terms are the combined error and the secret’s contribution through the combined public vector. The initial coefficient interval controls error amplification, while the filters control the secret contribution. We map each combined right-hand side to a point on the complex unit circle and sum these points over the final list :
Every list entry contributes separately, including duplicate vector values. The lists are generated using A and fresh randomness, without using b. The construction ensures that all final coefficient vectors are nonzero, so when b is uniform, every entry contributes a point with mean zero.
For intuition, suppose the final list leads to the above being a sum of independent terms with a common mean of magnitude . Their sum would have mean magnitude and fluctuations of order . Under uniform data, its mean would be zero and its typical magnitude of order . A threshold near would separate these scales. The actual output terms are dependent; our analysis proves that this separation survives their dependence. Algorithm 1 summarizes the algorithm.
Algorithm 1: Bounded-secret LWE decision: informal outline
Input: original equations, written as and ; parameters, including list sizes, intervals, submatrices, and probabilities, chosen as in Table 2.
1 Draw initial lists of coefficient vectors , where are sampled independently and uniformly from ;
2 for do
3 foreach merge of two lists at level do
4 Enumerate all pairs with from the left list, from the right list, and ;
5 Independently keep each sum in the parent list with probability ;
6 Leave both available for other pairs, and keep equal sums from different pairs as separate entries;
7 Compute from the final list by (1.2);
8 Output LWE if , and UNIFORM otherwise, with near ;
Controlling dependence. Independently sampled coefficient vectors still combine the same original equations, so the resulting terms need not be independent. We bound the Fourier statistic's mean and fluctuations under the actual dependent output distribution. We bound its second moment by tracking which merge decisions two outputs share when they reuse the same intermediate entry. We also show that accidental linear dependencies are rare enough to offset the greater chance of passing the filters. Sampling the remaining coordinates independently from a wide uniform interval makes these dependencies rare. The moment bounds in Theorem 2.1 make the preceding separation rigorous without assuming independent outputs.
1.2 Prior work
LWE Hardness and the role of parameters. Ajtai introduced the short integer solution problem (SIS), which asks for a short nonzero integer vector in the kernel of a matrix modulo , and gave a worst-case to average-case reduction; Micciancio–Regev developed this connection using Gaussian measures [Ajt96, MR07]. Regev introduced LWE and its quantum hardness reduction, and Brakerski–Langlois–Peikert–Regev–Stehlé established classical hardness for polynomial moduli [Reg05, BLP13]. For binary errors, Micciancio–Peikert prove hardness with suitably restricted samples and a change in lattice dimension [MP13], whereas Arora–Ge’s linearization method gives polynomial-time recovery from samples, for a sufficiently large constant , with independent uniform binary errors and polynomial prime moduli [AG11]. Thus both the error bound and the number of equations matter.
BKW and algorithms with restricted number of equations. BKW solves learning parity with noise (LPN), the binary-field analogue of LWE, with independent noise of any fixed rate below 1/2 in time and samples [BKW03]. It combines equations to eliminate blocks of coordinates at the cost of increasing the noise. Lyubashevsky reduces the original samples to , for any fixed , at time by generating combinations of the available equations [Lyu05]. These results illustrate a time-sample tradeoff over the binary field.
For LWE, lazy modulus switching combines equations whose public vectors agree after rounding to a smaller modulus, trading small residual coordinates for fewer buckets [AFFP14]. Kirchner–Fouque generalize this quantization and vary its precision between stages [KF15]; coded-BKW with sieving controls the accumulated error [GJMS17]. Further work improves practical implementations [BGJ 20] and time-memory tradeoffs [WBLW25]. Guo, Mårtensson, and Stankovski Wagner experimentally study dependence from BKW-style combinations and sample amplification [GMSW21]. These experiments do not give an asymptotic guarantee for every fixed bounded secret-error pair, as we seek here.
Kirchner–Fouque claim subexponential time with a linear number of original samples and small secrets and errors [KF15]. For polylogarithmic secret and error bounds, polynomial moduli, and , their claimed decision bound is [KF15, full version, Cor. 6]. As explained by Ducas–Engelberts–Loyer, Herold–Kirshanova–May identify a flaw in the linear-sample narrow-error proof and resolve it for a sufficiently large constant multiple of samples [HKM18, DEL25]. The gap concerns joint closeness to independent samples after amplification under a shared random matrix. For bounded secrets, we match the claimed running time with sublinear original samples. Our theorem proves correctness of our construction, not of the Kirchner–Fouque algorithm.
Wagner’s algorithm for SIS and the obstacle for LWE. Ducas–Engelberts–Loyer’s Gaussian analysis of Wagner’s algorithm [DEL25] builds on discrete-Gaussian techniques developed for shortest and closest vector problems [ADRSD15, ADSD15, ASD18, ALSD21, ACKS21]. They view BKW as Wagner’s generalized birthday method [Wag02] on a dual lattice followed by the Aharonov–Regev distinguisher [AR05]. Their sampler lifts Gaussian vectors through a chain of projected lattices, with auxiliary superlattices keeping the lifts short. Gaussian randomized rounding lets them prove conditional similarity to independent samples, a notion from Aggarwal–Li–Stephens–Davidowitz [ALSD21]. This gives a provable subexponential algorithm for SIS with variables, polynomially growing prime moduli, and norm bounds for suitable polylogarithmic factors [DEL25].
Transferring this SIS guarantee to LWE requires controlling a statistic that aggregates many vectors. Ducas–Engelberts–Loyer explain that bounding the joint statistical distance of all the required samples demands an accuracy for which their sampler takes exponential time in n [DEL25, Section 4.3].
k-trees and dependence among combinations. Levieil–Fouque’s LPN variant forms all pairwise sums within each bucket, but treats its analysis as heuristic because the resulting equations are dependent [LF06, Section 4]. For k-sum, Minder–Sinclair analyze extended k-trees with independent input lists, controlling dependence between candidate solutions; Lin–Vasudevan give success and complexity bounds over integers and modular groups [MS12, LV25]. Joux–Kippen–Loss modify merging to enforce independence and uniformity of intermediate entries [JKL24]. Filtering coefficient vectors through a shared random matrix creates additional dependence beyond these analyses.
Kirchner–Fouque and Ducas–Engelberts–Loyer start from one list and discard both inputs after combining a pair [KF15, DEL25]. Our use of k separate lists is a design choice. The coefficient vectors are sampled uniformly in their free coordinates from a wide interval. Every
Independent concurrent works of Han–Gao–Hu [HGH26] and Chen–Jiang–Wang–Zhang [CJWZ26] also extend the Gaussian–Wagner framework to LWE. We discuss their relation to our results and our different proof framework in Appendix B.
entry remains available for every compatible pair, and we independently subsample passing sums. Building on the second-moment approach to k-trees [MS12, LV25], we directly control the Fourier statistic's mean and fluctuations, including shared entries and linear dependencies under the common matrix. This gives the LWE guarantees in Theorem 1.1 without requiring joint closeness to independent samples.
2 The full algorithm and its guarantees
The core of our result is a decision algorithm for bounded secrets and errors. We first specify how this algorithm works. We then state the correctness and resource guarantees, followed by the two standard reductions that give search and handle arbitrary secrets. Sections 3 and 4 prove the correctness and resource statements conditioned on selecting good parameters; Section 5 chooses parameters that meet these conditions.
The LWE problems. Let be prime. An instance consists of and . In the LWE case, is uniform and , where the secret and error vector are fixed independently of . For bounded-secret LWE, we have the promise that and , where ; in the arbitrary-secret case only the error bound is imposed. The search problem asks for . The decision problem asks us to distinguish an LWE instance from the uniform case, in which is uniform independently of .
In standard definitions of LWE, s and e are sampled from distributions respecting bounds similar to the ones above. Our algorithms work even for worst-case s and e as in the definition above, which is stronger than them working for fixed distributions.
2.1 Constructing the lists
The decision algorithm uses only the first original equations. Write and for their matrix and right-hand-side vector. A coefficient vector specifies a linear combination of these equations. Our goal is to generate many coefficient vectors for which the combined error and the secret contribution are controlled, so that their Fourier terms have a detectable mean when is an LWE instance.
The parameter choices in Table 2 depend only on . They specify a binary tree of depth with initial lists, each of size , a leaf radius , and filter radii . They also specify a partition of the rows of into consecutive submatrices with positive row counts satisfying ; write for the corresponding coordinates of the secret. We number levels upward from the initial lists at level zero. Write for the number of nodes at level , each storing one list; for , this is also the number of merges. We assume the parameter checks in Section 5.1 hold for the list count , radii , and row counts ; otherwise the algorithm returns UNIFORM.
Sample every entry of the initial lists independently as
independent and uniform on .
(2.1)
All initial lists are sampled once. Fixing the first coordinate to one ensures that every vector at level has first coordinate . Since , every vector generated by the tree is nonzero.
At level i, merge two child lists by adding their entry vectors. A pair , with one entry from each child list, is compatible when
For each compatible pair, independently keep its sum in the parent list with probability . Write and for the interval widths, and set
The parameter checks and construction ensure , , and . Before the fresh submatrix is revealed, a fixed nonzero pair sum has a uniform image, so it passes the filter and is kept with probability . Two lists of size would therefore produce parent entries in expectation. The same submatrix is used at every merge of a level; different levels use disjoint rows.
Using an entry leaves it available for other compatible pairs. Equal vector values remain separate entries, both in the initial lists and when different pairs produce the same sum. Each root entry is thus the sum of one selected entry from each of the k initial lists. Figure 1 illustrates the case k = 4.
Finding compatible pairs with buckets. Represent each coordinate of by a residue in and divide this range into consecutive intervals of width , allowing a shorter final interval. We call each one-coordinate interval a cell. A bucket contains all right-list entries whose images fall in the same cell in every coordinate, so a bucket is indexed by a tuple of cell indices. Formally, the cells are
For a merge at level , write the right list with size as . For a tuple with , define the bucket
It stores the entries at these indices; equal vector values at different indices remain separate entries.
For each left entry , a compatible right image must lie coordinatewise in . In each coordinate, find the cells meeting this cyclic interval, and query the buckets for all tuples of these cell indices. Check every returned pair against (2.2) before sampling whether to keep it. Every compatible pair is found exactly once. The queries may also return pairs that fail the exact filter; they are discarded by the (2.2) check before subsampling. Sorting by these index tuples allows binary search for each bucket; Section 4.1 gives the implementation details and time bound.
2.2 The decision algorithm
Let . For the analysis, let denote the root list obtained by running all merges without a storage limit, and define
Each entry contributes separately, including duplicate vector values. Generating the coefficient vectors uses only A and fresh randomness; b is used only when the sum is evaluated. In the uniform case, each nonzero vector's Fourier term has mean zero. Under LWE, , so the leaf radius B controls the error contribution, and the filters control the secret contribution through the node images. We decide by the magnitude of the sum, using the threshold
The ideal test returns LWE when and UNIFORM otherwise. Here is the complex modulus; the finite-precision implementation below applies the same rule to by comparing with exactly.
For the resource guarantees, we stop and return UNIFORM if storing another entry would exceed K. We compute a rational estimate with whenever list construction finishes without exceeding this limit, and compare its squared modulus with exactly. These choices ensure bounded storage and reliable evaluation of the decision statistic; Section 4 gives the implementation and its cost. Set
Keep all stored entries until the algorithm ends, counting initial entries and entries retained by subsampling toward K; reaching exactly K is permitted. All random sampling is exact, using fresh random bits for each request as described in Section 4.2. On storage overflow, set .
Algorithm 2: Bounded-secret LWE decision
Input: , , and public bounds .
1 Use the first equations and compute the parameters in Table 2; return UNIFORM if a parameter check fails;
2 Set the threshold , storage limit , and precision by (2.7) and (2.8);
3 Draw initial lists of independent coefficient vectors from (2.1) using exact sampling (Section 4.2); set the stored-entry count ;
4 for do
5 foreach merge of two lists at level , from left to right do
6 foreach compatible pair found by bucket queries (Section 4.1) do
7 Independently keep with exact probability ;
8 if the sum is kept then
9 if then return UNIFORM;
10 Append the sum to the parent list and increment ;
11 Leave child entries available for other pairs; keep equal sums from different pairs as separate entries;
12 Compute the rational estimate with error at most , using the evaluation procedure of Section 4.3;
13 Return LWE if , and UNIFORM otherwise, comparing exactly;
2.3 Correctness
Correctness rests on the mean and fluctuations of Z under the actual reuse of entries. To describe the expected LWE signal, first consider one selection of a leaf entry from each initial list. At each internal node v at level i, call its node image, where is the sum of the selected leaf vectors below v. For the root vector z, the combined right-hand side is . Its block is the sum of the level-i node images because those nodes partition the selected leaves.
To make the expected signal easier to calculate, we consider an ideal model for one combination in which the node images are independent of one another and of the leaf vectors. In this model, sample independent leaf vectors from (2.1) and, at each internal node at level , sample an independent uniform image in the filter box . Let be the sum of these leaf vectors, and let concatenate the sums of the ideal node images at levels . Thus combines the error coordinates, while the th block of takes the place of and pairs with the corresponding secret coordinates. For a fixed integer secret-error pair , the ideal mean below is the mean Fourier contribution in this independent model.
The algorithm does not compute , which depends on the unknown secret and errors. We use it in the analysis: the following theorem shows that the actual mean of the sum is close to and bounds its fluctuations despite the dependence among outputs.
Theorem 2.1 (Moments of the Fourier statistic). Let be uniform and independent of the initial lists and subsampling randomness. Suppose the algorithm parameters additionally satisfy
(2.10)
For every fixed integer secret-error pair, with ,
where . If is uniform independently of the matrix and tree randomness, then
For every tree node , its list in the construction without a storage limit satisfies .
Section 3.5 proves Theorem 2.1 by accounting for shared intermediate entries and accidental linear dependencies among leaf vectors. With and , the LWE mean has magnitude , while the fluctuations in both cases have scale at most . The threshold near separates these scales. Taking a magnitude also removes the unknown rotation contributed by the fixed first coordinates.
Lemma 2.2 (Decision from an accurate estimate). Suppose the moment bounds of Theorem 2.1 hold and . Suppose the computed estimate satisfies both under LWE with the fixed pair and under uniform input, so bounds the probability that the estimate differs from Z by more than T/4. The test returns LWE when and UNIFORM otherwise. The subscripts below indicate the input model; probabilities include the uniform matrix, the algorithm's random choices, and, in the uniform case, the independent uniform vector b. Its probability of returning UNIFORM on an LWE input with the fixed pair , and of returning LWE on a uniform input, respectively satisfy
We prove Lemma 2.2 in Section 3.6.
Theorem 2.4 bounds the probability of stopping because the stored-entry count would exceed K; Corollary 2.5 therefore supplies the estimate condition with . Lemma 2.6 shows that parameters can be set to satisfy and , which imply the threshold separation in Lemma 2.2 for sufficiently large n. Together these results give the following decision guarantee.
Proposition 2.3 (Bounded-secret decision). Fix and . Let be prime, let be polynomial in , and let public rational bounds and have polynomial encoding length. For every fixed integer pair with and , independent of uniform , Algorithm 2 has error at most for sufficiently large . The same bound holds for uniformly random instances and for each fixed asymptotic growth of the public bounds throughout the stated parameter ranges.
We prove Proposition 2.3 in Section 3.6.
2.4 Time and space complexity
We measure time in bit operations and space in bits, including temporary storage. Thus the cost of arithmetic depends on the bit lengths of its operands.
The bucket merge, storage cap, and numerical evaluation turn the statistical test into an algorithm with bounded resources. The next theorem states their guarantees under explicit conditions on the parameters; its proof is in Section 4.
Theorem 2.4 (Total resources and numerical accuracy). Suppose the algorithm parameters are computable in polynomial time, have polynomial encoding length, and satisfy (2.10). Assume q, m, and the encoding lengths of the public bounds are polynomial in n and, at every level,
Then Algorithm 2 terminates with probability 1 and uses worst-case space for every input, including temporary storage and all random sampling trials. For uniform A independent of the tree randomness, its expected running time is and the probability of exceeding the storage limit is at most . When list construction finishes without exceeding the storage limit, evaluation and the final comparison use at most time for every right-hand-side vector b.
When list construction finishes without exceeding the storage limit, , and the squared-modulus comparison is exact, with equality returning LWE. These guarantees hold throughout any parameter range satisfying the hypotheses uniformly.
Corollary 2.5 (Accuracy of the decision statistic). Under the hypotheses of Theorem 2.4, for uniform A independent of the tree randomness, the computed statistic satisfies
both on LWE inputs with every fixed secret-error pair and on uniform inputs.
Proof. Outside storage overflow, the numerical error is at most . The probability of overflow is at most by Theorem 2.4, and is the same in both input models because list construction does not use .
Lemma 2.6 (Parameter choice). Fix and , and let run through primes. For each fixed asymptotic growth of the public bounds and all sufficiently large n, the parameters chosen in Table 2 are computable in polynomial bit time for every integer dimension d and public rational bounds of polynomial encoding length satisfying
All parameter checks pass, and hold, and
The estimate holds for every fixed secret-error pair with and . For each fixed asymptotic growth of the bounds, the estimates are uniform in and the secret-error pair, including and zero bounds.
Section 5.3 proves Lemma 2.6. Thus one invocation of the bounded-secret decision algorithm has expected running time and worst-case space . The reductions below make polynomially many such invocations and execute them sequentially, so their time costs add in expectation and their workspace can be reused.
Proposition 2.7 (Resources across all calls). Under the hypotheses of Theorem 1.1, the decision and search algorithms of Section 2.5 have expected running time and worst-case space at most . With probability at least , their running time is also at most . They terminate with probability 1. These bounds include selecting and transforming the input equations, computing the parameters, all invocations of the bounded-secret decision algorithm, and all random sampling, including rejected draws. The high-probability time bound is a bound on runs taken to completion, so it introduces no additional correctness failure.
We prove Proposition 2.7 in Section 4.4.
2.5 Search and arbitrary secrets
Two standard transformations extend the bounded-secret decision algorithm to all the cases in the main theorem. Both use only the original input samples; search reuses these samples across all decision calls. Appendix A verifies the adaptations for fixed secret-error pairs and the explicit failure bounds.
Recovering a bounded secret. Regev's coordinate-guess transformation [Reg05, full version, Lemma 4.2] tests a possible value of secret coordinate by adding a fresh uniform to row of and adding to . A correct guess preserves the LWE instance's secret and errors; an incorrect guess makes the right-hand-side vector uniform given the perturbed matrix. Test each guess on a fresh perturbation of the same first samples, using fresh decision randomness. Return the unique accepted value at each coordinate, reporting failure if it is missing or not unique.
Proposition 2.8 (Bounded-secret search). Under the hypotheses of Proposition 2.3, let be the set of candidate values for each secret coordinate. Search tests every for every coordinate using the perturbation described above, the same first original samples, and fresh randomness for each test. It returns the unique accepted value at each coordinate, reporting failure if there is none or more than one. The number of scheduled decision calls is
For every fixed secret-error pair satisfying the bounds, failure or incorrect recovery has probability at most for sufficiently large n.
We prove Proposition 2.8 in Appendix A.1.
Replacing an arbitrary secret by errors. The normal-form transformation of Applebaum–Cash–Peikert–Sahai [ACPS09, Section 3.1, Lemma 2] uses an invertible block of original equations to make their errors the new secret, up to sign. We reserve the final n samples and test their matrix for invertibility once. On singularity, decision returns UNIFORM and search reports failure. Otherwise, apply normal form and use the bounded-secret algorithms with .
Proposition 2.9 (Normal form using reserved samples). Let q be prime and m > n. There is a reduction, computable in time polynomial in the input length, from LWE with n secret coordinates, m equations, an arbitrary secret, and errors bounded by E to LWE with n secret coordinates, m - n equations, and both secret and errors bounded by E. It uses only the original samples and fails only when the matrix of the final n equations is singular, which happens with probability at most . For every fixed original secret-error pair independent of the uniform input matrix, conditional on any fixed invertible reserved matrix, the output matrix is uniform and the transformed secret-error pair is fixed. Uniform input remains uniform. A recovered transformed secret determines the original secret using the reserved equations.
Appendix A.2 proves Proposition 2.9 and gives the transformation and recovery formulas. The bounded-secret algorithms use only the first transformed equations. Transforming just those equations is equivalent to transforming all and then discarding the unused ones.
Corollary 2.10 (Arbitrary-secret decision and search). Fix and . Let be prime, let be polynomial in , and let the public rational bound have polynomial encoding length. For sufficiently large , for every fixed secret and fixed integer error vector with , independent of uniform , normal form followed by bounded-secret decision or search with has respective error bounds
The same decision error bound holds for uniform input. Both algorithms use only the original samples; search keeps the reserved equations unchanged throughout its decision tests and recovery.
We prove Corollary 2.10 at the end of Appendix A.2.
Proof of Theorem 1.1. For bounded secrets and errors, apply Propositions 2.3 and 2.8; for arbitrary secrets, apply Corollary 2.10. All displayed error bounds tend to zero. Proposition 2.7 gives the total time, space, and termination guarantees. These bounds hold for every matrix-independent fixed secret-error pair, so averaging also allows any joint distribution satisfying the bounds and independent of the matrix.
3 Correctness under sample reuse
Algorithm 2 constructs coefficient-vector lists using and fresh randomness. For the analysis, let be its root list without a storage limit and write . Under LWE, we expect this sum to have mean close to , where is the mean of one Fourier contribution in the ideal model with independent leaf vectors and independent uniform node images in their filter boxes. Correctness requires the fluctuations, and the statistic's size under uniform input, to be small enough for the decision threshold to separate the two cases.
Moment bounds (Theorem 2.1). For uniform A independent of the tree randomness, under the theorem's parameter hypotheses, including (2.10), the construction without a storage limit satisfies
The LWE bounds hold for every secret-error pair fixed independently of the uniform matrix; the uniform bound holds when b is uniform independently of the matrix and tree randomness.
The terms of can be dependent for two reasons. Two leaf selections may use the same leaf entries and hence share intermediate entries and entry randomness. Even leaf selections with no shared leaf entries use the same matrix, and a linear dependency among their leaf vectors can make several filters easier to pass. We account for shared entries by counting shared subtrees, and for the common matrix by bounding both the rarity of linear dependencies among leaf vectors and the advantage they give to survival.
3.1 Describing entries by leaf selections
For the analysis, describe a possible root entry by choosing one leaf entry from each leaf list. Denote the ath vector in list by , and write for the leaf selection, a tuple of entry indices, where . These choices determine every intermediate sum, whether or not the entry is produced.
Denote the root node by root. For a node , let be its level and the interval of leaf positions below it; in particular, . Put
The possible entry at v corresponding to a is identified by . Restricting a to the two child subtrees determines its unique producing pair. Induction up the tree gives a one-to-one correspondence between possible entries at v and restricted leaf selections, even when different selections have equal vector sums. Every leaf vector has first coordinate one, so the first-coordinate invariant is
The nonzero value follows from .
Represent the entry randomness for every possible internal entry by a Bernoulli subsampling variable , equal to one with probability . These variables are mutually independent and independent of the leaf vectors and A. An entry's variable is only used by the construction when its two children exist and their pair passes the filter. This lets us describe survival over a fixed family of leaf selections:
Thus precisely when all merges required by the leaf selection succeed. For any node , let denote the product in (3.3) restricted to the internal nodes in the subtree rooted at , including when it is internal. Then precisely when the restricted leaf selection produces an entry at ; for a leaf, the empty product is one. The Fourier statistic can now be written as
To control the fluctuations of , we expand its second moment as a sum over ordered pairs of leaf selections:
Each Fourier term has magnitude one, so the absolute value of a pair's expected contribution is at most , the probability that both selections survive. We therefore need to understand which merge decisions a pair shares.
Two leaf selections agreeing on every leaf entry below an internal node reuse the same intermediate entry, including its filter test and entry randomness. For example, in the four-leaf tree of Figure 1, two leaf selections agreeing exactly in lists 1 and 2 share the first left merge. If they instead agree exactly in lists 1 and 3, they share two leaf entries but no internal entry. The arrangement of shared leaf entries determines which merge decisions are reused.
For the moment, suppose the distinct leaf vectors used by a pair are linearly independent. Its distinct merge decisions then succeed independently with probability each, by (2.3). With no shared internal entry, the joint survival probability is . Since there are ordered pairs of leaf selections in total, we use as the reference scale for the sum of pair-survival probabilities.
Of these pairs, exactly agree at two specified leaf positions; requiring no agreement elsewhere can only reduce this count. Thus each of the two sharing patterns above has a counting factor at most .
Sharing the entries in lists 1 and 2 also reuses one complete merge in their shared subtree: its filter and subsampling decision are required once rather than twice. Replacing two factors by one increases the joint survival probability by a factor . Sharing the entries in lists 1 and 3 reuses no merge. Combining the counting and survival factors gives base weights for sharing lists 1 and 2 and for sharing lists 1 and 3. These weights bound the corresponding pair contributions after division by the reference scale , before accounting for linear dependencies among leaf vectors. Lemma 3.6 extends this count to arbitrary shared subtrees and includes the effect of those dependencies.
Table 1: Notation for the tree and its moment analysis.
| Symbols | Meaning |
|---|---|
| n,m,d,q | Secret dimension, number of original samples, number of selected samples, prime modulus. |
| A,b,s,e; Es,Pe | Matrix, right-hand-side vector, secret, errors; public coordinate bounds. |
| k=2r,N=2L | Number of leaf lists and tree depth; leaf list size and its exponent. |
| Ai,ni,Mi;s(i) | Level-i submatrix, row count, node count; corresponding secret block. |
| B,Q; Ri,Wi | Leaf and filter radii, with widths Q=2B+1, Wi=2Ri+1. |
| ρi,pi | Probability that a uniform image passes the filter; probability with which a passing sum is kept, with ρi pi=1/N. |
| Uv,a|I(v) | Bernoulli subsampling variable for a possible internal entry at v. |
| Lv,a,Ca,Cv,a | List at node v; leaf selection (a tuple of entry indices); survival indicators at the root and at v. |
| zv(a),zroot(a) | A leaf selection's sum at node v and at the root. |
| Z(b),Γ,T | Fourier statistic, ideal mean, and decision threshold. |
3.2 The moment bounds
Use the leaf selections and survival indicators just defined. Enumerate the internal nodes as by increasing level and then from left to right. For a leaf selection , define the ordered tuple of its node images by
We prove the mean and variance bounds more generally for any fixed complex-valued contribution function satisfying for all inputs. For fixed integer secret and errors , independent of , the LWE contribution is obtained with
This function has absolute value one. Under LWE, substituting gives . The level- nodes partition the selected leaves, so their actual images sum to . Hence . A surviving leaf selection contributes , and a failed leaf selection contributes zero. Put
Here is sampled from the ideal model for one leaf selection defined in Section 2.3. Recall that its leaf vectors are sampled independently from (2.1), and its node images are independent uniform points in their respective filter boxes, independent of the leaf vectors. Thus, for this LWE contribution function, from (2.9).
The function is the same for every leaf selection and depends only on its selected leaf vectors and node images; any additional parameters are fixed independently of the matrix, leaf vectors, and entry randomness. Thus every leaf selection has the same ideal mean . We prove the mean and variance conclusions of Theorem 2.1 with in place of .
The proof has three steps. First we bound linear dependencies among leaf vectors, weighted by their advantage in passing the filters. Then we count pairs of leaf selections sharing subtrees. Finally we combine these bounds to control the mean, covariance, and uniform-case second moment. All sums count entries separately, including equal vector values.
3.3 The survival advantage of a linear dependency among leaf vectors
The wide intervals of the leaf distribution make linear dependencies rare, but a dependency can increase the chance of passing several filters. Proposition 3.1 bounds the probability that a sampled leaf vector lies in the affine subspace determined by earlier vectors and its fixed first coordinate. Proposition 3.2 bounds filter probabilities in terms of rank, while Proposition 3.3 identifies the conditional image distribution when the vectors are independent.
Proposition 3.1 (Affine-subspace concentration). Let have independent coordinates, each taking any single value with probability at most . For every fixed affine subspace of dimension at most , the probability that lies in it is at most .
Proof. For a nonempty affine subspace of dimension , choose coordinates that determine its points uniquely. Conditional on these coordinates, membership forces each of the other coordinates to a single value, which it takes with probability at most . Independence gives probability at most ; the empty case is immediate.
Proposition 3.2 (Filtering and rank). Fix a level and vectors of rank . For a uniform submatrix ,
Proposition 3.3 (Independent images conditional on filtering). For fixed linearly independent vectors and a uniform submatrix , the images are independent and uniform on . Conditional on every image lying in , they are independent and uniform in this box.
Proof of Propositions 3.2 and 3.3. Select linearly independent vectors from the family. The linear map taking a uniform row to its inner products with those vectors is onto , so those inner products are independent uniform residues. The probability that all selected inner products lie in mod is ; requiring the remaining inner products to lie there can only decrease it. Multiplying over the independent rows gives . If the whole family is linearly independent, the product uniform distribution gives independent uniform images, and conditioning it on the product filter box gives the stated conditional distribution.
A linear dependency among the leaf vectors can lower the rank of the node sums at several levels. More generally, let the leaf vectors have rank deficiency , meaning their rank is less than their number. As shown in the pair-survival proof below, the node sums at each level lose at most in rank. Each unit of rank deficiency in the node sums can increase the level-i filter probability by at most , by (2.3) and the parameter condition stated there. Over levels, the total survival advantage is therefore at most . The next lemma weights each possible rank deficiency by this survival advantage.
Lemma 3.4 (Linear dependencies among leaf vectors and their survival advantage). Under (2.10), take any fixed collection of distinct leaf entries. Let X be the matrix of their coefficient vectors, and let be their rank deficiency, the number of independent linear relations among these vectors. Thus exactly when the selected leaf vectors are linearly independent. Then
Also .
Proof. Reveal the selected leaf vectors in a fixed order. Let indicate that column belongs to the span of its predecessors. The first column has first coordinate one, so . For , condition on the predecessor columns and let be their span. A new column can lie in only at a point whose first coordinate is one. Since contains the first column, which has first coordinate one, fixing this coordinate removes exactly one degree of freedom from . The allowed points therefore form an affine subspace of dimension .
Ignoring the fixed first coordinate leaves an affine subspace of of the same dimension. By (2.1), the remaining coordinates of the new column are independent of one another and of the predecessor columns. Each is uniform on the distinct residues from , so each residue has probability at most . Conditional on the predecessor columns, exactly when these coordinates lie in that fixed affine subspace. Applying Proposition 3.1 with , , and gives
Each column lying in the span of its predecessors contributes one to , so . Put . Since , we have , so (3.11) gives . The earlier indicators are determined by the conditioned columns, so iterating conditional expectation from down to gives
The last inequality follows from for and .
To isolate the outcomes with , observe that vanishes when . When , we have , so and hence . Taking expectations and using (3.12) gives
This proves the weighted bound, and proves the probability bound, since .
We apply Lemma 3.4 to the distinct leaf entries of a full leaf selection, a selection restricted to a subtree, or a pair of selections.
3.4 Shared subtrees and their weights
For two leaf selections , define their agreement set by . For every , let count the level-i nodes with , and let count the maximal subtrees whose leaves all lie in , including isolated shared leaves. Put .
Among all ordered pairs of leaf selections, a fraction agree throughout a specified subtree with leaves. This subtree has internal nodes, so reusing its merge decisions increases joint survival by a factor when the distinct leaf vectors are linearly independent. The reference scale from Section 3.1 combines the ordered pair count with the baseline joint survival probability. Dividing by this scale leaves the subtree's factor .
We will count one such factor for each maximal shared subtree, then include the additional survival advantage of rank deficiency.
Maximality means that we count a shared subtree at its highest shared node, without counting its descendants again. The example in Figure 2 has seven shared leaves and .
Put . For a fixed leaf selection with linearly independent leaf vectors, this is its survival probability: the internal nodes independently pass their filters and are kept, each with probability by (2.3). The next bound combines the subtree count with the possible survival advantage from rank deficiencies among leaf vectors.

Figure 2: Two leaf selections agree at positions . Their shared nodes are filled, and the three maximal shared subtrees are shaded. Agreement at seven leaf positions contributes a counting factor , while four reused merge decisions contribute a survival factor , giving base weight . Nested shared subtrees are not counted again.
Proposition 3.5 (Shared-subtree identity). For every ,
Proof. The maximal shared subtrees partition S. A subtree with leaves contains internal nodes, which proves (3.14).
Lemma 3.6 (Shared-subtree pair bound). Under (2.10), for every ,
Proof. Fix a pair with . Compare their node sums in two copies of the tree, one for each selection. Let be the matrix whose columns are the coefficient vectors of the distinct leaf entries, and put . A node sum is obtained by summing a subset of these columns. Represent that subset by its incidence vector : the zero-one vector marking its selected leaf entries. Multiplication by gives the node's coefficient vector . At level , keep the incidence vectors from both copies, except that at each of the fully shared positions, they share the same incidence vector, so only one copy is kept.
Therefore, we have incidence vectors. And here we show that they are linearly independent. Distinct node positions at this level have disjoint leaf intervals. Each position that is not fully shared therefore contains, in each copy, a private leaf entry that occurs in no other kept incidence vector. A leaf entry below a fully shared position occurs only in its one kept incidence vector. Suppose they are linearly dependent, then a linear combination of these incidence vectors is zero. Nevertheless, equaling zero at these private coordinates requires that every coefficient of the linear combination is zero.
The kernel of the linear map is . By the rank-nullity theorem, its dimension is . Restricting this map to the span of the kept incidence vectors cannot increase its kernel dimension. If is the rank of the resulting level-i node sums, multiplying the independent incidence vectors by therefore gives . Equal vector values at different leaf-entry indices contribute to the rank deficiency ; we kept one copy only when the restricted leaf selections, and hence their incidence vectors, were fully shared and identical. For one leaf selection, or a leaf selection restricted to a subtree, the incidence vectors at each level have disjoint nonempty supports, and the same argument applies.
At level , the pair uses exactly distinct subsampling variables, because it uses the same variable once at each fully shared node. Their probability of all equaling one is . By Proposition 3.2, conditional on , the filter probability is at most . By (2.3) and the parameter condition stated there, we have and . The subsampling variables are independent of the matrix, and the submatrices for different levels are independent, so
(3.16)
The middle equality uses and ; the last inequality uses . There are exactly ordered pairs with . The coefficient vectors of their distinct leaf entries have the same independent product distribution, regardless of the chosen indices. Multiplying (3.16) by this count and using leaves the factor , by Proposition 3.5. Averaging over the leaf vectors and applying Lemma 3.4 proves (3.15).
Proposition 3.7 (Total shared-forest weight). If , then
Proof. Put , and let be the set of all nodes of the tree, leaves included. For , let be the set of roots of its maximal shared subtrees, so . Since is the union of the leaves below , distinct sets give distinct sets . Thus each term of is a different term of , and the remaining terms are nonnegative. By the binomial theorem and , . Apply for , using , to finish.
Summing (3.15) over nonempty and multiplying by bounds all shared pairs by ; the empty set contributes 1 to . This includes the case for which is one maximal shared subtree and . The count uses indices: equal values at different leaf-entry indices remain separate and contribute to , rather than to .
3.5 Comparing the actual and ideal means, covariance, and the uniform case
For a fixed leaf selection with linearly independent leaf vectors, the actual node images are independent uniform field vectors, by Proposition 3.3 and independence of the level submatrices. Conditional on survival, they are independent and uniform in their filter boxes, just as in the ideal model with those leaf vectors held fixed. We therefore compare the actual conditional mean with times the ideal mean for the same leaf vectors, before averaging over the leaf vectors. These quantities agree when the leaf vectors are linearly independent. For leaf vectors with a linear dependency, Lemma 3.4 bounds their contribution to the mean discrepancy by accounting for their survival advantage.
For the variance, we separate pairs that share leaf entries from pairs that do not. The shared-subtree bound handles the former. For disjoint selections, their independently sampled leaf vectors allow us to express the covariance using only cases where the 2k selected vectors have a linear dependency.
Proof of Theorem 2.1. The mean and list sizes. Recall that indicates survival, with , and is the survival probability for linearly independent leaf vectors. Let be the rank deficiency of the selected leaf vectors. The argument for (3.16), applied to one selection, gives
If , Proposition 3.3 gives independent uniform node images at each level; different levels use independent submatrices. Conditional on all filters passing, these images are therefore independent uniform filter-box vectors. Requiring the independent subsampling variables to equal one changes no image distribution. Consequently, for these fixed leaf vectors,
Here internal has mutually independent node images, independent of the leaf vectors, with uniform in when . Thus averages over these ideal images while holding its leaf-vector argument fixed. Averaging next over the sampled leaf vectors gives . To compare the means, subtract from before averaging over the leaf vectors. The difference vanishes when and has absolute value at most when . Using (3.18) and Lemma 3.4, we obtain the magnitude bound and the mean comparison
(3.20)
Summing over the leaf selections gives the mean assertion of Theorem 2.1, with in place of . A leaf selection restricted to a subtree rooted at level has leaf vectors and internal nodes. Its conditional survival probability is at most . Summing over its possible leaf selections gives
Leaf lists have size exactly N, so this proves the list-size bound at every node.
Covariance of disjoint leaf selections. Suppose share no leaf entries. Their two groups of selected leaf vectors are statistically independent, although their contributions use the same matrix. Define their conditional means and joint moment by
(3.22)
Regard and as matrices with the selected leaf vectors as columns, and let be the rank deficiency of all 2k vectors from the two selections. For fixed leaf vectors with , the node images from both selections are independent at each level by Proposition 3.3; submatrices at distinct levels and the two selections' families of subsampling variables are also independent. Their contributions are therefore conditionally independent, giving
Each conditional mean is a function only of its own selected leaf vectors. Since disjoint selections use independently sampled leaf entries, and are independent. Averaging over these leaf vectors therefore gives
(3.24)
Write for the covariance. Averaging (3.22) gives . Subtracting (3.24) and using (3.23) then gives
(3.25)
We now bound the two terms on the event . By (3.16) with , . To bound the product of conditional means, apply the single-selection bound to each selection separately. Let and be their individual rank deficiencies. By (3.18), . We compare this weight with the pair's weight using rank subadditivity:
Consequently, as well. Applying Lemma 3.4 to the two terms in (3.25) yields
There are at most disjoint ordered pairs, so their total absolute covariance is at most .
Covariance of selections sharing leaf entries. Here we bound both terms in the covariance separately. For the joint moment, , so Lemma 3.6 and Proposition 3.7 give
For the product of the individual means, exactly a fraction of ordered pairs share at least one leaf entry. Using (3.20) for each individual mean gives
Expanding the variance as the sum of all ordered covariances and bounding each by its absolute value, the disjoint total of together with and now gives
The last inequalities use and .
The uniform case. Fix the matrix, leaf vectors, and entry randomness, so that and are fixed for every leaf selection. Averaging only over the independent uniform vector gives
(3.31)
If , the Fourier term equals one. Otherwise, some coordinate of is nonzero, and the corresponding uniform coordinate of makes the exponent uniform in . Its average is therefore . For pairs sharing leaf entries, discard the equality indicator and use Lemma 3.6 and Proposition 3.7. Their contribution is at most , including the case . For disjoint leaf selections, a collision between root vectors implies
The displayed coefficient vector is nonzero on distinct indexed columns, so a collision forces . The conditional pair bound (3.16) and Lemma 3.4 give at most per disjoint pair, hence at most in total. Thus . Equal values at different leaf-entry indices are included in this linear-dependency bound.
3.6 Applying the moments to decision
The Fourier character for LWE. For a secret-error pair fixed independently of the matrix, the function in (3.7) satisfies and , whose product formula is given in (5.7). Taking this contribution function gives the LWE mean and variance in Theorem 2.1; the uniform-case bound applies directly to (2.6). We now use these moments to prove the decision bounds stated in Section 2.3.
Proof of Lemma 2.2. For LWE, on the event , returning UNIFORM implies . Since , the threshold condition forces . Chebyshev's inequality bounds the probability of this deviation by . A union bound with the accuracy-failure event, whose probability is at most , gives (2.13).
For the uniform case, on the event , returning LWE implies . Markov's inequality applied to bounds this event by . A union bound with the accuracy-failure event gives (2.14).
Proof of Proposition 2.3. Work with the first samples. For sufficiently large , , so Lemma 2.6 verifies the parameter checks and hypotheses of Theorem 2.1. For each fixed secret-error pair, that theorem gives the LWE mean and variance in (2.11) and the uniform-case bound in (2.12).
Separating the scales. The parameter choice gives and throughout the stated parameter range. With the threshold in (2.7),
for all sufficiently large . Corollary 2.5 gives the accuracy bound for the computed statistic , both under LWE with every fixed secret-error pair and under uniform input. Applying Lemma 2.2, the remaining statistical terms are on LWE and at most in the uniform case. Hence both errors satisfy
for sufficiently large , since . The same decision bounds hold throughout the stated parameter ranges because the moment, signal, and accuracy bounds do, for every fixed secret-error pair satisfying the stated bounds.
4 Proof of the time and space bounds
We prove Theorem 2.4 for the algorithm of Section 2: expected bit time and worst-case bit space , storage-overflow probability at most , and numerical error at most T/4 when there is no overflow. The computation has three parts: bucket queries enumerate compatible pairs, exact sampling and the storage cap control the tree, and numerical evaluation approximates the decision statistic. We then prove Proposition 2.7 by adding the time costs of all calls and reusing their workspace. Throughout this section, assume the theorem's parameter conditions hold.
4.1 Enumerating compatible pairs efficiently
At a level-i merge, the two child lists contain coefficient vectors , and has rows. A pair is compatible when every coordinate of has centered magnitude at most , as in (2.2). Write , , and recall that is the cell width. We group right entries into the buckets of (2.5) and query the cells meeting in each coordinate. We prove that at most buckets are queried per left entry, every compatible pair is found exactly once, and the image of every returned pair lies in the enlarged radius- box. The last fact bounds the work spent on pairs that fail the exact filter.
Fill initial lists from left to right in sampling order, then process levels upward and merges from left to right. Number stored entries consecutively as they are inserted, including equal vectors as separate entries. We use this order later to compare capped and uncapped runs with the same randomness.
At each merge, compute and store the image of each right entry. Sort the right entries by their tuples of cell indices (their bucket keys) and then by entry number. Each bucket occupies a consecutive range in the sorted array. For a queried key, two binary searches locate the first array position with a key at least the query and the first position with a larger key; equal positions mean the bucket is empty. Visit left entries in increasing order of entry number, computing each left image once. For each left entry, visit queried keys in lexicographic order and process the right entries in each returned range in sorted order. Generate the query tuples one at a time, and append each sum retained by subsampling to the parent list when its pair is visited.
A nonwrapping interval of consecutive residues meets at most two cells. For a wrapping interval, the part beginning at zero lies in the first cell; the part ending at meets at most the last two cells, because the final cell may be short. Thus there are at most three distinct cells per coordinate and at most product queries. To obtain the cell indices, split the interval at zero if it wraps. For each resulting nonwrapping segment , enumerate all integer indices from through , inclusive. If these quotients agree, the segment meets just one cell, and its index is included once. The two segments of a wrapping interval meet disjoint cells under .
Every right entry compatible with lies in a queried product cell. Conversely, if is returned, in each coordinate choose a residue in the intersection of its cell with the query interval. The chosen residue's distance within that cell from is at most , while its sum with has centered magnitude at most . Therefore lies in the enlarged radius- box. The width condition gives and , so this box has exactly distinct residues, with no ambiguity from wrapping.
Each right entry has one bucket key, each distinct key is queried once for a fixed left entry, and each left entry is visited once. Thus every returned pair is tested exactly once, including every compatible pair. Equal vectors have distinct entries and insertion numbers. Induction on the tree shows that each possible entry is produced exactly when its required filters pass and its subsampling variables equal one, as in (3.3). The specified orders determine one traversal; the observed child images determine the queried keys and exact-test outcomes.
Expected bit time. For this bound, consider the tree without imposing the storage cap. Let be a level- node with children . Condition on all leaf vectors, submatrices below level , and entry randomness below level ; call this the lower data. The child lists are then fixed and is still uniform. This conditioning does not include earlier queries at level . By (3.2), every child-pair sum has nonzero first coordinate , so its image under is uniform. It passes its exact filter and is kept by its independent subsampling variable with probability by (2.3). Linearity, followed by averaging over the lower data and applying (3.21), gives
This identity bounds the expected product of the sibling list sizes despite their dependence. Write for the number of candidate pairs returned by the bucket queries at , before the exact compatibility check and subsampling. The enlarged box bounds each pair's conditional return probability by , so
The initial pass over the right list and the visit to each left entry compute one image per child entry; by (3.21), the expected number of child entries processed this way is per merge. Each left entry generates at most bucket queries, so the expected number of queries is at most . For right entries, comparison sorting uses comparisons, and each bucket lookup uses comparisons for its two binary searches. Every tree list contains at most entries, so is polynomial in . Sorting therefore uses expected comparisons per merge.
Computing an image uses field operations per child entry. For each returned pair, add its stored images and check whether every coordinate has centered magnitude at most , as required by (2.2). If the pair passes this check and is retained by subsampling, form its vector sum and store the sum with references to its two child entries. Computing cell indices and query-interval endpoints uses integer division and modular arithmetic. Comparing bucket keys, advancing through array positions, and reading or storing child references also take polynomially many bit operations per entry, query, or returned pair.
All these operands have polynomial bit length. Field elements use bits, and a bucket key uses bits. Use the insertion numbers assigned above as entry references. There are tree nodes and at most entries per list, so entry numbers use bits even without the cap; array positions satisfy the same bound. By (2.15), , and is polynomial in , so the entry, query, and returned-pair bounds above give expected bit time over all nodes, apart from sampling, which we account for next.
4.2 Exact sampling and the total cap
Exact balancing requires Bernoulli subsampling with exact rational success probabilities. To sample uniformly from for an integer , draw fresh unbiased bits and interpret them as an integer. If it is at least , discard the trial and repeat; for , return zero. Denote this sampler by UNIFORM( ). It supplies the subsampling variables, leaf vectors, and perturbation vectors used in search. Each rejected trial overwrites the same workspace, so further trials increase the running time without using more space.
Taking and subtracting gives the independent leaf coordinates in (2.1); taking independently for each of coordinates gives the uniform perturbation vector from Section 2.5. A Bernoulli subsampling variable with success probability equals one precisely when ; it is always zero when and always one when . In particular, (2.3) gives and , without rounding. Sampling the leaf entries costs expected bit time. Generating each requested Bernoulli sample costs polynomial expected bit time and worst-case workspace by the assumed polynomial encoding lengths of its numerator and denominator.
The following lemma gives the conditional guarantee needed for each request.
Lemma 4.1 (Exact sampling with bounded workspace). The sampler UNIFORM(D) defined above is exactly uniform on and terminates with probability 1. For , its expected number of trials is less than two, its expected bit time is , and its worst-case workspace is ; the probability of more than trials is at most . For its output is always zero. These guarantees also hold conditional on the preceding computation, since each request uses fresh bits.
Proof. Put . Each trial accepts with probability . The output is uniform because all acceptable values are equally likely at every trial. Independent retries give probability at most of needing more than trials, hence termination with probability 1 and fewer than two trials on average. A trial takes bit time. Store only , the current trial value, and the number of bits drawn in that trial; rejected trials overwrite this workspace, and no counter of past trials or old random bits is stored. Fresh unbiased bits allow the same argument conditional on the preceding computation.
Subsampling requests. Each possible internal entry has a unique producing child pair, visited at most once by the traversal in Section 4.1. Generate its Bernoulli variable from fresh bits when this pair passes the compatibility check. This realizes the independent entry randomness of (3.3) as needed. By Lemma 4.1, each request has polynomial expected bit time conditional on the preceding computation. Summing these conditional bounds gives total expected subsampling time at most a polynomial factor times , even though earlier outcomes determine which requests are made. Here ranges over the internal nodes, each bucket candidate causes at most one request, and (4.2) bounds each summand.
Comparing executions at the total cap. Compare the algorithm with and without the storage cap, using the same random bits for all sampling and the processing orders from Section 4.1. The capped and uncapped computations agree until a retained pair would require storing entry . All leaf entries count toward the cap, and every stored internal entry remains until the algorithm ends. If V is the total number of entries produced without the cap, (3.21) and the choice in (2.8) give
Overflow occurs exactly when , except on the probability-zero event of a nonterminating sampler. At the algorithm completes normally. On overflow, the algorithm returns UNIFORM and its capped root list is defined to be empty. Otherwise every root entry is stored, counting entries with equal vector values separately. Until it stops, the capped algorithm follows the same traversal and makes the same sampling requests as the algorithm without the cap. Stopping early can only reduce these costs, so the expected construction and sampling time bounds above also apply to the capped algorithm.
Temporary space and termination. Each stored entry contains its vector in , its node, and, for an internal entry, two child references. These references are the insertion numbers from Section 4.1, so each entry uses bits. The selected leaf entries can be recovered by following these references. There are at most stored entries.
During one merge, the sorted right array and an auxiliary comparison-sort buffer use temporary items. Each item stores a right entry's bucket key, image, and entry number, all of polynomial bit length. To enumerate query tuples, keep the at most three cell indices per coordinate and one counter per coordinate recording the current choice; generate tuples one at a time in lexicographic order. The two array positions found by binary search specify the start of each returned bucket and the position just after its last entry. Process the pairs in this range as they are visited, and release the sort buffers after the merge. All counters and the active sampling workspace use polynomial bit space. Thus the algorithm uses worst-case bit space during list construction, regardless of how many sampling trials are rejected.
The family of possible entries is finite, and each merge queries finitely many cells and pairs. All requested samplers terminate with probability 1; the subsequent numerical evaluation also uses finitely many operations, so the algorithm terminates with probability 1.
4.3 Numerical evaluation of the Fourier statistic
Processing the root entries requires only integer arithmetic: count how many entries produce each exponent modulo q. Only q distinct roots of unity then require approximation. An error bound for each root of unity gives an absolute error bound for the whole sum.
Lemma 4.2 (Approximating roots of unity). For , , and , exact rational arithmetic computes a complex number with a rational certificate of . The bit time and every intermediate bit length are polynomial in .
Proof. We use Taylor series with explicit remainder bounds [BZ10, Section 4.4]. Set if and otherwise, so , and put . To approximate , use the identity and truncate the alternating series for the two arctangents; their errors are bounded by the first omitted terms. This gives a rational interval of width at most containing and contained in ; let be its midpoint.
The rational angle satisfies and . The Taylor polynomials about zero for and through degree have error at most ; choose making this bound at most . Since changing a real angle by changes its sine or cosine by at most , these approximations differ from the coordinates of by at most .
Round each rational approximation to the nearest multiple of , resolving ties by a fixed rule. Each coordinate error is at most
so the complex error is less than . The rational intervals and exact rounding errors certify this bound. Both arctangent series have geometrically decreasing error bounds, and the Taylor remainder bound decreases by at least a factor of two at each additional degree once . Thus terms suffice for all three approximations. Their exact fractions have polynomial bit length in , so evaluation, certification, and rounding all have polynomial bit time.
Write for the stored root list, defined to be empty on a storage abort, and put
When list construction finishes without exceeding the storage limit, initialize the integer counters to zero and process each root entry. Compute by exact modular arithmetic and increment , giving
Consequently,
Every root entry is counted separately. On abort use zero counters and without evaluation. Apply Lemma 4.2 one root of unity at a time and form by multiplying and adding their integer numerators exactly at the common denominator . The triangle inequality and the definition of give
This bound holds for every matrix, root list, and b.
The precision parameter in (2.8) is the smallest integer satisfying . Since and , this choice gives . The counters use bits. Since and are polynomial in , the evaluations of use polynomial bit time and their reusable numerical workspace uses polynomial bit space. Write , where the integer numerators and each have bits. Perform the exact integer comparison
The histogram can be reset and its workspace reused between calls.
Proof of Theorem 2.4. Enumeration of every compatible pair and fresh entry randomness give the analyzed tree process, with overflow bounded by (4.3). Sampling and traversal have expected bit time . Reading the input and computing the parameters use polynomial bit time, since the number of original samples and the encoding lengths of the public bounds are polynomial in . For every right-hand-side vector , processing the root entries to form the histogram takes at most worst-case bit time, and its subsequent numerical evaluation and threshold comparison take polynomial bit time. Adding their space to the stored entries and sort buffers preserves the worst-case bit-space bound . Equations (4.8) and (4.9) give the numerical error bound for the capped statistic and the exact comparison. When list construction finishes without exceeding the storage limit, its root list equals the root list generated without the cap, so the same deterministic error bound gives . The proof uses only the parameter checks in Section 5.1 and the assumptions of Theorem 2.4, including (2.10) and (2.15). The bounds therefore hold throughout any parameter range satisfying these assumptions uniformly.
4.4 Resources of the reductions
The reductions use the same original samples across calls, so their runtimes can be dependent. Linearity of expectation bounds the total time without requiring independence. One tail bound then gives the runtime guarantee for the entire search computation.
Proof of Proposition 2.7. Computing the parameters and reading the input use polynomial bit time and space. For arbitrary secrets, Gaussian elimination over tests the reserved samples' matrix for invertibility. If it is invertible, the resulting matrix factorization is reused to form (A.2) and, after bounded-secret search, to perform the final linear solve (A.4). All these operations take polynomial bit time. Each perturbation samples the coordinates of exactly using Lemma 4.1, then performs polynomially many bit operations. Sampling the perturbation vector takes polynomial expected bit time, and rejected trials reuse the same bounded workspace.
After successful preprocessing, decision makes one call to the bounded-secret decision algorithm, while search makes such calls with identical algorithm parameters, by (2.19). For bounded secrets, the input matrix and each perturbed matrix used in search are marginally uniform. For arbitrary secrets, the normal-form matrix and each subsequent perturbed matrix are uniform conditional on any fixed invertible . The bijections in Appendix A establish both statements.
Each call constructs the coefficient-vector lists of Algorithm 2 using its input matrix and fresh randomness; evaluation of the Fourier statistic has a worst-case time bound for every right-hand-side vector, by Theorem 2.4. We can therefore sum that theorem's one-call expected bounds, using the parameters of Lemma 2.6, without conditioning on earlier answers. In the arbitrary-secret case, these bounds hold conditional on each fixed invertible ; if is singular, the algorithm stops after the polynomial-time invertibility test. If denotes all bit time, including preprocessing, perturbations, calls, and recovery, linearity gives
One Markov bound now yields
The factor preserves the exponent because . We use this threshold only to bound total runtime; the algorithm continues to completion, so the runtime bound adds no correctness failure.
Execute the calls sequentially, releasing their stored entries and reusing the workspace for evaluating the Fourier statistic. Keep only the selected samples, the reserved samples' matrix factorization when needed, the current perturbed pair, and, for each coordinate, one accepted guess and an acceptance count capped at two. This adds polynomial space to one call's worst-case bound from Theorem 2.4. The sampler for perturbation coordinates also overwrites rejected trials without storing a trial counter. Every call terminates with probability 1, so the finite sequence does too; arbitrarily many rejected sampling trials increase the running time but reuse the same workspace, preserving the worst-case space bound.
5 Parameter choices
We now choose the leaf width , filter widths , and submatrix row counts so that the moment and resource conditions hold and the bias is large enough for decision. Our targets from Lemma 2.6 are , , and . The two requirements compete: wider leaf intervals make linear dependencies rarer, while wider filter intervals reduce the per-row filtering strengths, so each level can filter more rows; both increase the bias loss . We verify (2.10) and (2.15) and compute the mean in the ideal model for one leaf selection; Theorem 2.1 then bounds for the algorithm run without a storage limit.
5.1 Computing the parameters
Choosing the filter intervals. We choose the filter radius on the scale , with scale factor fixed below and interval width . In the ideal model, each coordinate of the sum of the node images at level has variance before reduction modulo : the summands are independent and uniform on . This choice keeps the variance on the scale across levels and controls the secret's contribution to the bias loss .
We round down to obtain integer and balance the row counts to limit list growth before subsampling. Lemma 2.6 proves the bit-time, linear-dependency, and signal bounds for these integer choices.
Public inputs and parameter checks. Let , let be prime, and let be rational public bounds with polynomially many bits in . The number of original samples is polynomial in , so reading the input costs polynomially many bit operations in the modulus regimes below. The bounded-secret decision algorithm uses the first samples; normal form uses the first samples and reserves the final samples when , and supplies by Proposition 2.9. Each decision call therefore has . All parameter checks below pass for sufficiently large in the range of Lemma 2.6.
For a positive integer , let bitlen( ) = 1 + denote its bit length. Define
(5.1)
Check that . Choose the largest power of two , and put . For levels , set
(5.2)
Check that , , and , at every level. The coefficient vector of each leaf entry is sampled independently as
(5.3)
All vector coordinates are stored as residues modulo q.
Choosing the row counts. Write for the per-row filtering strength. Since , we balance the total strengths near , targeting a filter probability at every level. Ignoring the need for integer row counts, this allocates rows to level . Thus gives a total of rows, suggesting the list-size exponent . These logarithms are for analysis only; the algorithm uses the integer comparison (5.16) to compute the row counts exactly. Let
We call the row capacity at level : the largest row count with total filtering strength at most . Write for the excess capacity, and subtract one from the capacities at the lowest levels. This gives row counts summing to . The bound , proved below, ensures there are enough distinct levels for these subtractions. Check that every is positive, and use these sizes for consecutive submatrices . With
a uniform level- image passes its filter and is kept by the independent subsampling variable with probability . If any parameter check fails, the bounded-secret decision algorithm outputs “uniform” and search reports failure before its calls. These checks concern only the number of lists, leaf and filter intervals, and positive row counts, and depend only on . The asymptotic inequalities below follow from the parameter choice.
Table 2 collects these choices together with the threshold, storage limit, and precision from (2.7) and (2.8).
Table 2: Parameter choices for levels . The row capacities are computed by exact integer comparisons; are analysis quantities.
| Parameters | Values |
|---|---|
| is the largest power of two at most . | |
5.2 The mean in the ideal model
The independent coordinates of the ideal model let us write its ideal mean as a product of Fourier coefficients. For an odd width , define the Fourier coefficient at frequency of the uniform distribution on the centered interval of width by
Use the ideal model for one leaf selection from Section 2.3. Its leaf vectors are sampled independently from the distribution in (5.3). Its node images are independent of the leaf vectors and of one another, and each is uniform in its level's filter box, with independent coordinates. Let be the sum of the leaf vectors, and let the th block of be , with both sums reduced modulo . For fixed integer vectors , , use the consecutive secret blocks and define
This is the mean of the fixed Fourier character for LWE in (3.7) under the ideal model. Symmetry of the centered intervals makes G real. Independence of the free leaf-vector coordinates and node-image coordinates gives the product. The fixed first coordinates contribute the common factor , which changes the mean's direction but not its magnitude.
5.3 Verifying the guarantees
We prove Lemma 2.6. The argument establishes valid intervals, verifies the row balance that yields the running-time exponent, and bounds the weighted contribution of linear dependencies and the bias loss . For each fixed asymptotic growth of the public bounds, we establish all estimates uniformly in the retained dimension and secret-error pair throughout (2.17). We finish by verifying exact computation and bit lengths.
Proof of Lemma 2.6. Number of lists and interval sizes. Since , the full interval (2.17) gives throughout the dimension range. By (5.1), and , so . Thus , which verifies from Section 5.1 for sufficiently large . Rounding down to a power of two gives
These inequalities give and , with .
For the target filter radius , the definition in (5.2) gives . The minimum of occurs at , and
For all sufficiently large n, the definition in gives, at every level,
Hence every . For the width check , we use to obtain
because by (5.1). This verifies the filter-interval checks in Section 5.1. The bound also implies , , and . The last two inequalities ensure that the enlarged boxes used by bucket enumeration in Section 4.1 contain distinct centered residues.
Since , (5.2) gives and . Thus and for sufficiently large , verifying the leaf-interval checks in Section 5.1. The same definition yields
(5.12) for sufficiently large . In particular . The filter widths give . Thus the geometry needed for enumeration and signal evaluation is
If either of , is zero, the corresponding product or is zero, so the corresponding inequality holds automatically; the conventions , still define and .
Estimating the reciprocal sum . Put ; (5.1) gives . Taking logarithms in (5.10) gives . Thus and . Since , put , which ranges over . The reciprocal error is
The numerator is , and each denominator factor has order because . Summing (5.14) compares with . The total error is , since the sum of is at most by comparison with its integral. For the positive decreasing function , the integral over is a lower bound on the sum. The terms with are each bounded by the integral over , so their sum is at most the integral over , and hence over . Adding the term therefore bounds the full sum by plus the integral over . Hence
Indeed and , so whereas .
Exact capacities and positive row counts. The interval checks give . For a candidate integer in (5.4), we need the capacities . Computing this floor from an approximate logarithm could change the row count near an integer boundary. Instead, the capacity is the largest integer satisfying . Exponentiating in base two gives the equivalent comparisons
The final inequality uses only integer powers. Use binary search over to compute each capacity for a fixed , and over to find the smallest value whose total capacity is at least . The integer bound bitlen is an upper search endpoint: since , at even one capacity is at least .
Since , increasing by one raises each capacity by at most one. Minimality of in (5.4) gives , so . This proves .
To quantify the effect of integer row counts, we compare with . By (5.4), , so . For an upper bound, set . The extra allows at least one more row at every level, compensating for the loss of less than one from taking a floor: since ,
Summing (5.17) gives total capacity at least , so is successful in (5.4). Thus .
For the actual row counts, in (5.4) and the rule give . Multiplying by and combining with the bounds on proves
Since , these bounds and (5.15) give
Every capacity satisfies , so for sufficiently large , verifying the row-count check in Section 5.1. The construction gives . Applying (5.18) yields
This proves both overhead bounds in (2.15) and . Since is polynomial and , we also have , , and for sufficiently large .
Linear-dependency bounds throughout the parameter range. Recall from (2.10). By (5.8), . The lower bound in (2.17) and the value of in (5.19) give and hence for sufficiently large . Since , we have . Together with (5.12), this gives
(5.21) gives . To prove the target bound , the margin beyond must also cover :
Since , the margin exceeds these additional terms for sufficiently large . Exponentiating the resulting inequality and using from (2.10) gives
Together with and established above, this verifies (2.10).
Bounding the bias loss. To prove the signal bound in (2.18), we show that . We first show that the Fourier coefficients in (5.7) are positive and bound their logarithmic losses. These losses add with weights and to give .
If is uniform on the centered interval of odd width , symmetry gives and . Hence implies
When , the last subtracted quantity is at most . Positivity and for therefore give the complete bound
At , the Fourier coefficient is one and its logarithmic loss is zero. Applying (5.25) to each factor in (5.7), with and from (5.13), proves . Since , summing the logarithmic losses yields
By (5.12) and (5.10), and for sufficiently large . The coordinate bounds give and . Substituting these inequalities into (5.26) bounds the error contribution by and the secret contribution by , using . Finally, from (2.17), from (5.8), and from (5.1) give . Together with (5.19), this gives . Thus
Together with the bounds on L and k, this verifies (2.18).
Bit lengths, encoding lengths, and termination. Computing the ceilings of the rational bounds, bit lengths, powers of two, and integer divisions uses polynomial bit time. The floors in (5.2) are computed exactly by binary search: is the largest integer with , and is the largest integer with . These comparisons use integers with bits in the stated regimes, so the searches take polynomial bit time. The search bound for row capacities is ; capacity comparisons have , so their operands in (5.16) have bits. The two nested binary searches make such comparisons, with powers obtained by integer multiplication. Thus the capacity search takes polynomial bit time. When the parameter checks pass, , and the numerator and denominator of each subsampling probability have bits. The integer has bits, despite its exponential value.
For (2.8), and . The precision parameter can be obtained by comparing integers or by subtracting this latter exponent from bitlen( ) and taking the maximum with one. Therefore . There are histogram counters , each at most , and exponents have bits. Fixed-point approximations of unit complex numbers can be represented at common denominator with numerator bits; the weighted sum , with nonnegative integer weights totaling at most , then has numerator bits. Squared-magnitude comparisons use integers of polynomial bit length. Section 4 constructs these approximations and bounds the cost of list construction and processing the root entries.
For the bounded-secret sample range of the main theorem, implies for sufficiently large ; for the arbitrary-secret range, similarly gives and in the same interval. Thus the parameter checks succeed for sufficiently large inputs throughout both ranges. The retained positions depend only on the integer dimensions , and the parameter choice and its checks depend only on . The sample-size inequalities involving and are used only in the analysis.
This verifies the conditions assumed in Sections 3 and 4, and supplies the signal and running-time exponent used to assemble the main theorem in Section 2.5.
6 AI Acknowledgments
AI was used in the production of this work. Building on the second-moment method developed in our earlier work on k-trees over integers [LV25], we adapted this technique to the current setting, found ways to deal with the greater dependencies here, and essentially reduced the analysis to bounding the covariances among a set of indicator variables. OpenAI's ChatGPT assisted with refining the required moment and covariance bounds and the parameter choices. This involved sustained interaction and verification over several weeks and passing over multiple earlier proof approaches that were needlessly complex, until we arrived at the current proof.
ChatGPT was also used for writing throughout the paper, including preparing all the figures and tables. Anthropic's Claude was used for verifying correctness, in addition to our own verification. The authors take responsibility for all content in this paper.
References
[ACKS21] Divesh Aggarwal, Yanlin Chen, Rajendra Kumar, and Yixin Shen. Improved (provable) algorithms for the shortest vector problem via bounded distance decoding. In Markus Bläser and Benjamin Monmege, editors, 38th International Symposium on Theoretical Aspects of Computer Science (STACS 2021), volume 187 of Leibniz International Proceedings in Informatics (LIPIcs), pages 4:1–4:20, Dagstuhl, Germany, 2021. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.STACS.2021.4.
[ACPS09] Benny Applebaum, David Cash, Chris Peikert, and Amit Sahai. Fast cryptographic primitives and circular-secure encryption based on hard learning problems. In Advances in Cryptology – CRYPTO 2009, volume 5677 of Lecture Notes in Computer Science, pages 595–618. Springer, 2009. doi:10.1007/978-3-642-03356-8_35.
[ADRSD15] Divesh Aggarwal, Daniel Dadush, Oded Regev, and Noah Stephens-Davidowitz. Solving the shortest vector problem in time using discrete Gaussian sampling: Extended abstract. In Proceedings of the Forty-Seventh Annual ACM Symposium on Theory of Computing (STOC 2015), pages 733–742. ACM, 2015. Full version: https://arxiv.org/abs/1412.7994. doi:10.1145/2746539.2746606.
[ADSD15] Divesh Aggarwal, Daniel Dadush, and Noah Stephens-Davidowitz. Solving the closest vector problem in time – the discrete Gaussian strikes again! In 2015 IEEE 56th Annual Symposium on Foundations of Computer Science (FOCS), pages 563–582. IEEE Computer Society, 2015. Full version: https://arxiv.org/abs/1504.01995. doi:10.1109/FOCS.2015.41.
[AFFP14] Martin R. Albrecht, Jean-Charles Faugère, Robert Fitzpatrick, and Ludovic Perret. Lazy modulus switching for the BKW algorithm on LWE. In Hugo Krawczyk, editor, Public-Key Cryptography – PKC 2014, volume 8383 of Lecture Notes in Computer Science, pages 429–445. Springer Berlin Heidelberg, Germany, 2014. doi:10.1007/978-3-642-54631-0_25.
[AG11] Sanjeev Arora and Rong Ge. New algorithms for learning in presence of errors. In Luca Aceto, Monika Henzinger, and Jiri Sgall, editors, ICALP 2011: 38th International Colloquium on Automata, Languages and Programming, Part I, volume 6755 of Lecture Notes in Computer Science, pages 403–415, Zurich, Switzerland, July 4–8, 2011. Springer Berlin Heidelberg, Germany. doi:10.1007/978-3-642-22006-7_34.
[Ajt96] Miklós Ajtai. Generating hard instances of lattice problems. In 28th Annual ACM Symposium on Theory of Computing, pages 99–108, Philadelphia, PA, USA, May 22–24, 1996. ACM Press. doi:10.1145/237814.237838.
[ALSD21] Divesh Aggarwal, Zeyong Li, and Noah Stephens-Davidowitz. A -time algorithm for -SVP and -Hermite SVP, and an improved time-approximation tradeoff for (H)SVP. In Anne Canteaut and François-Xavier Standaert, editors, Advances in Cryptology – EUROCRYPT 2021, Part I, volume 12696 of Lecture Notes in Computer Science, pages 467–497. Springer, Cham, Switzerland, 2021. doi:10.1007/978-3-030-77870-5_17.
[AR05] Dorit Aharonov and Oded Regev. Lattice problems in NP ∩ coNP. Journal of the ACM, 52(5):749–765, 2005. doi:10.1145/1089023.1089025.
[ASD18] Divesh Aggarwal and Noah Stephens-Davidowitz. Just take the average! an embarrassingly simple -time algorithm for SVP (and CVP). In Raimund Seidel, editor, 1st Symposium on Simplicity in Algorithms (SOSA 2018), volume 61 of Open Access Series in Informatics (OASIcs), pages 12:1–12:19, Dagstuhl, Germany, 2018. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/OASIcs.SOSA.2018.12.
[BGJ 20] Alessandro Budroni, Qian Guo, Thomas Johansson, Erik Mårtensson, and Paul Stankovski Wagner. Making the BKW algorithm practical for LWE. In Karthikeyan Bhargavan, Elisabeth Oswald, and Manoj Prabhakaran, editors, Progress in Cryptology - INDOCRYPT 2020: 21st International Conference in Cryptology in India, volume 12578 of Lecture Notes in Computer Science, pages 417–439. Springer, Cham, Switzerland, 2020. doi:10.1007/978-3-030-65277-7_19.
[BKW03] Avrim Blum, Adam Kalai, and Hal Wasserman. Noise-tolerant learning, the parity problem, and the statistical query model. Journal of the ACM, 50(4):506–519, 2003. doi:10.1145/792538.792543.
[BLP 13] Zvika Brakerski, Adeline Langlois, Chris Peikert, Oded Regev, and Damien Stehlé. Classical hardness of learning with errors. In Proceedings of the Forty-Fifth Annual ACM Symposium on Theory of Computing (STOC 2013), pages 575–584. ACM, 2013. Full version: https://arxiv.org/abs/1306.0281. doi:10.1145/2488608.2488680.
[BZ10] Richard P. Brent and Paul Zimmermann. Modern Computer Arithmetic. Cambridge University Press, 2010. URL: https://members.loria.fr/PZimmermann/mca/mca-cup-0.5.9.pdf.
[CJWZ26] Zhili Chen, Kaijie Jiang, Anyu Wang, and Chuanqi Zhang. A subexponential algorithm for binary LWE with sublinear samples. Cryptology ePrint Archive, Paper 2026/2289, 2026. Uploaded 1 October 2026. URL: https://eprint.iacr.org/2026/2289.
[DEL25] Léo Ducas, Lynn Engelberts, and Johanna Loyer. Wagner's algorithm provably runs in subexponential time for SIS . In Yael Tauman Kalai and Seny F. Kamara, editors, Advances in Cryptology – CRYPTO 2025, Part I, volume 16000 of Lecture Notes in Computer Science, pages 353–384, Santa Barbara, CA, USA, August 17–21, 2025. Springer, Cham, Switzerland. Full version: https://eprint.iacr.org/2025/575; correction: https://doi.org/10.1007/978-3-032-01855-7_23, p. C1. doi:10.1007/978-3-032-01855-7_12.
[GJMS17] Qian Guo, Thomas Johansson, Erik Mårtensson, and Paul Stankovski. Coded-BKW with sieving. In Tsuyoshi Takagi and Thomas Peyrin, editors, Advances in Cryptology – ASIACRYPT 2017, Part I, volume 10624 of Lecture Notes in Computer Science, pages 323–346. Springer, Cham, Switzerland, 2017. doi:10.1007/978-3-319-70694-8_12.
[GMSW21] Qian Guo, Erik Mårtensson, and Paul Stankovski Wagner. On the sample complexity of solving LWE using BKW-style algorithms. In 2021 IEEE International Symposium on Information Theory (ISIT), pages 2405–2410. IEEE, 2021. doi:10.1109/ISIT45174.2021.9518190.
[HGH26] Xuyuan Han, Yiming Gao, and Honggang Hu. A provable subexponential-time algorithm for LWE from samples via Wagner-style gaussian sampling.
Cryptology ePrint Archive, Paper 2026/2261, 2026. Uploaded 29 September 2026. URL: https://eprint.iacr.org/2026/2261.
[HKM18] Gottfried Herold, Elena Kirshanova, and Alexander May. On the asymptotic complexity of solving LWE. Designs, Codes and Cryptography, 86(1):55–83, 2018. doi:10.1007/s10623-016-0326-0.
[JKL24] Antoine Joux, Hunter Kippen, and Julian Loss. A concrete analysis of Wagner's k-list algorithm over . Cryptology ePrint Archive, Report 2024/282, 2024. URL: https://eprint.iacr.org/2024/282.
[KF15] Paul Kirchner and Pierre-Alain Fouque. An improved BKW algorithm for LWE with applications to cryptography and lattices. In Rosario Gennaro and Matthew J. B. Robshaw, editors, Advances in Cryptology – CRYPTO 2015, Part I, volume 9215 of Lecture Notes in Computer Science, pages 43–62, Santa Barbara, CA, USA, August 16–20, 2015. Springer Berlin Heidelberg, Germany. doi:10.1007/978-3-662-47989-6_3.
[LF06] Éric Levieil and Pierre-Alain Fouque. An improved LPN algorithm. In Roberto De Prisco and Moti Yung, editors, Security and Cryptography for Networks (SCN 2006), volume 4116 of Lecture Notes in Computer Science, pages 348–359. Springer Berlin Heidelberg, Germany, 2006. doi:10.1007/11832072_24.
[LV25] Haoxing Lin and Prashant Nalini Vasudevan. On Wagner's k-tree algorithm over integers. In Goichiro Hanaoka and Bo-Yin Yang, editors, Advances in Cryptology – ASIACRYPT 2025, Part I, volume 16245 of Lecture Notes in Computer Science, pages 481–513, Melbourne, VIC, Australia, December 8–12, 2025. Springer, Singapore, Singapore. Full version: https://eprint.iacr.org/2024/1612. doi:10.1007/978-981-95-5018-0_16.
[Lyu05] Vadim Lyubashevsky. The parity problem in the presence of noise, decoding random linear codes, and the subset sum problem. In Approximation, Randomization and Combinatorial Optimization. Algorithms and Techniques (APPROX/RANDOM 2005), volume 3624 of Lecture Notes in Computer Science, pages 378–389. Springer, 2005. doi:10.1007/11538462_32.
[MP13] Daniele Micciancio and Chris Peikert. Hardness of SIS and LWE with small parameters. In Ran Canetti and Juan A. Garay, editors, Advances in Cryptology – CRYPTO 2013, Part I, volume 8042 of Lecture Notes in Computer Science, pages 21–39, Santa Barbara, CA, USA, August 18–22, 2013. Springer Berlin Heidelberg, Germany. doi:10.1007/978-3-642-40041-4_2.
[MR07] Daniele Micciancio and Oded Regev. Worst-case to average-case reductions based on Gaussian measures. SIAM Journal on Computing, 37(1):267–302, 2007. doi:10.1137/S0097539705447360.
[MS12] Lorenz Minder and Alistair Sinclair. The extended k-tree algorithm. Journal of Cryptology, 25(2):349–382, April 2012. doi:10.1007/s00145-011-9097-y.
[Reg05] Oded Regev. On lattices, learning with errors, random linear codes, and cryptography. In Harold N. Gabow and Ronald Fagin, editors, 37th Annual ACM Symposium on Theory of Computing, pages 84–93, Baltimore, MD, USA, May 22–24, 2005. ACM Press. doi:10.1145/1060590.1060603.
[Wag02] David Wagner. A generalized birthday problem. In Moti Yung, editor, Advances in Cryptology – CRYPTO 2002, volume 2442 of Lecture Notes in Computer Science, pages 288–304, Santa Barbara, CA, USA, August 18–22, 2002. Springer Berlin Heidelberg, Germany. doi:10.1007/3-540-45708-9_19.
[WBLW25] Yu Wei, Lei Bi, Xianhui Lu, and Kunpeng Wang. Memory-efficient BKW algorithm for solving the LWE problem. In Tibor Jager and Jiaxin Pan, editors, Public-Key Cryptography – PKC 2025, Part II, volume 15675 of Lecture Notes in Computer Science, pages 331–362. Springer, Cham, Switzerland, 2025. Full version: https://eprint.iacr.org/2025/266. doi:10.1007/978-3-031-91823-0_11.
A Standard reductions with a fixed number of original samples
We verify the forms of the standard reductions used in Section 2.5. The points requiring care are the fixed secret-error pair, reuse of the original samples, and the explicit failure bounds.
A.1 Bounded-secret search on the same samples
Regev’s search-to-decision reduction [Reg05, full version, Lemma 4.2] is stated for independent samples with errors drawn from one distribution and a decision procedure with exponentially small error for every field secret. Here the decision guarantee is for bounded secrets and every fixed error vector, and all guesses must use the same original samples. The same coordinate perturbation applies; we record its marginal distributions and the resulting union bound.
Proof of Proposition 2.8. Fix a secret-error pair satisfying the stated bounds. Write for the matrix and right-hand-side vector of the first samples, and for their error vector. For each coordinate in turn, run a decision call for every guess in increasing order, with as in Proposition 2.8. For a call , let be the th standard basis vector in and draw a fresh uniform . The perturbed input is
For every fixed , each possible is produced by exactly one original matrix, . All these original matrices are equally likely, so is uniform with the same distribution for every . Thus and are independent uniform variables.
If , (A.1) gives , so the input has the same fixed pair . Otherwise, is nonzero modulo the prime , so multiplying by it permutes the vectors in . Conditional on , is still uniform, so is uniform. Adding the fixed vector preserves this uniformity, giving a uniform conditional on . Each call receives only the perturbed input and the public bounds, with independent fresh tree randomness.
If any parameter check in Section 5.1 fails, report failure before the calls. For sufficiently large , , so these checks pass by Lemma 2.6. Also, , so for sufficiently large . The guesses are therefore distinct modulo and include each true coordinate exactly once, including when .
By Proposition 2.3, each call has answer error probability at most , averaged over the original matrix, its perturbation vector, and its tree randomness. If every answer is correct, search recovers every coordinate. A union bound over all calls therefore gives failure probability at most . This argument neither conditions on earlier answers nor requires independence between calls.
A.2 Normal form from the reserved samples
The normal-form lemma of Applebaum–Cash–Peikert–Sahai [ACPS09, Section 3.1, Lemma 2] is stated for independent LWE samples. Its preprocessing collects linearly independent columns, discarding samples whose columns are linearly dependent on those already collected, before transforming fresh samples. We instead reserve exactly n fixed sample positions and allow failure when that block is singular. We also verify the transformation for every fixed error vector, so the guarantees hold even for error distributions with correlated coordinates.
Proof of Proposition 2.9. Let be the matrix of the first equations and the matrix of the final equations. Write and for their right-hand-side and error vectors. Test for invertibility once and report failure if it is singular. Otherwise output
(A.2)
Only and are computed; the transformed secret and errors specify their LWE representation.
Fix an original pair and an invertible matrix of reserved samples . Multiplication by carries the independent uniform matrix bijectively to uniform . Substituting and gives
The transformed secret-error pair is fixed, has dimensions and , and has both coordinate bounds at most . In the uniform case, condition further on : the right-hand-side vector remains independent uniform, and hence so does . Since , a recovered transformed secret gives
The invertibility test, transformation, and recovery use Gaussian elimination and field arithmetic, taking time polynomial in the input length.
To bound the only transformation failure, reveal the columns of in order. Conditional on the first columns being linearly independent, the next lies in their span with probability . Thus
Proof of Corollary 2.10. For , define arbitrary-secret decision to output UNIFORM and search to report failure. Otherwise test the reserved matrix once; on singularity, decision returns UNIFORM and search reports failure. On invertibility, apply Proposition 2.9 and use the first transformed equations for bounded-secret decision or search with . Computing only these columns in (A.2) is equivalent to transforming the whole prefix and then discarding the unused equations. Search perturbs only these transformed equations, keeping the reserved samples and unchanged for recovery by (A.4).
For sufficiently large , the sample assumption gives and . The bound also implies . Conditional on each fixed invertible reserved matrix, Propositions 2.3 and 2.8 therefore apply to the fixed transformed secret-error pair. Average their conditional bounds and add (A.5) once for the entire computation to obtain (2.20). Uniform input remains uniform, and a singular reserved matrix yields the correct decision output UNIFORM, so the stated decision bound also holds in that case. Both bounds tend to zero for every , including and .
B Concurrent work
Independent concurrent works by Han, Gao, and Hu [HGH26] and Chen, Jiang, Wang, and Zhang [CJWZ26] contain results very similar to ours, and we discuss these similarities and differences here.
An important different between our work and these is the approach we use in our analysis, which we consider our most important contribution. The concurrent works use a different analytical framework from ours. Both develop the Gaussian–Wagner framework of Ducas, Engelberts, and Loyer [DEL25], introducing new auxiliary superlattices that support the Gaussian sampling accuracy needed for LWE. Our approach extends the second-moment analysis of Lin and Vasudevan [LV25]: we control the Fourier statistic directly for a reusable k-tree, including the dependence created by the shared public matrix.
Han–Gao–Hu address arbitrary secrets with samples, whereas Chen–Jiang–Wang–Zhang address binary and, more generally, narrow secrets and errors with sublinear samples. Taken together, they provide Gaussian–Wagner analogues of our two main sample regimes, with several differences in scope and guarantees.
One difference is the modulus range. For polynomial prime moduli , both papers state their main specializations for fixed . Our results allow every fixed , including moduli that grow more slowly than .
For arbitrary secrets, Han–Gao–Hu obtain a wider error range at the cost of a larger running time and more samples. Their theorem covers independent discrete Gaussian errors whose width can grow as for any fixed , beyond the range stated in our theorem, with a corresponding increase in the running-time exponent. Our theorem is formulated for every fixed bounded secret-error pair, allowing correlated errors; their headline theorem uses independent Gaussian errors.
For narrow secrets, Chen–Jiang–Wang–Zhang state a fixed bound on the average squared size of the secret and errors, whereas our theorem permits secret coordinates bounded by and error coordinates bounded by . The two promises cover different inputs: a norm bound permits a few much larger coordinates, while our bounds permit all coordinates to grow. With samples, their general sampler also appears to accommodate the polylogarithmic special case after a change of parameters, so that difference in stated scope should not be viewed as a limitation of their framework. A more substantial distinction is running time: at this sample scale, their proved bound has leading constant 8 in the base-two exponent, compared with 1/2 here. They also give a broader sample-time tradeoff for their stated norm promise, obtaining subexponential time with any , , at the cost of a larger running time as the sample count decreases.