Skip to content

Commit

Permalink
next attempt to fix up postprocessing
Browse files Browse the repository at this point in the history
  • Loading branch information
malb committed Jul 12, 2017
1 parent 139c205 commit 04d1f73
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/fpylll/algorithms/bkz.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ def svp_postprocessing(self, kappa, block_size, solution, tracer):
:param tracer: object for maintaining statistics
:returns: ``True`` if no change was made and ``False`` otherwise
.. note :: postprocessing does not necessarily leave the GSO in a safe state. You may
need to call ``update_gso()`` afterwards.
"""
if solution is None:
return True
Expand Down Expand Up @@ -253,9 +256,6 @@ def svp_postprocessing(self, kappa, block_size, solution, tracer):

self.M.move_row(kappa + block_size - 1, kappa)

# TODO the C++ version doesn't seem to require this call
self.lll_obj.size_reduction(kappa, kappa+block_size, kappa)

return False

def svp_reduction(self, kappa, block_size, params, tracer=dummy_tracer):
Expand Down
4 changes: 4 additions & 0 deletions src/fpylll/algorithms/bkz2.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ def svp_preprocessing(self, kappa, block_size, param, tracer=dummy_tracer):
prepar = param.__class__(block_size=preproc, strategies=param.strategies, flags=BKZ.GH_BND)
clean &= self.tour(prepar, kappa, kappa + block_size, tracer=tracer)

# clean up the GSO which is left in a messy state by postprocessing
# TODO the C++ version doesn't seem to require this call
self.lll_obj.size_reduction(kappa, kappa+block_size, kappa)

return clean

def svp_reduction(self, kappa, block_size, param, tracer=dummy_tracer):
Expand Down

0 comments on commit 04d1f73

Please sign in to comment.