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:
EnumDefine
Base multiplication algorithm to use.
- class Squaring(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
EnumDefine
Base squaring algorithm to use.
- class Reduction(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
EnumDefine
Modular reduction method used.
- class Inversion(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
EnumDefine
Inversion algorithm used.
- class HashType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
EnumDefine
Hash algorithm used in ECDH and ECDSA.
- class RandomMod(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
EnumDefine
Method of sampling a uniform integer modulo order.
- class Configuration(model, coords, formulas, scalarmult, hash_type, mod_rand, mult, sqr, red, inv)[source]¶
Bases:
object
An 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
kwargs
should be some of the attributes in theConfiguration
, and the values limit the returned configurations to configuration matching them.Note
The
formulas
attribute is unsupported and formulas should be provided using thescalarmult
attribute, which is either a subclass of theScalarMultiplier
class or an instance of it or a dictionary giving arguments to a constructor of someScalarMultiplier
subclass.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.