pyecsca.ec.mult.ladder module¶
Provides ladder-based scalar multipliers, either using the ladder formula, or (diffadd, dbl) or (add, dbl).
- class LadderMultiplier(ladd, dbl=None, scl=None, complete=True, short_circuit=True, full=False)[source]¶
Bases:
ScalarMultiplier
Montgomery ladder multiplier, using a three input, two output ladder formula.
Optionally takes a doubling formula, and if both complete and full is false, it requires one.
- Parameters:
- requires: ClassVar[Set[Type]] = {<class 'pyecsca.ec.formula.base.LadderFormula'>}[source]¶
The set of formula types that the multiplier requires.
- optionals: ClassVar[Set[Type]] = {<class 'pyecsca.ec.formula.base.DoublingFormula'>, <class 'pyecsca.ec.formula.base.ScalingFormula'>}[source]¶
The optional set of formula types that the multiplier can use.
- multiply(scalar)[source]¶
Multiply the point with the scalar.
Note
The multiplier needs to be initialized by a call to the
init()
method.
- init(params, point)[source]¶
Initialize the scalar multiplier with
params
and apoint
.Warning
The point is not verified to be on the curve represented in the domain parameters.
- Parameters:
params¶ (
DomainParameters
) – The domain parameters to initialize the multiplier with.point¶ (
Point
) – The point to initialize the multiplier with.
- class SimpleLadderMultiplier(add, dbl, scl=None, complete=True, short_circuit=True)[source]¶
Bases:
ScalarMultiplier
Montgomery ladder multiplier, using addition and doubling formulas.
- Parameters:
- requires: ClassVar[Set[Type]] = {<class 'pyecsca.ec.formula.base.AdditionFormula'>, <class 'pyecsca.ec.formula.base.DoublingFormula'>}[source]¶
The set of formula types that the multiplier requires.
- optionals: ClassVar[Set[Type]] = {<class 'pyecsca.ec.formula.base.ScalingFormula'>}[source]¶
The optional set of formula types that the multiplier can use.
- multiply(scalar)[source]¶
Multiply the point with the scalar.
Note
The multiplier needs to be initialized by a call to the
init()
method.
- init(params, point)[source]¶
Initialize the scalar multiplier with
params
and apoint
.Warning
The point is not verified to be on the curve represented in the domain parameters.
- Parameters:
params¶ (
DomainParameters
) – The domain parameters to initialize the multiplier with.point¶ (
Point
) – The point to initialize the multiplier with.
- class DifferentialLadderMultiplier(dadd, dbl, scl=None, complete=True, short_circuit=True, full=False)[source]¶
Bases:
ScalarMultiplier
Montgomery ladder multiplier, using differential addition and doubling formulas.
- Parameters:
- requires: ClassVar[Set[Type]] = {<class 'pyecsca.ec.formula.base.DifferentialAdditionFormula'>, <class 'pyecsca.ec.formula.base.DoublingFormula'>}[source]¶
The set of formula types that the multiplier requires.
- optionals: ClassVar[Set[Type]] = {<class 'pyecsca.ec.formula.base.ScalingFormula'>}[source]¶
The optional set of formula types that the multiplier can use.
- init(params, point)[source]¶
Initialize the scalar multiplier with
params
and apoint
.Warning
The point is not verified to be on the curve represented in the domain parameters.
- Parameters:
params¶ (
DomainParameters
) – The domain parameters to initialize the multiplier with.point¶ (
Point
) – The point to initialize the multiplier with.