Skip to content

Commit

Permalink
Trac #33302: fpylll might not find system-wide fplll's strategies json
Browse files Browse the repository at this point in the history
This in particular is observed on Debian 11, see
fplll/fpylll#221

{{{
sage: from sage.modules.free_module_integer import IntegerLattice
sage: L = IntegerLattice(sage.crypto.gen_lattice(type='modular', m=10,
seed=1337, dual=True))
sage: L.shortest_vector()
terminate called after throwing an instance of 'std::runtime_error'
  what():  Cannot open strategies file.
------------------------------------------------------------------------
---
KeyError                                  Traceback (most recent call
last)
~/work/sage/local/var/lib/sage/venv-python3.9/lib/python3.9/site-
packages/sage/misc/cachefunc.pyx in
sage.misc.cachefunc.CachedMethodCaller.__call__
(build/cythonized/sage/misc/cachefunc.c:10347)()
   1942             try:
-> 1943                 return cache[k]
   1944             except TypeError:  # k is not hashable

KeyError: ((True, 'fplll'), ())
...
}}}

The latter is an extract from a failing doctest.

While it's fixed in fplll's master, we need a fix for the current
fpylll.

URL: https://trac.sagemath.org/33302
Reported by: dimpase
Ticket author(s): Dima Pasechnik
Reviewer(s): Martin Albrecht
  • Loading branch information
Release Manager committed Feb 14, 2022
2 parents c10d7bb + 20ca9f7 commit 9a9c821
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/sage/matrix/matrix_integer_dense.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2927,7 +2927,10 @@ cdef class Matrix_integer_dense(Matrix_dense):
# 2. the user has specified the relevant parameters already
if "strategies" not in kwds:
if proof is False:
kwds["strategies"] = load_strategies_json(BKZ.DEFAULT_STRATEGY)
import os
kwds["strategies"] = load_strategies_json(
BKZ.DEFAULT_STRATEGY_PATH +
os.path.basename(BKZ.DEFAULT_STRATEGY))

if "auto_abort" not in kwds:
if proof is False:
Expand Down

0 comments on commit 9a9c821

Please sign in to comment.