Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
graph_description_blake2s.test.cpp
Go to the documentation of this file.
8
9using namespace bb;
10using namespace cdg;
16
25TEST(boomerang_stdlib_blake2s, graph_description_single_block_plookup)
26{
28 std::string input = "abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz01";
29 std::vector<uint8_t> input_v(input.begin(), input.end());
30
31 byte_array_ct input_arr(&builder, input_v);
33
35 auto connected_components = graph.find_connected_components();
36 EXPECT_EQ(connected_components.size(), 1);
37 auto variables_in_one_gate = graph.show_variables_in_one_gate(builder);
38 EXPECT_EQ(variables_in_one_gate.size(), 0);
39}
40
50TEST(boomerang_stdlib_blake2s, graph_description_double_block_plookup)
51{
53 std::string input = "abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789";
54 std::vector<uint8_t> input_v(input.begin(), input.end());
55
56 byte_array_ct input_arr(&builder, input_v);
58
59 auto expected = crypto::blake2s(input_v);
60
61 EXPECT_EQ(output.get_value(), std::vector<uint8_t>(expected.begin(), expected.end()));
62
64 auto connected_components = graph.find_connected_components();
65 EXPECT_EQ(connected_components.size(), 1);
66 auto variables_in_one_gate = graph.show_variables_in_one_gate(builder);
67 EXPECT_EQ(variables_in_one_gate.size(), 0);
68}
static byte_array_ct hash(const byte_array_ct &input)
Definition blake2s.cpp:122
Represents a dynamic array of bytes in-circuit.
std::vector< uint8_t > get_value() const
A helper converting a byte_array into the vector of its uint8_t values.
std::unordered_set< uint32_t > show_variables_in_one_gate(bb::UltraCircuitBuilder &ultra_circuit_builder)
this method returns a final set of variables that were in one gate
Definition graph.cpp:1190
std::vector< std::vector< uint32_t > > find_connected_components()
this methond finds all connected components in the graph described by adjacency lists
Definition graph.cpp:794
AluTraceBuilder builder
Definition alu.test.cpp:123
TEST(boomerang_stdlib_blake2s, graph_description_single_block_plookup)
Test graph description for Blake2s hash with single block input.
std::array< uint8_t, BLAKE2S_OUTBYTES > blake2s(std::vector< uint8_t > const &input)
Definition blake2s.cpp:232
Entry point for Barretenberg command-line interface.
UltraCircuitBuilder_< UltraExecutionTraceBlocks > UltraCircuitBuilder
Definition graph.cpp:11
StaticAnalyzer_< bb::fr > StaticAnalyzer
Definition graph.hpp:201