barretenberg
Loading...
Searching...
No Matches
sha256_constraint.hpp
1#pragma once
2#include "barretenberg/dsl/types.hpp"
3#include "barretenberg/serialize/msgpack.hpp"
4#include <cstdint>
5#include <vector>
6
7namespace acir_format {
8
9struct Sha256Input {
10 uint32_t witness;
11 uint32_t num_bits;
12
13 friend bool operator==(Sha256Input const& lhs, Sha256Input const& rhs) = default;
14 // for serialization, update with any new fields
15 MSGPACK_FIELDS(witness, num_bits);
16};
17
19 std::vector<Sha256Input> inputs;
20 std::vector<uint32_t> result;
21
22 friend bool operator==(Sha256Constraint const& lhs, Sha256Constraint const& rhs) = default;
23 // for serialization, update with any new fields
24 MSGPACK_FIELDS(inputs, result);
25};
26
27// This function does not work (properly) because the stdlib:sha256 function is not working correctly for 512 bits
28// pair<witness_index, bits>
29template <typename Builder> void create_sha256_constraints(Builder& builder, const Sha256Constraint& constraint);
30} // namespace acir_format
Definition: ultra_circuit_builder.hpp:31
Definition: sha256_constraint.hpp:18
Definition: sha256_constraint.hpp:9