Skip to content

Commit

Permalink
Minor cleaning of logs and adding calls to index
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerTaule committed Aug 9, 2024
1 parent 94830e1 commit 51ee688
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 11 deletions.
1 change: 0 additions & 1 deletion circuits.bn128/stark_verifier.circom.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion circuits.gl/linearhash_gpu.circom
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 1 addition & 2 deletions circuits.gl/poseidon_constants.circom
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
4 changes: 1 addition & 3 deletions circuits.gl/stark_verifier.circom.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -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");
Expand All @@ -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;
4 changes: 1 addition & 3 deletions test/compressor/verifier.circom
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 51ee688

Please sign in to comment.