Skip to content

Commit

Permalink
increase N_max
Browse files Browse the repository at this point in the history
  • Loading branch information
maramihali committed May 15, 2024
1 parent 95c6b4a commit bfbe828
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ template <typename PCS> class ZeroMorphProver_ {

// TODO(#742): Set this N_max to be the number of G1 elements in the mocked zeromorph SRS once it's in place.
// (Then, eventually, set it based on the real SRS). For now we set it to be large but more or less arbitrary.
static const size_t N_max = 1 << 22;
static const size_t N_max = 1 << 23;

public:
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,40 +131,41 @@ template <class VerifierInstances> class ProtoGalaxyRecursiveVerifier_ {
* Specifically, at some point in the algorithm we compute the difference between the points which, if they are
* equal, would be zero, case that is not supported. See https://github.com/AztecProtocol/barretenberg/issues/971.
*/
void fold_commitments(std::vector<FF> lagranges,
VerifierInstances& instances,
std::shared_ptr<Instance>& accumulator)
requires IsUltraBuilder<Builder>
{
using ElementNative = typename Flavor::Curve::ElementNative;
using AffineElementNative = typename Flavor::Curve::AffineElementNative;

auto offset_generator = Commitment::from_witness(builder, AffineElementNative(ElementNative::random_element()));

size_t vk_idx = 0;
for (auto& expected_vk : accumulator->verification_key->get_all()) {
expected_vk = offset_generator;
size_t inst = 0;
for (auto& instance : instances) {
expected_vk += instance->verification_key->get_all()[vk_idx] * lagranges[inst];
inst++;
}
expected_vk -= offset_generator;
vk_idx++;
}

size_t comm_idx = 0;
for (auto& comm : accumulator->witness_commitments.get_all()) {
comm = offset_generator;
size_t inst = 0;
for (auto& instance : instances) {
comm += instance->witness_commitments.get_all()[comm_idx] * lagranges[inst];
inst++;
}
comm -= offset_generator;
comm_idx++;
}
}
// void fold_commitments(std::vector<FF> lagranges,
// VerifierInstances& instances,
// std::shared_ptr<Instance>& accumulator)
// requires IsUltraBuilder<Builder>
// {
// using ElementNative = typename Flavor::Curve::ElementNative;
// using AffineElementNative = typename Flavor::Curve::AffineElementNative;

// auto offset_generator = Commitment::from_witness(builder,
// AffineElementNative(ElementNative::random_element()));

// size_t vk_idx = 0;
// for (auto& expected_vk : accumulator->verification_key->get_all()) {
// expected_vk = offset_generator;
// size_t inst = 0;
// for (auto& instance : instances) {
// expected_vk += instance->verification_key->get_all()[vk_idx] * lagranges[inst];
// inst++;
// }
// expected_vk -= offset_generator;
// vk_idx++;
// }

// size_t comm_idx = 0;
// for (auto& comm : accumulator->witness_commitments.get_all()) {
// comm = offset_generator;
// size_t inst = 0;
// for (auto& instance : instances) {
// comm += instance->witness_commitments.get_all()[comm_idx] * lagranges[inst];
// inst++;
// }
// comm -= offset_generator;
// comm_idx++;
// }
// }

/**
* @brief Folds the witness commitments and verification key (part of ϕ) and stores the values in the accumulator.
Expand All @@ -175,7 +176,6 @@ template <class VerifierInstances> class ProtoGalaxyRecursiveVerifier_ {
void fold_commitments(std::vector<FF> lagranges,
VerifierInstances& instances,
std::shared_ptr<Instance>& accumulator)
requires(!IsUltraBuilder<Builder>)
{
size_t vk_idx = 0;
for (auto& expected_vk : accumulator->verification_key->get_all()) {
Expand Down

0 comments on commit bfbe828

Please sign in to comment.