From 6ea1ea718ac0ce7b6118d7cd867f998d00853c76 Mon Sep 17 00:00:00 2001 From: Jordi Baylina Date: Sun, 16 Dec 2018 08:44:12 +0100 Subject: [PATCH] BabyJub Optimization --- circuits/babyjub.circom | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/circuits/babyjub.circom b/circuits/babyjub.circom index 64b134f..c7cddb1 100644 --- a/circuits/babyjub.circom +++ b/circuits/babyjub.circom @@ -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() {