Skip to content
Karel Kubicek edited this page Mar 14, 2017 · 6 revisions

EACirc's circuit backend is fully customizable. Formelly, EACirc allowed also other backends, but now polynomials backend is developed on different GitHub repository Polynomial distinguishers

Circuit

Each circuit is internally represented as an array of nodes with Boolean functions and arrays of their connectors.

Circuit dimensions

Circuit dimensions are hardcoded, but they can be modified as template instantiation. Each layer is internally as long as the longest one.

TODO: describe the code.

circuit dimensions

Memory nodes are not supported in EACirc 4.

Connector layers

TODO: describe connectors

Function layers

The function in node is specified by enum circuit::fn. The remaining 3 bytes are inside-node arguments used if the node needs them (the left-most byte is argument 1, followed by arguments 2 and 3).

Functions in the circuits

The following set of functions is used in circuits. Only a subset may be allowed for particular run, settings are located in the https://github.com/crocs-muni/eacirc/wiki/Configuration-file-(JSON).

  • NOP
    • passes input from first connection uncganged, other connections are ignored
    • default value (if no connections) is 0
  • CONS
    • passes inside-node argument to output
    • all input connections are ignored
  • AND, NAND
    • all input connections are processed
    • default value is 255
  • OR, XOR, NOR
    • all input connections are processed
    • default value is 0
  • NOT, SHIR, SHIL, ROTR, ROTL
    • only the first input is processed, others are ignored
    • bit-shifts and bit-rotations rotate by inside-node argument
    • default value is 0
  • EQ, LT, GT, LEQ, GEQ
    • compare first input to the second input
    • other inputs are ignored
    • false output (default) is 0, true output is 255
  • MASK
    • bitselector based on the mask saved in inside-node argument
    • processes first connection input only, others are ignored
    • default value is 0
  • READ
    • return byte from input layer with index [inside-node argument % sizeInputLayer]
    • all input connections ae ignored
Clone this wiki locally