pyecsca.ec.mult.msm.base module¶
Provides (mostly abstract) base classes for multi-scalar multipliers and the actions used in them.
- class MultiScalarMultiplierAction(points, params, scalars)[source]¶
Bases:
ResultActionA multi-scalar multiplication of points on a curve by scalars.
- params: DomainParameters[source]¶
- class MultiScalarMultiplier(short_circuit=True, **formulas)[source]¶
Bases:
MultiplierBase,ABCA multi-scalar multiplication algorithm.
A multi-scalar multiplier computes the linear combination of a fixed set of points with a set of scalars, i.e. the sum of the products of each point with its scalar.
Note
The __init__ method of all concrete subclasses needs to have type annotations so that configuration enumeration works.
- Parameters:
- optionals: ClassVar[Set[Type]][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, points, bits=None)[source]¶
Initialize the multi-scalar multiplier with
paramsand a list ofpoints.Warning
The points are not verified to be on the curve represented in the domain parameters.
- Parameters:
params¶ (
DomainParameters) – The domain parameters to initialize the multiplier with.points¶ (
List[Point]) – The points to initialize the multiplier with.bits¶ (
Optional[int]) – The number of bits to use in the multi-scalar multiplication (i.e. no scalar will be larger than 2^bits). The default is the bit length of the full order of the curve (including cofactor).