Skip to content

Commit

Permalink
remove the Gauss sieve
Browse files Browse the repository at this point in the history
use g6k instead
  • Loading branch information
malb committed Dec 3, 2020
1 parent f91b853 commit ede1e45
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 190 deletions.
18 changes: 1 addition & 17 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -203,23 +203,7 @@ To compute the norm of a shortest vector of the lattice generated by the rows of
>>> A[0].norm()
8.602325267042627


Also, the ``GaussSieve`` algorithm [MV]_ is implemented,

::

>>> from fpylll import GaussSieve
>>> FPLLL.set_random_seed(0x1337)
>>> A = IntegerMatrix.random(30, "qary", k=15, q=127)
>>> v = GaussSieve(A, algorithm=2)()
>>> tuple(map(lambda x: -1*x, v)) if v[1] < 0 else v
(0, 2, 0, -2, 2, -1, -1, -4, -5, 2, 2, 4, 1, 3, -1, 0, 3, -1, -4, -2, -2, 4, -3, -1, -3, -9, -2, 1, 3, 6)
>>> print(A[0])
(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 119, 27, 122, 124, 109, 43, 58, 11, 120, 47, 48, 40, 21, 5)
>>> A[0].norm()
296.36801446849825

The previous code returns a Shortest vector of the lattice generated by :math:`{\bf A}` using ``GaussSieve`` algorithm. For the Closest Vector Problem, fplll (and so fpylll) uses enumeration::
For the Closest Vector Problem, fplll (and so fpylll) uses enumeration::

>>> from fpylll import CVP
>>> A = IntegerMatrix.from_matrix([[1,2,3,4],[30,4,4,5],[1,-2,3,4]])
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ def _get_have_long_double(self):
Extension("fpylll.fplll.enumeration", ["src/fpylll/fplll/enumeration.pyx"], fplll=True),
Extension("fpylll.fplll.svpcvp", ["src/fpylll/fplll/svpcvp.pyx"], fplll=True),
Extension("fpylll.fplll.pruner", ["src/fpylll/fplll/pruner.pyx"], fplll=True),
Extension("fpylll.fplll.sieve_gauss", ["src/fpylll/fplll/sieve_gauss.pyx"], fplll=True),
Extension("fpylll.util", ["src/fpylll/util.pyx"], fplll=True),
Extension("fpylll.io", ["src/fpylll/io.pyx"], fplll=True),
Extension("fpylll.config", ["src/fpylll/config.pyx"], fplll=True),
Expand Down
1 change: 0 additions & 1 deletion src/fpylll/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from .fplll.svpcvp import SVP
from .fplll.svpcvp import CVP
from .fplll.pruner import Pruning
from .fplll.sieve_gauss import GaussSieve
from .util import ReductionError
from .util import FPLLL
__version__ = "0.5.2dev"
5 changes: 0 additions & 5 deletions src/fpylll/fplll/decl.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ IF HAVE_QD:
from .fplll cimport dpe_t
from .fplll cimport Z_NR, FP_NR
from .fplll cimport ZZ_mat, MatGSOInterface, LLLReduction, BKZAutoAbort, BKZReduction, Enumeration
from .fplll cimport GaussSieve
from .fplll cimport Evaluator, FastEvaluator, ErrorBoundedEvaluator, FastErrorBoundedEvaluator, Pruner

from libcpp.vector cimport vector
Expand Down Expand Up @@ -83,10 +82,6 @@ ctypedef union zz_mat_core_t:
ZZ_mat[long] *long
ZZ_mat[mpz_t] *mpz

ctypedef union gauss_sieve_core_t:
GaussSieve[long, FP_NR[double]] *long_d
GaussSieve[mpz_t, FP_NR[double]] *mpz_d

ctypedef struct z_nr_t:
Z_NR[long] long
Z_NR[mpz_t] mpz
Expand Down
20 changes: 0 additions & 20 deletions src/fpylll/fplll/fplll.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -956,26 +956,6 @@ cdef extern from "fplll/pruner/pruner.h" namespace "fplll":
FT svp_probability[FT](const vector[double] &pr)



# Sieving

cdef extern from "fplll/sieve/sieve_gauss.h" namespace "fplll":
cdef cppclass GaussSieve[ZT, FT]:
GaussSieve(ZZ_mat[ZT] &B, int algorithm, bool verbose, int seed)

bool sieve(Z_NR[ZT] target_norm)

void set_verbose(bool verbose)
bool verbose

int alg

# norms/listsize for all iterations
vector[Z_NR[ZT]] iters_norm
vector[long] iters_ls

NumVect[Z_NR[ZT]] return_first()

# Threads

cdef extern from "fplll/threadpool.h" namespace "fplll":
Expand Down
9 changes: 0 additions & 9 deletions src/fpylll/fplll/sieve_gauss.pxd

This file was deleted.

137 changes: 0 additions & 137 deletions src/fpylll/fplll/sieve_gauss.pyx

This file was deleted.

0 comments on commit ede1e45

Please sign in to comment.