Fix r1cs to plonk conversion constant

This commit is contained in:
Jordi Baylina 2021-06-01 13:59:20 +02:00
parent b46673e852
commit 0e30aed112
No known key found for this signature in database
GPG Key ID: 7480C80C1BE43112
5 changed files with 10 additions and 10 deletions

@ -6051,7 +6051,7 @@ async function plonkSetup(r1csName, ptauName, zkeyName, logger) {
const domainSize = 2 ** cirPower;
if (cirPower > power) {
if (logger) logger.error(`circuit too big for this power of tau ceremony. ${r1cs.nConstraints}*2 > 2**${power}`);
if (logger) logger.error(`circuit too big for this power of tau ceremony. ${plonkConstraints.length}*2 > 2**${power}`);
return -1;
}
@ -6196,7 +6196,7 @@ async function plonkSetup(r1csName, ptauName, zkeyName, logger) {
const ql = curve.Fr.mul(A.coef, B.k);
const qr = curve.Fr.mul(A.k, B.coef);
const qo = curve.Fr.neg(C.coef);
const qc = curve.Fr.neg(C.k);
const qc = curve.Fr.sub(curve.Fr.mul(A.k, B.k) , C.k);
plonkConstraints.push([sl, sr, so, qm, ql, qr, qo, qc]);
}

@ -6008,7 +6008,7 @@ async function plonkSetup(r1csName, ptauName, zkeyName, logger) {
const domainSize = 2 ** cirPower;
if (cirPower > power) {
if (logger) logger.error(`circuit too big for this power of tau ceremony. ${r1cs.nConstraints}*2 > 2**${power}`);
if (logger) logger.error(`circuit too big for this power of tau ceremony. ${plonkConstraints.length}*2 > 2**${power}`);
return -1;
}
@ -6153,7 +6153,7 @@ async function plonkSetup(r1csName, ptauName, zkeyName, logger) {
const ql = curve.Fr.mul(A.coef, B.k);
const qr = curve.Fr.mul(A.k, B.coef);
const qo = curve.Fr.neg(C.coef);
const qc = curve.Fr.neg(C.k);
const qc = curve.Fr.sub(curve.Fr.mul(A.k, B.k) , C.k);
plonkConstraints.push([sl, sr, so, qm, ql, qr, qo, qc]);
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -73,7 +73,7 @@ export default async function plonkSetup(r1csName, ptauName, zkeyName, logger) {
const domainSize = 2 ** cirPower;
if (cirPower > power) {
if (logger) logger.error(`circuit too big for this power of tau ceremony. ${r1cs.nConstraints}*2 > 2**${power}`);
if (logger) logger.error(`circuit too big for this power of tau ceremony. ${plonkConstraints.length}*2 > 2**${power}`);
return -1;
}
@ -218,7 +218,7 @@ export default async function plonkSetup(r1csName, ptauName, zkeyName, logger) {
const ql = curve.Fr.mul(A.coef, B.k);
const qr = curve.Fr.mul(A.k, B.coef);
const qo = curve.Fr.neg(C.coef);
const qc = curve.Fr.neg(C.k);
const qc = curve.Fr.sub(curve.Fr.mul(A.k, B.k) , C.k);
plonkConstraints.push([sl, sr, so, qm, ql, qr, qo, qc]);
}