Skip to content

Commit

Permalink
BabyJub Optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
jbaylina committed Dec 16, 2018
1 parent 37edfc1 commit 6ea1ea7
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions circuits/babyjub.circom
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,21 @@ template BabyAdd() {
signal beta;
signal gamma;
signal delta;
signal epsilon;
signal tau;

var a = 168700;
var d = 168696;

beta <== x1*y2;
gamma <== y1*x2;
delta <== y1*y2;
epsilon <== x1*x2;
tau <== delta * epsilon;
delta <== (-a*x1+y1)*(x2 + y2);
tau <== beta * gamma;

xout <-- (beta + gamma) / (1+ d*tau);
(1+ d*tau) * xout === (beta + gamma);

yout <-- (delta - a * epsilon) / (1-d*tau);
(1-d*tau)*yout === (delta - a * epsilon);
yout <-- (delta + a*beta - gamma) / (1-d*tau);
(1-d*tau)*yout === (delta + a*beta - gamma);
}

template BabyDbl() {
Expand Down

0 comments on commit 6ea1ea7

Please sign in to comment.