From 43f4bdf05b03320c5d59418d7067b24325d4944a Mon Sep 17 00:00:00 2001 From: "Martin R. Albrecht" Date: Wed, 7 Feb 2024 15:23:48 +0000 Subject: [PATCH] "fix" doctests --- estimator/sis.py | 14 ++++++++------ estimator/sis_lattice.py | 8 ++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/estimator/sis.py b/estimator/sis.py index 3b4b21e..b8fda0d 100644 --- a/estimator/sis.py +++ b/estimator/sis.py @@ -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: @@ -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 } @@ -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 = {} diff --git a/estimator/sis_lattice.py b/estimator/sis_lattice.py index 21f9be4..60046e4 100644 --- a/estimator/sis_lattice.py +++ b/estimator/sis_lattice.py @@ -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