jancarlsson / snarkfront

a C++ embedded domain specific language for zero knowledge proofs
MIT License
58 stars 12 forks source link

seems missing _as_bigint and _as_field #9

Open huyuguang opened 6 years ago

huyuguang commented 6 years ago

file DSL_base.hpp

define DEFN_TERNARY_SCALAR(T, AS) \

template \ ASTOp<Alg ## T > ternary( \ const AST_Node<Alg_bool>& b, \ const ASTNode<Alg ## T >& x, \ const ASTNode<Alg ## T >& y) \ { \ return ASTOp<Alg ## T >( \ Alg_ ## T ::OpType::ADD, \ new ASTOp<Alg ## T >(Alg_ ## T ::OpType::MUL, \ x, \ as ## AS (b)), \ new ASTOp<Alg ## T >(Alg_ ## T ::OpType::MUL, \ y, \ as ## AS (~b))); \ } \ template \ ASTOp<Alg ## T >* _ternary( \ const AST_Node<Alg_bool>& b, \ const ASTNode<Alg ## T >& x, \ const ASTNode<Alg ## T >& y) \ { \ return new ASTOp<Alg ## T >( \ Alg_ ## T ::OpType::ADD, \ new ASTOp<Alg ## T >(Alg_ ## T ::OpType::MUL, \ x, \ as ## AS (b)), \ new ASTOp<Alg ## T >(Alg_ ## T ::OpType::MUL, \ y, \ as ## AS (~b))); \ }

DEFN_TERNARY_SCALAR(BigInt, bigint)
DEFN_TERNARY_SCALAR(Field, field)

undef DEFN_TERNARY_SCALAR

the _as_bigint and _as_field missing.