From 5879aa1cded7c2b7ac1b07ad8e4ab72c072ccbbe Mon Sep 17 00:00:00 2001 From: Psi Vesely Date: Sun, 26 Jan 2025 18:26:41 -0800 Subject: [PATCH] Correct trivial SIS cases in sis_lattice.py A(q*e1) = 0 mod q is a trivial solution with l_2 and l_inf. In the centered representation we're using signed modulus range [-(q-1)/2,(q-1)/2] as clarified in https://github.com/malb/lattice-estimator/issues/111 --- estimator/sis_lattice.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/estimator/sis_lattice.py b/estimator/sis_lattice.py index 8b37e9ad..148af89c 100644 --- a/estimator/sis_lattice.py +++ b/estimator/sis_lattice.py @@ -55,8 +55,8 @@ def cost_euclidean( **kwds, ): # Check for triviality - if params.length_bound >= sqrt(params.m) * (params.q / 2): - raise ValueError("SIS trivially easy. Please set norm bound < √{m}⋅q/2.") + if params.length_bound >= (params.q-1) / 2: + raise ValueError("SIS trivially easy. Please set norm bound < (q-1)/2.") if d is None: d = min(floor(SISLattice._opt_sis_d(params)), params.m) @@ -104,8 +104,8 @@ def cost_infinity( it merely reports costs. """ - if params.length_bound >= params.q: - raise ValueError("SIS trivially easy. Please set norm bound < q.") + if params.length_bound >= (params.q-1)/2: + raise ValueError("SIS trivially easy. Please set norm bound < (q-1)/2.") if d is None: d = params.m