pyecsca.ec.op module

Provides a class for a code operation.

class OpType(num_inputs, op_str)[source]

Bases: Enum

Type of binary and unary operators.

Add = (2, '+')[source]
Sub = (2, '-')[source]
Neg = (1, '-')[source]
Mult = (2, '*')[source]
Div = (2, '/')[source]
Inv = (1, '/')[source]
Sqr = (1, '^')[source]
Pow = (2, '^')[source]
Id = (1, '')[source]
class CodeOp(code)[source]

Bases: object

Operation that can be executed.

result: str[source]

The result variable of the operation (e.g. the r in r = 2*a).

parameters: FrozenSet[str][source]

The parameters used in the operation (e.g. a, b).

variables: FrozenSet[str][source]

The variables used in the operation (e.g. X1, Z2).

constants: FrozenSet[int][source]

The constants used in the operation.

operator: OpType[source]

The operator type that executes in the operation.

compiled: CodeType[source]

The compiled code of the operation.

code: Module[source]

The code of the operation.

property parents: Tuple[str | int][source]