Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
native_verification_key.test.cpp
Go to the documentation of this file.
11
12#include <gtest/gtest.h>
13
14using namespace bb;
15
16#ifdef STARKNET_GARAGA_FLAVORS
17using FlavorTypes = testing::Types<UltraFlavor,
20 UltraStarknetFlavor,
24#else
26 testing::Types<UltraFlavor, UltraKeccakFlavor, UltraRollupFlavor, MegaFlavor, ECCVMFlavor, TranslatorFlavor>;
27#endif
28
29template <typename Flavor> class NativeVerificationKeyTests : public ::testing::Test {
30 public:
33
35 {
36 if constexpr (IsUltraOrMegaHonk<Flavor>) {
39 if constexpr (HasIPAAccumulator<Flavor>) {
41 } else {
43 }
44 auto prover_instance = std::make_shared<ProverInstance>(builder);
45 return VerificationKey{ prover_instance->get_precomputed() };
46 } else {
47 return VerificationKey();
48 }
49 }
50
51 protected:
53};
55
61{
62 using Flavor = TypeParam;
64
65 VerificationKey vk(TestFixture::create_vk());
66
67 // First method of hashing: using hash().
68 fr vk_hash_1 = vk.hash();
69
70 // Second method of hashing: using hash_with_origin_tagging.
71 // (ECCVM and Translator flavors don't support hash_with_origin_tagging as their VKs are hardcoded)
72 if constexpr (!IsAnyOf<Flavor, ECCVMFlavor, TranslatorFlavor>) {
73 typename Flavor::Transcript transcript;
74 fr vk_hash_2 = vk.hash_with_origin_tagging("", transcript);
75 EXPECT_EQ(vk_hash_1, vk_hash_2);
76 }
77}
78
88{
89 using Flavor = TypeParam;
91
92 VerificationKey vk(TestFixture::create_vk());
93 EXPECT_EQ(vk.to_field_elements().size(), VerificationKey::calc_num_data_types());
94}
typename Flavor::CircuitBuilder Builder
typename Flavor::VerificationKey VerificationKey
Common transcript class for both parties. Stores the data for the current round, as well as the manif...
The verification key is responsible for storing the commitments to the precomputed (non-witnessk) pol...
ECCVMCircuitBuilder CircuitBuilder
A ProverInstance is normally constructed from a finalized circuit and it contains all the information...
static void add_default(Builder &builder)
Add default public inputs when they are not present.
static void add_default(Builder &builder)
Add default public inputs when they are not present.
AluTraceBuilder builder
Definition alu.test.cpp:124
UltraKeccakFlavor::VerificationKey VerificationKey
testing::Types< MegaFlavor, UltraFlavor, UltraZKFlavor, UltraRollupFlavor > FlavorTypes
std::filesystem::path bb_crs_path()
void init_file_crs_factory(const std::filesystem::path &path)
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
TYPED_TEST_SUITE(ShpleminiTest, TestSettings)
TYPED_TEST(ShpleminiTest, CorrectnessOfMultivariateClaimBatching)
VerifierCommitmentKey< Curve > vk
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13