You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for this great library. A lot of every helpful error code and well designed!
I'm reimplementing scalarMul on babyjubjub using a naive double and add approach.
When I compile my circuit with a for loop doing only one loop (for stops at 2), the circuit compile.
When I compile my circuit with a for loop doing two loops (for stops at 3), the circuit hung forever.
Stop at 2
include "babyjub.circom";
include "bitify.circom";
template babyMul(){
signal input exp;
signal input point[2];
signal output mulPoint[2];
component adder = BabyAdd();
component n2ba = Num2Bits(253);
var R0[2] = [0,1];
var R1[2] = point;
exp <= 2**253;
exp >= 0;
n2ba.in <== exp;
for (var i = 1; i<2; i++) {
if (n2ba.out[253-i] == 1){
R0[0] ==> adder.x1;
R0[1] ==> adder.y1;
R1[0] ==> adder.x2;
R1[1] ==> adder.y2;
adder.xout --> R0[0];
adder.yout --> R0[1];
}
R1[0] ==> adder.x1;
R1[1] ==> adder.y1;
R1[0] ==> adder.x2;
R1[1] ==> adder.y2;
adder.xout --> R1[0];
adder.yout--> R1[1];
}
mulPoint[0] <== R0[0];
mulPoint[1] <== R0[1];
}
component main = babyMul()
Stop at 3
include "babyjub.circom";
include "bitify.circom";
template babyMul(){
signal input exp;
signal input point[2];
signal output mulPoint[2];
component adder = BabyAdd();
component n2ba = Num2Bits(253);
var R0[2] = [0,1];
var R1[2] = point;
exp <= 2**253;
exp >= 0;
n2ba.in <== exp;
for (var i = 1; i<3; i++) {
if (n2ba.out[253-i] == 1){
R0[0] ==> adder.x1;
R0[1] ==> adder.y1;
R1[0] ==> adder.x2;
R1[1] ==> adder.y2;
adder.xout --> R0[0];
adder.yout --> R0[1];
}
R1[0] ==> adder.x1;
R1[1] ==> adder.y1;
R1[0] ==> adder.x2;
R1[1] ==> adder.y2;
adder.xout --> R1[0];
adder.yout--> R1[1];
}
mulPoint[0] <== R0[0];
mulPoint[1] <== R0[1];
}
component main = babyMul()
Have I done something wrong?
Thanks
The text was updated successfully, but these errors were encountered:
Thanks for this great library. A lot of every helpful error code and well designed!
I'm reimplementing scalarMul on babyjubjub using a naive double and add approach.
When I compile my circuit with a for loop doing only one loop (for stops at 2), the circuit compile.
When I compile my circuit with a for loop doing two loops (for stops at 3), the circuit hung forever.
Stop at 2
Stop at 3
Have I done something wrong?
Thanks
The text was updated successfully, but these errors were encountered: