pyecsca.ec.formula.fliparoo module

Provides a way to Fliparoo formulas.

class Fliparoo(chain, graph)[source]

Bases: object

Fliparoo is a chain of nodes N1->N2->…->Nk in FormulaGraph for k>=2 such that:
  • All Ni are * or All Ni are +/-

  • For every Ni, except for Nk, the only outgoing node is Ni+1

  • Neither of N1,…,Nk-1 is an output node

nodes: List[CodeOpNode][source]
graph: FormulaGraph[source]
operator: Optional[OpType][source]
verify_chain(nodes)[source]
property first[source]
property last[source]
previous(node)[source]
Return type:

Optional[CodeOpNode]

deepcopy()[source]
input_nodes()[source]
Return type:

List[Node]

slice(i, j)[source]
class MulFliparoo(chain, graph)[source]

Bases: Fliparoo

operator: Optional[OpType][source]
deepcopy()[source]
property first[source]
input_nodes()[source]
Return type:

List[Node]

property last[source]
previous(node)[source]
Return type:

Optional[CodeOpNode]

slice(i, j)[source]
verify_chain(nodes)[source]
nodes: List[CodeOpNode][source]
graph: FormulaGraph[source]
class AddSubFliparoo(chain, graph)[source]

Bases: Fliparoo

deepcopy()[source]
property first[source]
input_nodes()[source]
Return type:

List[Node]

property last[source]
previous(node)[source]
Return type:

Optional[CodeOpNode]

slice(i, j)[source]
verify_chain(nodes)[source]
nodes: List[CodeOpNode][source]
graph: FormulaGraph[source]
operator: Optional[OpType][source]
class AddFliparoo(chain, graph)[source]

Bases: Fliparoo

operator: Optional[OpType][source]
deepcopy()[source]
property first[source]
input_nodes()[source]
Return type:

List[Node]

property last[source]
previous(node)[source]
Return type:

Optional[CodeOpNode]

slice(i, j)[source]
verify_chain(nodes)[source]
nodes: List[CodeOpNode][source]
graph: FormulaGraph[source]
exception BadFliparoo[source]

Bases: Exception

add_note()[source]

Exception.add_note(note) – add a note to the exception

args[source]
with_traceback()[source]

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

generate_fliparood_formulas(formula, rename=True)[source]
Return type:

Iterator[CodeFormula]

recursive_fliparoo(formula, depth=2)[source]
Return type:

List[Formula]