pyecsca.ec.formula.code module

Provides a concrete class of a formula that has a constructor and some code.

class CodeFormula(name, code, coordinate_model, parameters, assumptions, unified=False)[source]

Bases: Formula

A basic formula class that can be directly initialized with the code and other attributes.

name: str[source]

Name of the formula.

code: List[CodeOp][source]

The collection of ops that constitute the code of the formula.

coordinate_model: Any[source]

Coordinate model of the formula.

meta: MutableMapping[str, Any][source]

Meta information about the formula, such as its source.

parameters: List[str][source]

Formula parameters (i.e. new parameters introduced by the formula, like half = 1/2).

assumptions: List[Expression][source]

Assumptions of the formula (e.g. Z1 == 1 or 2*half == 1).

unified: bool[source]

Whether the formula specifies that it is unified.

property assumptions_str[source]
property input_index[source]

Return the starting index where this formula reads its inputs.

property inputs[source]

Return the input variables of the formula.

property num_addsubs: int[source]

Return the number of additions and subtractions.

property num_divisions: int[source]

Return the number of divisions.

property num_inversions: int[source]

Return the number of inversions.

property num_multiplications: int[source]

Return the number of multiplications.

property num_operations: int[source]

Return the number of operations.

property num_powers: int[source]

Return the number of powers.

property num_squarings: int[source]

Return the number of squarings.

property output_index[source]

Return the starting index where this formula stores its outputs.

property outputs[source]

Return the output variables of the formula.

shortname: ClassVar[str][source]

A shortname for the type of the formula.

num_inputs: ClassVar[int][source]

Number of inputs (points) of the formula.

num_outputs: ClassVar[int][source]

Number of outputs (points) of the formula.

class CodeAdditionFormula(name, code, coordinate_model, parameters, assumptions, unified=False)[source]

Bases: AdditionFormula, CodeFormula

property assumptions_str[source]
property input_index[source]

Return the starting index where this formula reads its inputs.

property inputs[source]

Return the input variables of the formula.

property num_addsubs: int[source]

Return the number of additions and subtractions.

property num_divisions: int[source]

Return the number of divisions.

num_inputs: ClassVar[int] = 2[source]

Number of inputs (points) of the formula.

property num_inversions: int[source]

Return the number of inversions.

property num_multiplications: int[source]

Return the number of multiplications.

property num_operations: int[source]

Return the number of operations.

num_outputs: ClassVar[int] = 1[source]

Number of outputs (points) of the formula.

property num_powers: int[source]

Return the number of powers.

property num_squarings: int[source]

Return the number of squarings.

property output_index[source]

Return the starting index where this formula stores its outputs.

property outputs[source]

Return the output variables of the formula.

shortname: ClassVar[str] = 'add'[source]

A shortname for the type of the formula.

name: str[source]

Name of the formula.

coordinate_model: Any[source]

Coordinate model of the formula.

meta: MutableMapping[str, Any][source]

Meta information about the formula, such as its source.

parameters: List[str][source]

Formula parameters (i.e. new parameters introduced by the formula, like half = 1/2).

assumptions: List[Expression][source]

Assumptions of the formula (e.g. Z1 == 1 or 2*half == 1).

code: List[CodeOp][source]

The collection of ops that constitute the code of the formula.

unified: bool[source]

Whether the formula specifies that it is unified.

class CodeDoublingFormula(name, code, coordinate_model, parameters, assumptions, unified=False)[source]

Bases: DoublingFormula, CodeFormula

property assumptions_str[source]
property input_index[source]

Return the starting index where this formula reads its inputs.

property inputs[source]

Return the input variables of the formula.

property num_addsubs: int[source]

Return the number of additions and subtractions.

property num_divisions: int[source]

Return the number of divisions.

num_inputs: ClassVar[int] = 1[source]

Number of inputs (points) of the formula.

property num_inversions: int[source]

Return the number of inversions.

property num_multiplications: int[source]

Return the number of multiplications.

property num_operations: int[source]

Return the number of operations.

num_outputs: ClassVar[int] = 1[source]

Number of outputs (points) of the formula.

property num_powers: int[source]

Return the number of powers.

property num_squarings: int[source]

Return the number of squarings.

property output_index[source]

Return the starting index where this formula stores its outputs.

property outputs[source]

Return the output variables of the formula.

shortname: ClassVar[str] = 'dbl'[source]

A shortname for the type of the formula.

name: str[source]

Name of the formula.

coordinate_model: Any[source]

Coordinate model of the formula.

meta: MutableMapping[str, Any][source]

Meta information about the formula, such as its source.

parameters: List[str][source]

Formula parameters (i.e. new parameters introduced by the formula, like half = 1/2).

assumptions: List[Expression][source]

Assumptions of the formula (e.g. Z1 == 1 or 2*half == 1).

code: List[CodeOp][source]

The collection of ops that constitute the code of the formula.

unified: bool[source]

Whether the formula specifies that it is unified.

class CodeLadderFormula(name, code, coordinate_model, parameters, assumptions, unified=False)[source]

Bases: LadderFormula, CodeFormula

property assumptions_str[source]
property input_index[source]

Return the starting index where this formula reads its inputs.

property inputs[source]

Return the input variables of the formula.

property num_addsubs: int[source]

Return the number of additions and subtractions.

property num_divisions: int[source]

Return the number of divisions.

num_inputs: ClassVar[int] = 3[source]

Number of inputs (points) of the formula.

property num_inversions: int[source]

Return the number of inversions.

property num_multiplications: int[source]

Return the number of multiplications.

property num_operations: int[source]

Return the number of operations.

num_outputs: ClassVar[int] = 2[source]

Number of outputs (points) of the formula.

property num_powers: int[source]

Return the number of powers.

property num_squarings: int[source]

Return the number of squarings.

property output_index[source]

Return the starting index where this formula stores its outputs.

property outputs[source]

Return the output variables of the formula.

shortname: ClassVar[str] = 'ladd'[source]

A shortname for the type of the formula.

name: str[source]

Name of the formula.

coordinate_model: Any[source]

Coordinate model of the formula.

meta: MutableMapping[str, Any][source]

Meta information about the formula, such as its source.

parameters: List[str][source]

Formula parameters (i.e. new parameters introduced by the formula, like half = 1/2).

assumptions: List[Expression][source]

Assumptions of the formula (e.g. Z1 == 1 or 2*half == 1).

code: List[CodeOp][source]

The collection of ops that constitute the code of the formula.

unified: bool[source]

Whether the formula specifies that it is unified.

class CodeTriplingFormula(name, code, coordinate_model, parameters, assumptions, unified=False)[source]

Bases: TriplingFormula, CodeFormula

property assumptions_str[source]
property input_index[source]

Return the starting index where this formula reads its inputs.

property inputs[source]

Return the input variables of the formula.

property num_addsubs: int[source]

Return the number of additions and subtractions.

property num_divisions: int[source]

Return the number of divisions.

num_inputs: ClassVar[int] = 1[source]

Number of inputs (points) of the formula.

property num_inversions: int[source]

Return the number of inversions.

property num_multiplications: int[source]

Return the number of multiplications.

property num_operations: int[source]

Return the number of operations.

num_outputs: ClassVar[int] = 1[source]

Number of outputs (points) of the formula.

property num_powers: int[source]

Return the number of powers.

property num_squarings: int[source]

Return the number of squarings.

property output_index[source]

Return the starting index where this formula stores its outputs.

property outputs[source]

Return the output variables of the formula.

shortname: ClassVar[str] = 'tpl'[source]

A shortname for the type of the formula.

name: str[source]

Name of the formula.

coordinate_model: Any[source]

Coordinate model of the formula.

meta: MutableMapping[str, Any][source]

Meta information about the formula, such as its source.

parameters: List[str][source]

Formula parameters (i.e. new parameters introduced by the formula, like half = 1/2).

assumptions: List[Expression][source]

Assumptions of the formula (e.g. Z1 == 1 or 2*half == 1).

code: List[CodeOp][source]

The collection of ops that constitute the code of the formula.

unified: bool[source]

Whether the formula specifies that it is unified.

class CodeNegationFormula(name, code, coordinate_model, parameters, assumptions, unified=False)[source]

Bases: NegationFormula, CodeFormula

property assumptions_str[source]
property input_index[source]

Return the starting index where this formula reads its inputs.

property inputs[source]

Return the input variables of the formula.

property num_addsubs: int[source]

Return the number of additions and subtractions.

property num_divisions: int[source]

Return the number of divisions.

num_inputs: ClassVar[int] = 1[source]

Number of inputs (points) of the formula.

property num_inversions: int[source]

Return the number of inversions.

property num_multiplications: int[source]

Return the number of multiplications.

property num_operations: int[source]

Return the number of operations.

num_outputs: ClassVar[int] = 1[source]

Number of outputs (points) of the formula.

property num_powers: int[source]

Return the number of powers.

property num_squarings: int[source]

Return the number of squarings.

property output_index[source]

Return the starting index where this formula stores its outputs.

property outputs[source]

Return the output variables of the formula.

shortname: ClassVar[str] = 'neg'[source]

A shortname for the type of the formula.

name: str[source]

Name of the formula.

coordinate_model: Any[source]

Coordinate model of the formula.

meta: MutableMapping[str, Any][source]

Meta information about the formula, such as its source.

parameters: List[str][source]

Formula parameters (i.e. new parameters introduced by the formula, like half = 1/2).

assumptions: List[Expression][source]

Assumptions of the formula (e.g. Z1 == 1 or 2*half == 1).

code: List[CodeOp][source]

The collection of ops that constitute the code of the formula.

unified: bool[source]

Whether the formula specifies that it is unified.

class CodeScalingFormula(name, code, coordinate_model, parameters, assumptions, unified=False)[source]

Bases: ScalingFormula, CodeFormula

property assumptions_str[source]
property input_index[source]

Return the starting index where this formula reads its inputs.

property inputs[source]

Return the input variables of the formula.

property num_addsubs: int[source]

Return the number of additions and subtractions.

property num_divisions: int[source]

Return the number of divisions.

num_inputs: ClassVar[int] = 1[source]

Number of inputs (points) of the formula.

property num_inversions: int[source]

Return the number of inversions.

property num_multiplications: int[source]

Return the number of multiplications.

property num_operations: int[source]

Return the number of operations.

num_outputs: ClassVar[int] = 1[source]

Number of outputs (points) of the formula.

property num_powers: int[source]

Return the number of powers.

property num_squarings: int[source]

Return the number of squarings.

property output_index[source]

Return the starting index where this formula stores its outputs.

property outputs[source]

Return the output variables of the formula.

shortname: ClassVar[str] = 'scl'[source]

A shortname for the type of the formula.

name: str[source]

Name of the formula.

coordinate_model: Any[source]

Coordinate model of the formula.

meta: MutableMapping[str, Any][source]

Meta information about the formula, such as its source.

parameters: List[str][source]

Formula parameters (i.e. new parameters introduced by the formula, like half = 1/2).

assumptions: List[Expression][source]

Assumptions of the formula (e.g. Z1 == 1 or 2*half == 1).

code: List[CodeOp][source]

The collection of ops that constitute the code of the formula.

unified: bool[source]

Whether the formula specifies that it is unified.

class CodeDifferentialAdditionFormula(name, code, coordinate_model, parameters, assumptions, unified=False)[source]

Bases: DifferentialAdditionFormula, CodeFormula

property assumptions_str[source]
property input_index[source]

Return the starting index where this formula reads its inputs.

property inputs[source]

Return the input variables of the formula.

property num_addsubs: int[source]

Return the number of additions and subtractions.

property num_divisions: int[source]

Return the number of divisions.

num_inputs: ClassVar[int] = 3[source]

Number of inputs (points) of the formula.

property num_inversions: int[source]

Return the number of inversions.

property num_multiplications: int[source]

Return the number of multiplications.

property num_operations: int[source]

Return the number of operations.

num_outputs: ClassVar[int] = 1[source]

Number of outputs (points) of the formula.

property num_powers: int[source]

Return the number of powers.

property num_squarings: int[source]

Return the number of squarings.

property output_index[source]

Return the starting index where this formula stores its outputs.

property outputs[source]

Return the output variables of the formula.

shortname: ClassVar[str] = 'dadd'[source]

A shortname for the type of the formula.

name: str[source]

Name of the formula.

coordinate_model: Any[source]

Coordinate model of the formula.

meta: MutableMapping[str, Any][source]

Meta information about the formula, such as its source.

parameters: List[str][source]

Formula parameters (i.e. new parameters introduced by the formula, like half = 1/2).

assumptions: List[Expression][source]

Assumptions of the formula (e.g. Z1 == 1 or 2*half == 1).

code: List[CodeOp][source]

The collection of ops that constitute the code of the formula.

unified: bool[source]

Whether the formula specifies that it is unified.