Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add computeLiS0 #13

Open
wants to merge 1 commit into
base: fflonk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion src/fflonk_prover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,16 @@ namespace Fflonk {
// · denominator needed in step 10 and 11 of the verifier
// toInverse.yBatch -> Computed in round5, computeL()

// · denominator needed in the verifier when computing L_i^{S1}(X) and L_i^{S2}(X)
// · denominator needed in the verifier when computing L_i^{S0}(X), L_i^{S1}(X) and L_i^{S2}(X)

for (uint i = 0; i < 8; i++)
{
ss.str("");
ss << "LiS0_" << (i + 1);
toInverse[ss.str()] = computeLiS0(i);
}


for (uint i = 0; i < 4; i++) {
ss.str("");
ss << "LiS1_" << (i + 1);
Expand Down Expand Up @@ -1542,6 +1551,21 @@ namespace Fflonk {
return mulAccumulator;
}

template <typename Engine>
typename Engine::FrElement FflonkProver<Engine>::computeLiS0(u_int32_t i)
{
// Compute L_i^{(S0)}(y)
u_int32_t idx = i;
FrElement den = E.fr.one();
for (uint j = 0; j < 7; j++)
{
idx = (idx + 1) % 8;

den = E.fr.mul(den, E.fr.sub(roots["S0h0"][i], roots["S0h0"][idx]));
}
return den;
}

template<typename Engine>
typename Engine::FrElement FflonkProver<Engine>::computeLiS1(u_int32_t i) {
// Compute L_i^{(S1)}(y)
Expand Down
2 changes: 2 additions & 0 deletions src/fflonk_prover.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ namespace Fflonk {

FrElement getMontgomeryBatchedInverse();

FrElement computeLiS0(u_int32_t i);

FrElement computeLiS1(u_int32_t i);

FrElement computeLiS2(u_int32_t i);
Expand Down