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 ECConfig[source]¶
Bases:
object
Configuration for the
pyecsca.ec
package.- property no_inverse_action: str[source]¶
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[source]¶
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[source]¶
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[source]¶
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.
- class Config[source]¶
Bases:
object
Runtime configuration for the library.
-
ec:
ECConfig
[source]¶ Configuration for the
pyecsca.ec
package.
-
log:
LoggingConfig
[source]¶ Logging configuration.
-
ec:
- resetconfig(token)[source]¶
Reset the config to the previous one.
- Parameters:
token¶ (
Token
) – A token fromsetconfig()
.- Return type:
None