[Python-modules-team] Bug#976778: Known upstream, fixed with upcoming new version
Gianfranco Costamagna
locutusofborg at debian.org
Wed Dec 9 16:03:23 GMT 2020
On Tue, 08 Dec 2020 08:49:45 +0100 Julien Puydt <julien.puydt at gmail.com> wrote:
> Hi,
>
> here is the upstream patch fixing the issue :
>
> https://github.com/fplll/fpylll/commit/ede1e459f0662a0940dca6366aba20d47183a4a0
>
> I tought they'd have already released the new version with this in, but
> I should have waited until that was done...
>
> And since this patch needs other changes to apply, I can't just add it.
>
> I'll work on it as soon as upstream will have released the new version.
>
> Sorry,
If you want, you can just use the Ubuntu patch
G.
-------------- next part --------------
diff -Nru fpylll-0.5.2+ds1/debian/changelog fpylll-0.5.2+ds1/debian/changelog
--- fpylll-0.5.2+ds1/debian/changelog 2020-10-12 22:44:41.000000000 +0200
+++ fpylll-0.5.2+ds1/debian/changelog 2020-12-09 12:29:50.000000000 +0100
@@ -1,3 +1,21 @@
+fpylll (0.5.2+ds1-2ubuntu1) hirsute; urgency=medium
+
+ * Fix ftbfs with fplll. Closes: #976778.
+
+ -- Matthias Klose <doko at ubuntu.com> Wed, 09 Dec 2020 12:29:50 +0100
+
+fpylll (0.5.2+ds1-2build2) hirsute; urgency=medium
+
+ * No-change rebuild to drop python3.8 extensions.
+
+ -- Matthias Klose <doko at ubuntu.com> Mon, 07 Dec 2020 18:23:00 +0100
+
+fpylll (0.5.2+ds1-2build1) hirsute; urgency=medium
+
+ * No-change rebuild for fplll soname change.
+
+ -- Matthias Klose <doko at ubuntu.com> Mon, 07 Dec 2020 17:30:07 +0100
+
fpylll (0.5.2+ds1-2) unstable; urgency=medium
[ Ondřej Nový ]
diff -Nru fpylll-0.5.2+ds1/debian/patches/ede1e459f0662a0940dca6366aba20d47183a4a0.diff fpylll-0.5.2+ds1/debian/patches/ede1e459f0662a0940dca6366aba20d47183a4a0.diff
--- fpylll-0.5.2+ds1/debian/patches/ede1e459f0662a0940dca6366aba20d47183a4a0.diff 1970-01-01 01:00:00.000000000 +0100
+++ fpylll-0.5.2+ds1/debian/patches/ede1e459f0662a0940dca6366aba20d47183a4a0.diff 2020-12-09 12:29:50.000000000 +0100
@@ -0,0 +1,222 @@
+--- a/setup.py
++++ b/setup.py
+@@ -203,7 +203,6 @@ extensions = [
+ 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),
+--- a/src/fpylll/__init__.py
++++ b/src/fpylll/__init__.py
+@@ -9,7 +9,6 @@ from .fplll.bkz_param import load_strate
+ 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"
+--- a/src/fpylll/fplll/decl.pxd
++++ b/src/fpylll/fplll/decl.pxd
+@@ -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
+@@ -83,10 +82,6 @@ ctypedef union zz_mat_core_t:
+ ZZ_mat[mpz_t] *mpz
+ ZZ_mat[long] *long
+
+-ctypedef union gauss_sieve_core_t:
+- GaussSieve[mpz_t, FP_NR[double]] *mpz_d
+- GaussSieve[long, FP_NR[double]] *long_d
+-
+ IF HAVE_LONG_DOUBLE:
+ IF HAVE_QD:
+ # we cannot use a union because of non-trivial constructors
+--- a/src/fpylll/fplll/fplll.pxd
++++ b/src/fpylll/fplll/fplll.pxd
+@@ -943,26 +943,6 @@ cdef extern from "fplll/pruner/pruner.h"
+ 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":
+--- a/src/fpylll/fplll/sieve_gauss.pxd
++++ /dev/null
+@@ -1,9 +0,0 @@
+-# -*- coding: utf-8 -*-
+-
+-from fpylll.gmp.types cimport mpz_t
+-from .fplll cimport FP_NR, IntType
+-from .decl cimport gauss_sieve_core_t
+-
+-cdef class GaussSieve:
+- cdef IntType _type
+- cdef gauss_sieve_core_t _core
+--- a/src/fpylll/fplll/sieve_gauss.pyx
++++ /dev/null
+@@ -1,137 +0,0 @@
+-# -*- coding: utf-8 -*-
+-"""
+-Gaussian sieving.
+-
+-.. moduleauthor:: Martin R. Albrecht <martinralbrecht+fpylll at googlemail.com>
+-
+-Gaussian Sieving was proposed in Micciancio, D., & Voulgaris, P. (2010). Faster exponential time
+-algorithms for the shortest vector problem. In M. Charika, 21st SODA (pp. 1468–1480). :
+-ACM-SIAM.
+-
+-Example::
+-
+- >>> from fpylll import IntegerMatrix, GaussSieve, SVP, LLL, FPLLL
+- >>> FPLLL.set_random_seed(1337)
+- >>> A = IntegerMatrix.random(20, "qary", k=10, q=127); A = LLL.reduction(A)
+- >>> w = SVP.shortest_vector(A)
+- >>> v = GaussSieve(A, algorithm=2)()
+- >>> sum([w_**2 for w_ in w]) == sum([v_**2 for v_ in v])
+- True
+-
+-"""
+-
+-include "fpylll/config.pxi"
+-
+-from random import randint
+-from .fplll cimport NumVect, Z_NR, ZT_MPZ, ZT_LONG
+-from .fplll cimport GaussSieve as GaussSieve_c
+-from fpylll.io cimport assign_Z_NR_mpz, mpz_get_python
+-from .integer_matrix cimport IntegerMatrix
+-from cysignals.signals cimport sig_on, sig_off
+-
+-
+-cdef class GaussSieve:
+- def __init__(self, IntegerMatrix A, int algorithm, int verbose=0, seed=None):
+- """Create new Gaussian Sieve
+-
+- :param IntegerMatrix A: sieving will be performed over the whole basis
+- :param algorithm: one of 2,3 or 4 for 2-, 3- or 4-sieving respectively
+-
+- """
+- if seed is None:
+- seed = randint(0, 2**31)
+-
+- if algorithm not in (2,3,4):
+- raise ValueError("Algorithm must be one of 2, 3 or 4, but received %d"%algorithm)
+-
+- if A._type == ZT_MPZ:
+- self._core.mpz_d = new GaussSieve_c[mpz_t, FP_NR[double]](A._core.mpz[0], algorithm, verbose, seed)
+- elif A._type == ZT_LONG:
+- self._core.long_d = new GaussSieve_c[long, FP_NR[double]](A._core.long[0], algorithm, verbose, seed)
+- else:
+- raise RuntimeError("Integer type '%s' not understood."%A._type)
+-
+- self._type = A._type
+-
+- def __dealloc__(self):
+- """
+- Delete sieve
+- """
+- if self._type == ZT_MPZ:
+- del self._core.mpz_d
+- elif self._type == ZT_LONG:
+- del self._core.long_d
+-
+- def __call__(self, int target_norm=0):
+- """
+- Call sieving algorithm and return shortest vector found
+-
+- :param target_norm:
+-
+- """
+-
+- cdef Z_NR[mpz_t] target_norm_mpz_
+- cdef Z_NR[long] target_norm_l_
+- cdef NumVect[Z_NR[mpz_t]] r_mpz_
+- cdef NumVect[Z_NR[long]] r_l_
+- cdef list r = []
+-
+- if self._type == ZT_MPZ:
+- assign_Z_NR_mpz(target_norm_mpz_, target_norm)
+- sig_on()
+- self._core.mpz_d.sieve(target_norm_mpz_)
+- sig_off()
+-
+- r_mpz_ = self._core.mpz_d.return_first()
+-
+- for i in range(r_mpz_.size()):
+- r.append(mpz_get_python(r_mpz_[i].get_data()))
+- elif self._type == ZT_LONG:
+- target_norm_l_ = target_norm
+- sig_on()
+- self._core.long_d.sieve(target_norm_l_)
+- sig_off()
+-
+- r_l_ = self._core.long_d.return_first()
+-
+- for i in range(r_l_.size()):
+- r.append(r_l_[i].get_data())
+- else:
+- RuntimeError("Integer type '%s' not understood."%self._type)
+-
+- return tuple(r)
+-
+- @property
+- def verbose(self):
+- """
+- >>> from fpylll import IntegerMatrix, GaussSieve, SVP, LLL
+- >>> A = IntegerMatrix.random(30, "qary", k=15, q=127); A = LLL.reduction(A)
+- >>> GaussSieve(A, 2, verbose=True).verbose
+- True
+-
+- """
+- if self._type == ZT_MPZ:
+- return self._core.mpz_d.verbose
+- elif self._type == ZT_LONG:
+- return self._core.long_d.verbose
+- else:
+- RuntimeError("Integer type '%s' not understood."%self._type)
+-
+- @verbose.setter
+- def verbose(self, value):
+- """
+- >>> from fpylll import IntegerMatrix, GaussSieve, SVP, LLL
+- >>> A = IntegerMatrix.random(30, "qary", k=15, q=127); A = LLL.reduction(A)
+- >>> sieve = GaussSieve(A, 2, verbose=True)
+- >>> sieve.verbose = False
+- >>> sieve.verbose
+- False
+-
+- """
+-
+- if self._type == ZT_MPZ:
+- self._core.mpz_d.set_verbose(value)
+- elif self._type == ZT_LONG:
+- self._core.long_d.set_verbose(value)
+- else:
+- RuntimeError("Integer type '%s' not understood."%self._type)
diff -Nru fpylll-0.5.2+ds1/debian/patches/series fpylll-0.5.2+ds1/debian/patches/series
--- fpylll-0.5.2+ds1/debian/patches/series 1970-01-01 01:00:00.000000000 +0100
+++ fpylll-0.5.2+ds1/debian/patches/series 2020-12-09 12:29:50.000000000 +0100
@@ -0,0 +1 @@
+ede1e459f0662a0940dca6366aba20d47183a4a0.diff
More information about the Python-modules-team
mailing list