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
5
7 public:
12
13 static constexpr size_t NUM_PUBLIC_INPUTS = 4;
14
15 static Builder generate(uint256_t public_inputs[])
16 {
18
19 // Build byte array from field elements with proper constraints using write() pattern
20 byte_array_ct input_buffer(&builder, std::vector<uint8_t>());
21 for (size_t i = 0; i < NUM_PUBLIC_INPUTS; ++i) {
22 field_ct field_element = public_witness_ct(&builder, public_inputs[i]);
23 // byte_array_ct(field_t) constructor adds range constraints for each byte
24 byte_array_ct field_bytes(field_element);
25 input_buffer.write(field_bytes);
26 }
27
29
30 return builder;
31 }
32};
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.
AluTraceBuilder builder
Definition alu.test.cpp:124
UltraCircuitBuilder_< UltraExecutionTraceBlocks > UltraCircuitBuilder