A fast circuit compiler that can seamlessly integrate with existing Julia code and can incrementally build up logic gate expressions and regenerate optimized circuits after substitutions and manipulations using standard Julia functions. A number of common logical transformations are also supported. To test, see SHA256.jl for SHA-2 implementation which can be compiled to a circuit and functionally encrypted or transformed to conjunctive normal form for obfuscation for simplification.
Additionally, interoperable with circuits in the widely-used Bristol format (see bristol.jl).
- Tseytin transformation to Conjunctive Normal Form
- Intra-clause variable de-duplication
- Dead variable removal
- Circuit randomization
using Gates
using CNFs
import SHA256: sha256
a = SymbolicInteger{64}(:a)
circuit = sha256([a])
@show cnfs = CNF.(circuit.bits)
@show simplify!.(cnfs)
@show substitue(circuit, a=0x010101)