pyecsca.misc.cfg module¶
Provides functions for runtime configuration of the toolkit.
This includes how errors are handled, or which Mod
implementation is used.
- class pyecsca.misc.cfg.ECConfig[source]¶
Bases:
object
Configuration for the
pyecsca.ec
package.- property no_inverse_action: str¶
Return or set the action to take when a non-invertible element is to be inverted.
One of:
"error"
: Raisepyecsca.ec.error.NonInvertibleError
."warning"
: Raisepyecsca.ec.error.NonInvertibleWarning
."ignore"
: Ignore the event and compute as if nothing happened.
- property non_residue_action: str¶
Return or set the action to take when a the square-root of a non-residue is to be computed.
One of:
"error"
: Raisepyecsca.ec.error.NonResidueError
."warning"
: Raisepyecsca.ec.error.NonResidueWarning
."ignore"
: Ignore the event and compute as if nothing happened.
- property unsatisfied_formula_assumption_action: str¶
Return or set the action to take when a formula assumption is unsatisfied during execution.
This works for assumption that can be ignored without a fatal error, which are those that are not used to compute a value of an undefined parameter. For example, things of the form
Z1 = 1
. One of:"error"
: Raisepyecsca.ec.error.UnsatisfiedAssumptionError
."warning"
: Raisepyecsca.ec.error.UnsatisfiedAssumptionWarning
."ignore"
: Ignore the event and compute as if nothing happened.
- property unsatisfied_coordinate_assumption_action: str¶
Return or set the action to take when a coordinate assumption is unsatisfied during curve creation.
This works for assumption that can be ignored without a fatal error, which are those that are not used to compute a value of an undefined parameter. For example, things of the form
a = -1
. One of:"error"
: Raisepyecsca.ec.error.UnsatisfiedAssumptionError
."warning"
: Raisepyecsca.ec.error.UnsatisfiedAssumptionWarning
."ignore"
: Ignore the event and compute as if nothing happened.
- property mod_implementation: str¶
Return or set the selected
pyecsca.ec.mod.Mod
implementation.One of:
"gmp"
: Requires the GMP library and gmpy2 package."python"
: Doesn’t require anything."symbolic"
: Requires sympy.
- class pyecsca.misc.cfg.LoggingConfig[source]¶
Bases:
object
Logging configuration.
-
enabled:
bool
= True¶ Whether logging is enabled.
-
enabled:
- class pyecsca.misc.cfg.Config[source]¶
Bases:
object
Runtime configuration for the library.
-
ec:
ECConfig
¶ Configuration for the
pyecsca.ec
package.
-
log:
LoggingConfig
¶ Logging configuration.
-
ec:
- pyecsca.misc.cfg.getconfig()[source]¶
Get the current config.
- Return type:
- Returns:
The current config.
- pyecsca.misc.cfg.resetconfig(token)[source]¶
Reset the config to the previous one.
- Parameters:
token¶ (
Token
) – A token fromsetconfig()
.- Return type:
None