Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
proof.test.cpp
Go to the documentation of this file.
1
2#include <gtest/gtest.h>
3
5#include "proof.hpp"
6
7using namespace bb;
8
9namespace {
11}
12
17TEST(ProofTest, Basic)
18{
20 using Proof = bb::stdlib::Proof<Builder>;
21 using NativeProof = bb::HonkProof;
22
23 // Create a mock native proof with some random field elements
24 const size_t proof_size = 10;
25 NativeProof native_proof;
26 for (size_t i = 0; i < proof_size; ++i) {
27 native_proof.push_back(fr::random_element(&engine));
28 }
29
30 // Construct a stdlib proof from the native proof
32 Proof proof(builder, native_proof);
33
34 // Verify the sizes match
35 EXPECT_EQ(proof.size(), native_proof.size());
36
37 // Verify the proof returned by get_value() matches the original
38 EXPECT_EQ(proof.get_value(), native_proof);
39}
A simple wrapper around a vector of stdlib field elements representing a proof.
Definition proof.hpp:19
AluTraceBuilder builder
Definition alu.test.cpp:123
numeric::RNG & engine
RNG & get_debug_randomness(bool reset, std::uint_fast64_t seed)
Definition engine.cpp:190
Entry point for Barretenberg command-line interface.
std::vector< fr > HonkProof
Definition proof.hpp:15
TEST(MegaCircuitBuilder, CopyConstructor)
MegaCircuitBuilder_< field< Bn254FrParams > > MegaCircuitBuilder
static field random_element(numeric::RNG *engine=nullptr) noexcept