Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasxia01 committed Nov 25, 2024
1 parent 907cbbd commit 705a5b4
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 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 @@ -1148,7 +1148,7 @@ template <IsUltraFlavor Flavor> bool verify_honk(const std::string& proof_path,
// TODO(https://github.com/AztecProtocol/barretenberg/issues/1154): Remove this and pass in the IPA proof to the
// verifier.
std::shared_ptr<VerifierCommitmentKey<curve::Grumpkin>> ipa_verification_key = nullptr;
if constexpr (HasIPAAccumulatorFlavor<Flavor>) {
if constexpr (HasIPAAccumulator<Flavor>) {
init_grumpkin_crs(1 << 16);
vk->contains_ipa_claim = false;
ipa_verification_key = std::make_shared<VerifierCommitmentKey<curve::Grumpkin>>(1 << CONST_ECCVM_LOG_N);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
namespace acir_format {

using namespace bb;
using namespace bb::stdlib::recursion::honk;
using field_ct = stdlib::field_t<Builder>;
using bn254 = stdlib::bn254<Builder>;
using aggregation_state_ct = bb::stdlib::recursion::aggregation_state<bn254>;
Expand Down Expand Up @@ -209,8 +210,7 @@ PairingPointAccumulatorIndices create_honk_recursion_constraints(
RecursiveVerifier verifier(&builder, vkey);
aggregation_state_ct input_agg_obj = bb::stdlib::recursion::convert_witness_indices_to_agg_obj<Builder, bn254>(
builder, input_aggregation_object_indices);
bb::stdlib::recursion::honk::UltraRecursiveVerifierOutput<Flavor> output =
verifier.verify_proof(proof_fields, input_agg_obj);
UltraRecursiveVerifierOutput<Flavor> output = verifier.verify_proof(proof_fields, input_agg_obj);
// TODO(https://github.com/AztecProtocol/barretenberg/issues/996): investigate whether assert_equal on public inputs
// is important, like what the plonk recursion constraint does.

Expand Down
2 changes: 1 addition & 1 deletion barretenberg/cpp/src/barretenberg/flavor/flavor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ template <typename T>
concept HasDataBus = IsMegaFlavor<T>;

template <typename T>
concept HasIPAAccumulatorFlavor = IsAnyOf<T, UltraRollupFlavor, UltraRollupRecursiveFlavor_<UltraCircuitBuilder>>;
concept HasIPAAccumulator = IsAnyOf<T, UltraRollupFlavor, UltraRollupRecursiveFlavor_<UltraCircuitBuilder>>;

template <typename T>
concept IsRecursiveFlavor = IsAnyOf<T, UltraRecursiveFlavor_<UltraCircuitBuilder>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ UltraRecursiveVerifier_<Flavor>::Output UltraRecursiveVerifier_<Flavor>::verify_

// Extract the IPA claim from the public inputs
// Parse out the nested IPA claim using key->ipa_claim_public_input_indices and runs the native IPA verifier.
if constexpr (HasIPAAccumulatorFlavor<Flavor>) {
if constexpr (HasIPAAccumulator<Flavor>) {
const auto recover_fq_from_public_inputs = [](std::array<FF, 4>& limbs) {
for (size_t k = 0; k < 4; k++) {
for (size_t k = 0; k < Curve::BaseField::NUM_LIMBS; k++) {
limbs[k].create_range_constraint(Curve::BaseField::NUM_LIMB_BITS, "limb_" + std::to_string(k));
}
return Curve::BaseField::unsafe_construct_from_limbs(limbs[0], limbs[1], limbs[2], limbs[3], false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ template <typename BuilderType> class UltraRollupRecursiveFlavor_ : public Ultra
* @return VerificationKey
*/
static VerificationKey from_witness_indices(CircuitBuilder& builder,
const std::span<const uint32_t>& witness_indices)
const std::span<const uint32_t> witness_indices)
{
std::vector<FF> vkey_fields;
vkey_fields.reserve(witness_indices.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ template <IsUltraFlavor Flavor> class DeciderProvingKey_ {
proving_key.public_inputs.emplace_back(proving_key.polynomials.w_r[idx]);
}

if constexpr (HasIPAAccumulatorFlavor<Flavor>) { // Set the IPA claim indices
if constexpr (HasIPAAccumulator<Flavor>) { // Set the IPA claim indices
proving_key.ipa_claim_public_input_indices = circuit.ipa_claim_public_input_indices;
proving_key.contains_ipa_claim = circuit.contains_ipa_claim;
proving_key.ipa_proof = circuit.ipa_proof;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ template <typename Flavor> bool UltraVerifier_<Flavor>::verify_proof(const HonkP
};

// Parse out the nested IPA claim using key->ipa_claim_public_input_indices and runs the native IPA verifier.
if constexpr (HasIPAAccumulatorFlavor<Flavor>) {
if constexpr (HasIPAAccumulator<Flavor>) {
if (verification_key->verification_key->contains_ipa_claim) {
OpeningClaim<curve::Grumpkin> ipa_claim;
std::array<FF, 4> bigfield_limbs;
Expand Down

0 comments on commit 705a5b4

Please sign in to comment.