pyecsca.ec.mult.comb module¶
Provides Comb-like scalar multipliers, such as BGMW or Lim-Lee.
- class BGMWMultiplier(add, dbl, width, scl=None, direction=ProcessingDirection.LTR, accumulation_order=AccumulationOrder.PeqPR, short_circuit=True)[source]¶
Bases:
AccumulatorMultiplier
,ScalarMultiplier
Brickell, Gordon, McCurley and Wilson (BGMW) scalar multiplier, or rather, its one parametrization.
Algorithm 3.41 from [GECC]
- Parameters:
width¶ (
int
) – Window width.direction¶ (
ProcessingDirection
) – Whether it is LTR or RTL.accumulation_order¶ (
AccumulationOrder
) – The order of accumulation of points.
- 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.
-
direction:
ProcessingDirection
[source]¶ Whether it is LTR or RTL.
- 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.
- multiply(scalar)[source]¶
Multiply the point with the scalar.
Note
The multiplier needs to be initialized by a call to the
init()
method.
- class CombMultiplier(add, dbl, width, scl=None, accumulation_order=AccumulationOrder.PeqPR, short_circuit=True)[source]¶
Bases:
AccumulatorMultiplier
,ScalarMultiplier
Comb multiplier.
Algorithm 3.44 from [GECC]
- Parameters:
width¶ (
int
) – Window width (number of comb teeth).accumulation_order¶ (
AccumulationOrder
) – The order of accumulation of points.
- 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.
- short_circuit: bool[source]¶
Whether the formulas will short-circuit upon input of the point at infinity.
- 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.