Skip to content

Commit

Permalink
updated function interfaces, bb compilies
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasxia01 committed Jul 23, 2024
1 parent ab0b2bb commit c3be434
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,13 @@ std::array<uint32_t, HonkRecursionConstraint::AGGREGATION_OBJECT_SIZE> create_ho
// Recursively verify the proof
auto vkey = std::make_shared<RecursiveVerificationKey>(builder, key_fields);
RecursiveVerifier verifier(&builder, vkey);
std::array<typename Flavor::GroupElement, 2> pairing_points = verifier.verify_proof(proof_fields);
aggregation_state_ct pairing_points = verifier.verify_proof(proof_fields);

// Aggregate the current aggregation object with these pairing points from verify_proof
// TODO(https://github.com/AztecProtocol/barretenberg/issues/1044): Reinstate aggregation
aggregation_state_ct cur_aggregation_object;
cur_aggregation_object.P0 = pairing_points[0]; // * recursion_separator;
cur_aggregation_object.P1 = pairing_points[1]; // * recursion_separator;
cur_aggregation_object.P0 = pairing_points.P0; // * recursion_separator;
cur_aggregation_object.P1 = pairing_points.P1; // * recursion_separator;

std::vector<uint32_t> proof_witness_indices = {
cur_aggregation_object.P0.x.binary_basis_limbs[0].element.normalize().witness_index,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ UltraRecursiveVerifier_<Flavor>::UltraRecursiveVerifier_(Builder* builder, const
*
*/
template <typename Flavor>
std::array<typename Flavor::GroupElement, 2> UltraRecursiveVerifier_<Flavor>::verify_proof(
UltraRecursiveVerifier_<Flavor>::PairingPoints UltraRecursiveVerifier_<Flavor>::verify_proof(
const HonkProof& proof, const aggregation_state<typename Flavor::Curve>& agg_obj)
{
StdlibProof<Builder> stdlib_proof = bb::convert_proof_to_witness(builder, proof);
Expand All @@ -36,7 +36,7 @@ std::array<typename Flavor::GroupElement, 2> UltraRecursiveVerifier_<Flavor>::ve
*
*/
template <typename Flavor>
std::array<typename Flavor::GroupElement, 2> UltraRecursiveVerifier_<Flavor>::verify_proof(
UltraRecursiveVerifier_<Flavor>::PairingPoints UltraRecursiveVerifier_<Flavor>::verify_proof(
const StdlibProof<Builder>& proof, const aggregation_state<typename Flavor::Curve>& agg_obj)
{
using Sumcheck = ::bb::SumcheckVerifier<Flavor>;
Expand Down Expand Up @@ -68,6 +68,7 @@ std::array<typename Flavor::GroupElement, 2> UltraRecursiveVerifier_<Flavor>::ve
for (size_t i = 0; i < key->num_public_inputs; ++i) {
public_inputs.emplace_back(transcript->template receive_from_prover<FF>("public_input_" + std::to_string(i)));
}
// WORKTODO: parse out the aggregation object here

// Get commitments to first three wire polynomials
commitments.w_l = transcript->template receive_from_prover<Commitment>(commitment_labels.w_l);
Expand Down Expand Up @@ -155,7 +156,9 @@ std::array<typename Flavor::GroupElement, 2> UltraRecursiveVerifier_<Flavor>::ve
transcript);
auto pairing_points = PCS::reduce_verify(opening_claim, transcript);

return pairing_points;
// WORKTODO: aggregate here
static_cast<void>(pairing_points);
return agg_obj;
}

template class UltraRecursiveVerifier_<bb::UltraRecursiveFlavor_<UltraCircuitBuilder>>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ template <typename Flavor> class UltraRecursiveVerifier_ {
using VerifierCommitmentKey = typename Flavor::VerifierCommitmentKey;
using Builder = typename Flavor::CircuitBuilder;
using RelationSeparator = typename Flavor::RelationSeparator;
using PairingPoints = std::array<GroupElement, 2>;
using PairingPoints = aggregation_state<typename Flavor::Curve>;
using Transcript = bb::BaseTranscript<bb::stdlib::recursion::honk::StdlibTranscriptParams<Builder>>;

explicit UltraRecursiveVerifier_(Builder* builder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ template <typename RecursiveFlavor> class RecursiveVerifierTest : public testing
// verifier and check that the result agrees.
InnerVerifier native_verifier(verification_key);
auto native_result = native_verifier.verify_proof(inner_proof);
auto recursive_result = native_verifier.key->pcs_verification_key->pairing_check(pairing_points[0].get_value(),
pairing_points[1].get_value());
auto recursive_result = native_verifier.key->pcs_verification_key->pairing_check(pairing_points.P0.get_value(),
pairing_points.P1.get_value());
EXPECT_EQ(recursive_result, native_result);

// Check 2: Ensure that the underlying native and recursive verification algorithms agree by ensuring
Expand Down

0 comments on commit c3be434

Please sign in to comment.