diff options
| m--------- | pyecsca/ec/efd | 0 | ||||
| -rw-r--r-- | pyecsca/ec/formula.py | 4 | ||||
| -rw-r--r-- | test/ec/test_regress.py | 7 |
3 files changed, 9 insertions, 2 deletions
diff --git a/pyecsca/ec/efd b/pyecsca/ec/efd -Subproject 6eb98c87eb99da90397249741fa841ebd0e432b +Subproject e82e4dfddbcf866f18992beeed622e5c0083ca6 diff --git a/pyecsca/ec/formula.py b/pyecsca/ec/formula.py index a22cf51..fff3210 100644 --- a/pyecsca/ec/formula.py +++ b/pyecsca/ec/formula.py @@ -9,7 +9,7 @@ from typing import List, Set, Any, ClassVar, MutableMapping, Tuple, Union, Dict from importlib_resources.abc import Traversable from public import public -from sympy import FF, symbols, Poly, Rational +from sympy import FF, symbols, Poly, Rational, simplify from ..misc.cache import sympify from .context import ResultAction @@ -214,7 +214,7 @@ class Formula(ABC): args.append(res) return expression.func(*args) - expr = resolve(expr, k) + expr = resolve(simplify(expr), k) poly = Poly(expr, symbols(param), domain=k) roots = poly.ground_roots() for root in roots: diff --git a/test/ec/test_regress.py b/test/ec/test_regress.py index af67096..8d54e98 100644 --- a/test/ec/test_regress.py +++ b/test/ec/test_regress.py @@ -125,3 +125,10 @@ def test_issue_14(): R = formula(p, P, Q, **curve.parameters)[0] Raff = R.to_affine() assert PQaff == Raff + + +def test_issue_53(): + secp128r1 = get_params("secg", "secp128r1", "jacobian") + coords = secp128r1.curve.coordinate_model + formula = coords.formulas["dbl-1998-hnm"] + formula(secp128r1.curve.prime, secp128r1.generator, **secp128r1.curve.parameters) |
