Skip to content

Commit

Permalink
Correct trivial SIS cases in sis_lattice.py
Browse files Browse the repository at this point in the history
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 #111
  • Loading branch information
psivesely authored Jan 27, 2025
1 parent 374f073 commit 5879aa1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions estimator/sis_lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5879aa1

Please sign in to comment.