barretenberg
Loading...
Searching...
No Matches
pedersen.hpp
1#pragma once
2#include "barretenberg/ecc/curves/grumpkin/grumpkin.hpp"
3#include "barretenberg/stdlib/primitives/byte_array/byte_array.hpp"
4#include "barretenberg/stdlib/primitives/field/field.hpp"
5#include "barretenberg/stdlib/primitives/group/cycle_group.hpp"
6
7#include "../../primitives/circuit_builders/circuit_builders.hpp"
8
9namespace proof_system::plonk::stdlib {
10
11using namespace barretenberg;
18template <typename Builder> class pedersen_hash {
19
20 private:
23 using EmbeddedCurve = typename cycle_group<Builder>::Curve;
26
27 public:
28 static field_t hash(const std::vector<field_t>& in, GeneratorContext context = {});
29 // TODO health warnings!
30 static field_t hash_skip_field_validation(const std::vector<field_t>& in, GeneratorContext context = {});
31 static field_t hash_buffer(const stdlib::byte_array<Builder>& input, GeneratorContext context = {});
32};
33
34EXTERN_STDLIB_TYPE(pedersen_hash);
35
36} // namespace proof_system::plonk::stdlib
Definition: byte_array.hpp:9
Definition: field.hpp:10
stdlib class that evaluates in-circuit pedersen hashes, consistent with behavior in crypto::pedersen_...
Definition: pedersen.hpp:18
static field_t hash_buffer(const stdlib::byte_array< Builder > &input, GeneratorContext context={})
Definition: pedersen.cpp:61
constexpr_utils defines some helper methods that perform some stl-equivalent operations but in a cons...
Definition: constexpr_utils.hpp:16
Definition: generator_data.hpp:133