fplll / fpylll

A Python interface for https://github.com/fplll/fplll
GNU General Public License v2.0
119 stars 60 forks source link

infinite loop in babai #141

Closed lqliumeng closed 5 years ago

lqliumeng commented 5 years ago

Hi Martin,

I want to run BKZ2.0 on a 666-dim LLL basis. But it shows an error "fpylll.util.ReductionError: infinite loop in babai". The following is the main code. from fpylll import * from fpylll.algorithms.bkz2 import BKZReduction as BKZ2 flags = BKZ.AUTO_ABORT|BKZ.MAX_LOOPS|BKZ.GH_BND par = BKZ.Param(80, strategies=BKZ.DEFAULT_STRATEGY, max_loops=4, flags=flags) strategies = load_strategies_json(BKZ.DEFAULT_STRATEGY) A = IntegerMatrix.from_file('BKZ_BASIS4_1.txt') bkz = BKZ2(A) bkz = BKZ2(LLL.Reduction(GSO.Mat(A))) _ = bkz(par) The error is as follows. Traceback (most recent call last): File "4.py", line 16, in <module> _ = bkz(par) File "/mnt/f/env/local/lib/python2.7/site-packages/fpylll/algorithms/bkz.py", line 84, in __call__ self.lll_obj() File "src/fpylll/fplll/lll.pyx", line 305, in fpylll.fplll.lll.LLLReduction.__call__ fpylll.util.ReductionError: infinite loop in babai Could you please tell me how to make BKZ work for high dimension? Thank you.

malb commented 5 years ago

You need to compute with higher precision. Instead of passing in A to BK2, pass in GSO.Mat(A) where you picked the float type e.g. "mpfr" and set the precision with FPLLL.set_precision(???) beforehand.