Skip to content

Commit

Permalink
Merge pull request #139 from psivesely/fix-trivial-sis-cases
Browse files Browse the repository at this point in the history
Correct trivial SIS cases in sis_lattice.py
  • Loading branch information
malb authored Jan 27, 2025
2 parents 374f073 + 5879aa1 commit 6b25d9d
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 6b25d9d

Please sign in to comment.