Skip to content

Commit

Permalink
"fix" doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
malb committed Feb 7, 2024
1 parent 790fa8c commit 43f4bdf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
14 changes: 8 additions & 6 deletions estimator/sis.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@

from .sis_lattice import lattice
from .sis_parameters import SISParameters as Parameters # noqa
from .conf import (red_cost_model as red_cost_model_default,
red_shape_model as red_shape_model_default)
from .conf import (
red_cost_model as red_cost_model_default,
red_shape_model as red_shape_model_default,
)
from .util import batch_estimate, f_name
from .reduction import RC


class Estimate:

def rough(self, params, jobs=1, catch_exceptions=True):
"""
This function makes the following somewhat routine assumptions:
Expand Down Expand Up @@ -47,7 +48,8 @@ def rough(self, params, jobs=1, catch_exceptions=True):
)
res_raw = res_raw[params]
res = {
algorithm: v for algorithm, attack in algorithms.items()
algorithm: v
for algorithm, attack in algorithms.items()
for k, v in res_raw.items()
if f_name(attack) == k
}
Expand Down Expand Up @@ -91,8 +93,8 @@ def __call__(
>>> _ = SIS.estimate(params)
lattice :: rop: ≈2^47.0, red: ≈2^47.0, δ: 1.011391, β: 61, d: 276, tag: euclidean
>>> _ = SIS.estimate(params.updated(norm=oo), red_shape_model="cn11")
lattice :: rop: ≈2^43.6, red: ≈2^42.6, sieve: ≈2^42.7, β: 40, η: 67, ζ: 112, d: 750, ...
>>> _ = SIS.estimate(params.updated(length_bound=16, norm=oo), red_shape_model="cn11")
lattice :: rop: ≈2^65.9, red: ≈2^64.9, sieve: ≈2^64.9, β: 113, η: 142, ζ: 0, d: 2486, ...
"""

algorithms = {}
Expand Down
8 changes: 4 additions & 4 deletions estimator/sis_lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,11 @@ def __call__(
>>> SIS.lattice(params)
rop: ≈2^47.0, red: ≈2^47.0, δ: 1.011391, β: 61, d: 276, tag: euclidean
>>> SIS.lattice(params.updated(norm=oo), red_shape_model="lgsa")
rop: ≈2^43.6, red: ≈2^42.6, sieve: ≈2^42.7, β: 40, η: 67, ζ: 112, d: 750, prob: 1, ↻: 1, tag: infinity
>>> SIS.lattice(params.updated(norm=oo, length_bound=16), red_shape_model="lgsa")
rop: ≈2^61.0, red: ≈2^59.9, sieve: ≈2^60.1, β: 95, η: 126, ζ: 0, d: 2486, prob: 1, ↻: 1, tag: infinity
>>> SIS.lattice(params.updated(norm=oo), red_shape_model="cn11")
rop: ≈2^43.6, red: ≈2^42.6, sieve: ≈2^42.7, β: 40, η: 67, ζ: 112, d: 750, prob: 1, ↻: 1, tag: infinity
>>> SIS.lattice(params.updated(norm=oo, length_bound=16), red_shape_model="cn11")
rop: ≈2^65.9, red: ≈2^64.9, sieve: ≈2^64.9, β: 113, η: 142, ζ: 0, d: 2486, prob: 1, ↻: 1, tag: infinity
The success condition for euclidean norm bound is derived by determining the root hermite factor required for
BKZ to produce the required output. For infinity norm bounds, the success conditions are derived using a
Expand Down

0 comments on commit 43f4bdf

Please sign in to comment.