Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
blake_circuit.hpp
Go to the documentation of this file.
1#pragma once
6
8 public:
14
15 static constexpr size_t NUM_PUBLIC_INPUTS = 4;
16
17 static Builder generate(uint256_t public_inputs[])
18 {
20
21 // Build byte array from field elements with proper constraints using write() pattern
22 byte_array_ct input_buffer(&builder, std::vector<uint8_t>());
23 for (size_t i = 0; i < NUM_PUBLIC_INPUTS; ++i) {
24 field_ct field_element = public_witness_ct(&builder, public_inputs[i]);
25 // byte_array_ct(field_t) constructor adds range constraints for each byte
26 byte_array_ct field_bytes(field_element);
27 input_buffer.write(field_bytes);
28 }
29
31
33
34 return builder;
35 }
36};
static Builder generate(uint256_t public_inputs[])
bb::stdlib::public_witness_t< Builder > public_witness_ct
static constexpr size_t NUM_PUBLIC_INPUTS
static byte_array_ct hash(const byte_array_ct &input)
Definition blake2s.cpp:133
Represents a dynamic array of bytes in-circuit.
byte_array & write(byte_array const &other)
Appends the contents of another byte_array (other) to the end of this one.
Manages the data that is propagated on the public inputs of an application/function circuit.
static void add_default(Builder &builder)
Add default public inputs when they are not present.
AluTraceBuilder builder
Definition alu.test.cpp:124
UltraCircuitBuilder_< UltraExecutionTraceBlocks > UltraCircuitBuilder