J08nY / pyecsca

Unused variable found PYL-W0612
Anti-pattern
Major
4 months ago3 years old
Unused variable 'params'
430
431
432def test_partition_formula_single(library_formula_params):
433    formula, params = library_formula_params434    try:
435        next(iter(generate_partitioned_formulas(formula)))
436    except StopIteration:
Unused variable 'power'
173        # Factor the intermediate, don't worry about the coeff
174        coeff, factor_list = poly.factor_list()
175        # Go over all the factors of the intermediate, forget the power
176        for factor, power in factor_list:177            # Remove unnecessary variables from the Poly
178            reduced = factor.exclude()
179            # If there are only curve parameters, we do not care about the polynomial
Unused variable 'coeff'
171    # Go over all the unrolled intermediates
172    for name, poly in unrolled:
173        # Factor the intermediate, don't worry about the coeff
174        coeff, factor_list = poly.factor_list()175        # Go over all the factors of the intermediate, forget the power
176        for factor, power in factor_list:
177            # Remove unnecessary variables from the Poly
Unused variable 'name'
162    unrolled = map_to_affine(formula, unrolled)
163    # Try all intermediates, zvp_point should return empty set if ZVP points do not exist
164    # Try with a few scalars to actually test more resulting ZVP points
165    for name, poly in unrolled:166        for k in (2, 3, 5):
167            points = zvp_points(poly, secp128r1.curve, k, secp128r1.order)
168            if points:
Unused variable 'name'
 38    results = unroll_formula(formula)
 39    mapped = map_to_affine(formula, results)
 40    assert mapped is not None
 41    for name, res in mapped: 42        assert isinstance(res, Poly)
 43
 44