Skip to content

Commit

Permalink
prove_then_verify_client_ivc passes on fold_basic
Browse files Browse the repository at this point in the history
  • Loading branch information
codygunton committed Jul 11, 2024
1 parent 9548239 commit bf779d3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion barretenberg/cpp/src/barretenberg/bb/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,6 @@ bool verify_client_ivc(const std::filesystem::path& proof_path,
const std::filesystem::path& eccvm_vk_path,
const std::filesystem::path& translator_vk_path)
{
info("CRS path is ", CRS_PATH);
init_bn254_crs(1 << 24);
init_grumpkin_crs(1 << 14);

Expand All @@ -430,6 +429,7 @@ bool verify_client_ivc(const std::filesystem::path& proof_path,
const auto eccvm_vk = read_to_shared_ptr<ECCVMFlavor::VerificationKey>(eccvm_vk_path);
eccvm_vk->pcs_verification_key = std::make_shared<GrumpkinVk>(eccvm_vk->circuit_size + 1);
const auto translator_vk = read_to_shared_ptr<TranslatorFlavor::VerificationKey>(translator_vk_path);
translator_vk->pcs_verification_key = std::make_shared<BN254Vk>();

const bool verified = ClientIVC::verify(
proof, accumulator, std::make_shared<ClientIVC::VerifierInstance>(final_vk), eccvm_vk, translator_vk);
Expand Down
3 changes: 1 addition & 2 deletions barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ bool ClientIVC::verify(const Proof& proof,
{
// Goblin verification (merge, eccvm, translator)
GoblinVerifier goblin_verifier{ eccvm_vk, translator_vk };
(void)goblin_verifier;
bool goblin_verified(true) /* = goblin_verifier.verify(proof.goblin_proof) */;
bool goblin_verified = goblin_verifier.verify(proof.goblin_proof);

// Decider verification
ClientIVC::FoldingVerifier folding_verifier({ accumulator, final_verifier_instance });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -691,8 +691,22 @@ template <typename Curve> class ZeroMorphVerifier_ {
* @brief Utility for native batch multiplication of group elements
* @note This is used only for native verification and is not optimized for efficiency
*/
static Commitment batch_mul_native(const std::vector<Commitment>& points, const std::vector<FF>& scalars)
static Commitment batch_mul_native(const std::vector<Commitment>& _points, const std::vector<FF>& _scalars)
{
std::vector<Commitment> points;
std::vector<FF> scalars;
for (auto [point, scalar] : zip_view(_points, _scalars)) {
if (!scalar.is_zero() && !point.is_point_at_infinity() &&
!point.y.is_zero() /* WORKTODO: second oo condition */) {
points.emplace_back(point);
scalars.emplace_back(scalar);
}
}

if (points.empty()) {
return Commitment::infinity();
}

auto result = points[0] * scalars[0];
for (size_t idx = 1; idx < scalars.size(); ++idx) {
result = result + points[idx] * scalars[idx];
Expand Down

0 comments on commit bf779d3

Please sign in to comment.