malb / lattice-estimator

An attempt at a new LWE estimator
210 stars 46 forks source link

SageMath v9.7 not working #93

Open ryanleh opened 8 months ago

ryanleh commented 8 months ago

Hi, I noticed that some things in the library appear to break when using the newest version of SageMath.

Here's a MRE:

from estimator import *

params = LWE.Parameters(n=2048, q=1<<64, Xs=ND.Uniform(-1, 1), Xe=ND.DiscreteGaussian(81920), m=1<<20)
costs = LWE.estimate.rough(params)

For SageMath v9.5 I get a valid output. For v9.7 I get the following:

Algorithm functools.partial(<estimator.lwe_primal.PrimalUSVP object at 0x7f3a3546c160>, red_cost_model=<estimator.reduction.ADPS16 object at 0x7f3771df9570>, red_shape_model='gsa') on LWEParameters(n=2048, q=66, X
s=D(σ=0.82), Xe=D(σ=81920.00), m=1048576, tag=None) failed with β = 3722 > d = 2048                                                                                                                                  
Algorithm functools.partial(<function dual_hybrid at 0x7f3771c6ecb0>, red_cost_model=<estimator.reduction.ADPS16 object at 0x7f3771df9570>, mitm_optimization=False) on LWEParameters(n=2048, q=66, Xs=D(σ=0.82), Xe=
D(σ=81920.00), m=1048576, tag=None) failed with β = 2047 > d = 1104
malb commented 8 months ago

I'm on Sage 9.8 and the example seems to work, so I can't reproduce.

nindanaoto commented 8 months ago

Hi, I also tried to reproduce the result with Sage10.2 (using the Dockerfile provided in this repository) but I could not reproduce it as well.