diff options
| author | J08nY | 2024-07-12 18:17:15 +0200 |
|---|---|---|
| committer | J08nY | 2024-07-12 18:17:15 +0200 |
| commit | 539812a80ba8a178a5801d8f8dcc9a252104768e (patch) | |
| tree | 5d42c4c93af6d1c0e32b5adaf201c331afa69720 /pyecsca/ec/formula | |
| parent | c7ab476fdfc2ac04e193fdf2fdb7a1badf1184d9 (diff) | |
| download | pyecsca-539812a80ba8a178a5801d8f8dcc9a252104768e.tar.gz pyecsca-539812a80ba8a178a5801d8f8dcc9a252104768e.tar.zst pyecsca-539812a80ba8a178a5801d8f8dcc9a252104768e.zip | |
xreplace in generic sympy substitution.
Diffstat (limited to 'pyecsca/ec/formula')
| -rw-r--r-- | pyecsca/ec/formula/base.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pyecsca/ec/formula/base.py b/pyecsca/ec/formula/base.py index bf5b791..fee39aa 100644 --- a/pyecsca/ec/formula/base.py +++ b/pyecsca/ec/formula/base.py @@ -202,9 +202,9 @@ class Formula(ABC): for symbol in expr.free_symbols: if (value := params.get(str(symbol), None)) is not None: if isinstance(value, SymbolicMod): - expr = expr.subs(symbol, value.x) + expr = expr.xreplace({symbol: value.x}) else: - expr = expr.subs(symbol, int(value)) + expr = expr.xreplace({symbol: int(value)}) else: remaining.append(symbol) if len(remaining) > 1 or (param := str(remaining[0])) not in self.parameters: |
