pyecsca.ec.configuration module¶
Provides a way to work with and enumerate implementation configurations.
- class EnumDefine(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
Enum
- class Multiplication(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
EnumDefineBase multiplication algorithm to use.
- class Squaring(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
EnumDefineBase squaring algorithm to use.
- class Reduction(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
EnumDefineModular reduction method used.
- class Inversion(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
EnumDefineInversion algorithm used.
- class HashType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
EnumDefineHash algorithm used in ECDH and ECDSA.
- class RandomMod(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
EnumDefineMethod of sampling a uniform integer modulo order.
- class Configuration(model, coords, formulas, scalarmult, hash_type, mod_rand, mult, sqr, red, inv)[source]¶
Bases:
objectAn ECC implementation configuration.
-
model:
CurveModel[source]¶
-
coords:
CoordinateModel[source]¶
-
scalarmult:
ScalarMultiplier[source]¶
-
mult:
Multiplication[source]¶
-
model:
- all_configurations(**kwargs)[source]¶
Get all implementation configurations that match the given kwargs.
The keys in
kwargsshould be some of the attributes in theConfiguration, and the values limit the returned configurations to configuration matching them.Note
The
formulasattribute is unsupported and formulas should be provided using thescalarmultattribute, which is either a subclass of theScalarMultiplierclass or an instance of it or a dictionary giving arguments to a constructor of someScalarMultipliersubclass.Warning
The returned number of configurations might be quite large and take up significant memory space. Use this generator and do not store the results.
- Parameters:
kwargs¶ – The configuration parameters to match.
- Return type:
Generator[Configuration,None,None]- Returns:
A generator of the configurations.