From 51ee688ca1c56efe4c253a2f9f89cb1549a1a2cb Mon Sep 17 00:00:00 2001 From: RogerTaule Date: Fri, 9 Aug 2024 16:47:30 +0200 Subject: [PATCH] Minor cleaning of logs and adding calls to index --- circuits.bn128/stark_verifier.circom.ejs | 1 - circuits.gl/linearhash_gpu.circom | 2 +- circuits.gl/poseidon_constants.circom | 3 +-- circuits.gl/stark_verifier.circom.ejs | 4 +--- index.js | 6 +++++- test/compressor/verifier.circom | 4 +--- 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/circuits.bn128/stark_verifier.circom.ejs b/circuits.bn128/stark_verifier.circom.ejs index c617e951..7f9bb315 100644 --- a/circuits.bn128/stark_verifier.circom.ejs +++ b/circuits.bn128/stark_verifier.circom.ejs @@ -625,7 +625,6 @@ template parallel VerifyFinalPol() { signal lastIFFT[<%- 1 << nLastBits %>][3] <== FFT(<%- nLastBits %>, 1)(finalPol); // Check that the degree of the final polynomial is bounded by the degree defined in the last step of the folding - // This means ?????? in terms of IFFT for (var k= <%- 1 << maxDegBits %>; k< <%- 1 << nLastBits %>; k++) { for (var e=0; e<3; e++) { enable * lastIFFT[k][e] === 0; diff --git a/circuits.gl/linearhash_gpu.circom b/circuits.gl/linearhash_gpu.circom index 4cb36046..39ebf4ae 100644 --- a/circuits.gl/linearhash_gpu.circom +++ b/circuits.gl/linearhash_gpu.circom @@ -78,7 +78,7 @@ template LinearHash(nInputs, eSize) { var totalIn = nInputs*eSize; // Calculate how many batches of 4 elements are needed to fit all the inputs - // If one need less than 8 batches, force batchSize to be 8 so ???? + // If one need less than 8 batches, force batchSize to be 8 var batchSize = (totalIn + 3) \ 4; if (batchSize <8) batchSize=8; diff --git a/circuits.gl/poseidon_constants.circom b/circuits.gl/poseidon_constants.circom index 964072b6..cdb0b393 100644 --- a/circuits.gl/poseidon_constants.circom +++ b/circuits.gl/poseidon_constants.circom @@ -15,8 +15,7 @@ pragma circom 2.1.0; // (16 2 28 13 13 39 18 34 20 17 15 41) // (41 16 2 28 13 13 39 18 34 20 17 15) // (15 41 16 2 28 13 13 39 18 34 20 17) -// This matrix is made by the shifts of the vector (20, 34, 18, 39, 13, 13, 28, 2, 16, 41, 15, 17) in each column. -// Notice that in the first column the 17 is changed by a 25 due to ????? +// This matrix is made by the shifts of the vector (20, 34, 18, 39, 13, 13, 28, 2, 16, 41, 15, 17) in each column except for the first one function MDS(in) { var out[12]; diff --git a/circuits.gl/stark_verifier.circom.ejs b/circuits.gl/stark_verifier.circom.ejs index 54ab6126..d753879c 100644 --- a/circuits.gl/stark_verifier.circom.ejs +++ b/circuits.gl/stark_verifier.circom.ejs @@ -325,7 +325,7 @@ template parallel VerifyFRI<%- index %>(nBitsExt, prevStepBits, currStepBits, ne sx[i] <== sx[i-1] * ( ys[i] * (invroots(prevStepBits -i) -1) +1); } - // Perform an IFFT to obtain the coefficients of the polynomial given s_vals and evaluate it at ?????? + // Perform an IFFT to obtain the coefficients of the polynomial given s_vals and evaluate it signal coefs[1 << step][3] <== FFT(step, 3, 1)(s_vals_curr); signal evalXprime[3] <== [specialX[0] * sx[currStepBits - 1], specialX[1] * sx[currStepBits - 1], specialX[2] * sx[currStepBits - 1]]; signal evalPol[3] <== EvalPol(1 << step)(coefs, evalXprime); @@ -334,7 +334,6 @@ template parallel VerifyFRI<%- index %>(nBitsExt, prevStepBits, currStepBits, ne for(var i = 0; i < nextStep; i++) { keys_lowValues[i] = ys[i + nextStepBits]; } signal lowValues[3] <== TreeSelector(nextStep, 3)(s_vals_next, keys_lowValues); - // Check that ?????? enable * (lowValues[0] - evalPol[0]) === 0; enable * (lowValues[1] - evalPol[1]) === 0; enable * (lowValues[2] - evalPol[2]) === 0; @@ -519,7 +518,6 @@ template parallel VerifyFinalPol<%- index %>() { signal lastIFFT[<%- 1 << nLastBits %>][3] <== FFT(<%- nLastBits %>, 3, 1)(finalPol); // Check that the degree of the final polynomial is bounded by the degree defined in the last step of the folding - // This means ?????? in terms of IFFT for (var k= <%- 1 << maxDegBits %>; k< <%- 1 << nLastBits %>; k++) { for (var e=0; e<3; e++) { enable * lastIFFT[k][e] === 0; diff --git a/index.js b/index.js index 5ceea2c3..5d0b4bc8 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ const F3g = require("./src/helpers/f3g"); - +const { compile, newConstantPolsArray, newCommitPolsArray } = require("pilcom"); module.exports.F3g = new F3g(); module.exports.pil2circom = require("./src/pil2circom.js"); @@ -8,3 +8,7 @@ module.exports.starkGen = require("./src/stark/stark_gen.js"); module.exports.starkVerify = require("./src/stark/stark_verify.js"); module.exports.r1cs2plonk = require("./src/r1cs2plonk"); module.exports.starkInfo = require("./src/stark/stark_info"); + +module.exports.compile = compile; +module.exports.newCommitPolsArray = newCommitPolsArray; +module.exports.newConstantPolsArray = newConstantPolsArray; \ No newline at end of file diff --git a/test/compressor/verifier.circom b/test/compressor/verifier.circom index 4ba3dc06..2d129261 100644 --- a/test/compressor/verifier.circom +++ b/test/compressor/verifier.circom @@ -222,7 +222,7 @@ template parallel VerifyFRI(nBitsExt, prevStepBits, currStepBits, nextStepBits, sx[i] <== sx[i-1] * ( ys[i] * (invroots(prevStepBits -i) -1) +1); } - // Perform an IFFT to obtain the coefficients of the polynomial given s_vals and evaluate it at ?????? + // Perform an IFFT to obtain the coefficients of the polynomial given s_vals and evaluate it signal coefs[1 << step][3] <== FFT(step, 3, 1)(s_vals_curr); signal evalXprime[3] <== [specialX[0] * sx[currStepBits - 1], specialX[1] * sx[currStepBits - 1], specialX[2] * sx[currStepBits - 1]]; signal evalPol[3] <== EvalPol(1 << step)(coefs, evalXprime); @@ -231,7 +231,6 @@ template parallel VerifyFRI(nBitsExt, prevStepBits, currStepBits, nextStepBits, for(var i = 0; i < nextStep; i++) { keys_lowValues[i] = ys[i + nextStepBits]; } signal lowValues[3] <== TreeSelector(nextStep, 3)(s_vals_next, keys_lowValues); - // Check that ?????? enable * (lowValues[0] - evalPol[0]) === 0; enable * (lowValues[1] - evalPol[1]) === 0; enable * (lowValues[2] - evalPol[2]) === 0; @@ -776,7 +775,6 @@ template parallel VerifyFinalPol() { signal lastIFFT[8][3] <== FFT(3, 3, 1)(finalPol); // Check that the degree of the final polynomial is bounded by the degree defined in the last step of the folding - // This means ?????? in terms of IFFT for (var k= 4; k< 8; k++) { for (var e=0; e<3; e++) { enable * lastIFFT[k][e] === 0;