iden3 / circom_old

Circuit compiler for zkSNARKs
GNU General Public License v3.0
471 stars 82 forks source link

Implementing exponential circuit in circom #25

Closed vaibhavsingh1993 closed 5 years ago

vaibhavsingh1993 commented 5 years ago

Hi, I was playing around with circom and snarkjs, and am confused about the circom circuit for exponents. Seems like something of the form: out <== input_a**input_b; throws the error: TypeError: Cannot read property 'value' of undefined

I am not sure if that is expected. Also, if this is expected, is there a different way to implement an exponent circuit in circom?

jbaylina commented 5 years ago

Exponents can only be used in assignmets. r <-- a**b The double arrow implies a constraint and this can only be a quadratic expression.