pyecsca.ec.op module

Provides a class for a code operation.

class pyecsca.ec.op.OpType(num_inputs, op_str)[source]

Bases: Enum

Type of binary and unary operators.

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

Bases: object

Operation that can be executed.

result: str

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

parameters: FrozenSet[str]

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

variables: FrozenSet[str]

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

constants: FrozenSet[int]

The constants used in the operation.

operator: OpType

The operator type that executes in the operation.

compiled: CodeType

The compiled code of the operation.

code: Module

The code of the operation.

property parents: Tuple[str | int]