arithmetic-circuits-0.2.0: Arithmetic circuits for zkSNARKs

Safe HaskellNone
LanguageHaskell2010

Circuit.Lang

Description

Surface language

Synopsis

Documentation

c :: f -> Expr Wire f f Source #

Convert constant to expression

add :: Expr Wire f f -> Expr Wire f f -> Expr Wire f f Source #

Binary arithmetic operations on expressions

sub :: Expr Wire f f -> Expr Wire f f -> Expr Wire f f Source #

Binary arithmetic operations on expressions

mul :: Expr Wire f f -> Expr Wire f f -> Expr Wire f f Source #

Binary arithmetic operations on expressions

and_ :: Expr Wire f Bool -> Expr Wire f Bool -> Expr Wire f Bool Source #

Binary logic operations on expressions Have to use underscore or similar to avoid shadowing and and or from Prelude/Protolude.

or_ :: Expr Wire f Bool -> Expr Wire f Bool -> Expr Wire f Bool Source #

Binary logic operations on expressions Have to use underscore or similar to avoid shadowing and and or from Prelude/Protolude.

xor_ :: Expr Wire f Bool -> Expr Wire f Bool -> Expr Wire f Bool Source #

Binary logic operations on expressions Have to use underscore or similar to avoid shadowing and and or from Prelude/Protolude.

not_ :: Expr Wire f Bool -> Expr Wire f Bool Source #

Negate expression

eq :: Expr Wire f f -> Expr Wire f f -> Expr Wire f Bool Source #

Compare two expressions

deref :: Wire -> Expr Wire f f Source #

Convert wire to expression

e :: Num f => Expr Wire f f -> ExprM f Wire Source #

Return compilation of expression into an intermediate wire

cond :: Expr Wire f Bool -> Expr Wire f ty -> Expr Wire f ty -> Expr Wire f ty Source #

Conditional statement on expressions

ret :: Num f => Expr Wire f f -> ExprM f Wire Source #

Return compilation of expression into an output wire