BabyJub Optimization

This commit is contained in:
Jordi Baylina 2018-12-16 08:44:12 +01:00
parent 37edfc1834
commit 6ea1ea718a
No known key found for this signature in database
GPG Key ID: 7480C80C1BE43112

@ -11,7 +11,6 @@ template BabyAdd() {
signal beta;
signal gamma;
signal delta;
signal epsilon;
signal tau;
var a = 168700;
@ -19,15 +18,14 @@ template BabyAdd() {
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() {