[Debian-science-sagemath] Fwd: missing default.json in fplll
Julien Puydt
julien.puydt at gmail.com
Sat Feb 5 08:54:32 GMT 2022
Hi,
Le samedi 05 février 2022 à 05:34 +0000, Dima Pasechnik a écrit :
> On Fri, Feb 4, 2022 at 10:52 PM Dima Pasechnik <dimpase at gmail.com>
> wrote:
> >
> > On Fri, Feb 4, 2022 at 10:17 PM Julien Puydt
> > <julien.puydt at gmail.com> wrote:
> > >
> > > Hi,
> > >
> > > Le vendredi 04 février 2022 à 19:36 +0000, Dima Pasechnik a écrit
> > > :
> > > >
> > > > It appears that default.json is not installed anywhere, and
> > > > this
> > > > looks like a bug.
> > >
> > > The libfplll7 package depends on the libfplll7-data package which
> > > ships
> > > default.json, so I think the problem is elsewhere.
> > >
> > > Can you tell more about the issue you're seeing?
> >
> > I think it might be fpylll looking for default.json in the wrong
> > directory
>
> I don't know how fpylll looks for default.json (it doesn't seem to be
> documented) - but I won't be surprised if it's a heuristic
> broken by the unusual path name, /usr/share/libfplll7/... used in
> Debian.
>
Well, as I understand, it doesn't: fplll does.
The Debian package for fpylll looks like it's just working: it doesn't
have (and need) any patch to deal with fplll's "unusual path name",
since fplll handles it.
> >
> > I build fpylll (as Sage 9.5 package) from source, using system-wide
> > libfpylll (from libfpylll-dev)
> >
It should just work: /usr/include/fplll/fplll_config.h has a correct
#define FPLLL_DEFAULT_STRATEGY_PATH.
> > Then
> >
> > sage: from fpylll import BKZ #this shows that it does nor know the
> > right place for this json
> > sage: BKZ.DEFAULT_STRATEGY
> > b'default.json'
> >
> > # this shows that it does nor know the right place for this json -
> > it
> > should be full path to /usr/share/....
> >
No, it shouldn't:
$ python3
Python 3.9.10 (main, Jan 16 2022, 17:12:18)
[GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from fpylll import BKZ
>>> BKZ.DEFAULT_STRATEGY
b'default.json'
>>> BKZ.DEFAULT_STRATEGY_PATH
b'/usr/share/libfplll7/strategies/'
> > sage: sage: from sage.modules.free_module_integer import
> > IntegerLattice
> > ....: sage: L =
> > IntegerLattice(sage.crypto.gen_lattice(type='modular', m=10, see
> > ....: d=1337, dual=True)); L
> > Free module of degree 10 and rank 10 over Integer Ring
> > User basis matrix:
> > [-1 1 2 -2 0 1 0 -1 2 1]
> > [ 1 0 0 -1 -2 1 -2 3 -1 0]
> > [ 1 2 0 2 -1 1 -2 2 2 0]
> > [ 1 0 -1 0 2 3 0 0 -1 -2]
> > [ 1 -3 0 0 2 1 -2 -1 0 0]
> > [-3 0 -1 0 -1 2 -2 0 0 2]
> > [ 0 0 0 1 0 2 -3 -3 -2 -1]
> > [ 0 -1 -4 -1 -1 1 2 -1 0 1]
> > [ 1 1 -2 1 1 2 1 1 -2 3]
> > [ 2 -1 1 2 -3 2 2 1 0 1]
> > sage: L.shortest_vector()
> > terminate called after throwing an instance of 'std::runtime_error'
> > what(): Cannot open strategies file.
I think I have a lead on the issue ; I reported here:
https://github.com/fplll/fpylll/issues/221
In the mean time:
./sage/src/sage/matrix/matrix_integer_dense.pyx:
kwds["strategies"] = load_strategies_json(BKZ.DEFAULT_STRATEGY)
should probably use BKZ_DEFAULT_STRATEGY_PATH+BKZ_DEFAULT_STRATEGY
Cheers,
J.Puydt
More information about the Debian-science-sagemath
mailing list