barretenberg
Loading...
Searching...
No Matches
src
barretenberg
stdlib
hash
pedersen
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
9
namespace
proof_system::plonk::stdlib {
10
11
using namespace
barretenberg
;
18
template
<
typename
Builder>
class
pedersen_hash
{
19
20
private
:
21
using
field_t
=
stdlib::field_t<Builder>
;
22
using
bool_t
=
stdlib::bool_t<Builder>
;
23
using
EmbeddedCurve =
typename
cycle_group<Builder>::Curve;
24
using
GeneratorContext
=
crypto::GeneratorContext<EmbeddedCurve>
;
25
using
cycle_group
=
stdlib::cycle_group<Builder>
;
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
34
EXTERN_STDLIB_TYPE(
pedersen_hash
);
35
36
}
// namespace proof_system::plonk::stdlib
proof_system::plonk::stdlib::bool_t
Definition:
bool.hpp:7
proof_system::plonk::stdlib::byte_array
Definition:
byte_array.hpp:9
proof_system::plonk::stdlib::cycle_group< Builder >
proof_system::plonk::stdlib::field_t
Definition:
field.hpp:10
proof_system::plonk::stdlib::pedersen_hash
stdlib class that evaluates in-circuit pedersen hashes, consistent with behavior in crypto::pedersen_...
Definition:
pedersen.hpp:18
proof_system::plonk::stdlib::pedersen_hash::hash_buffer
static field_t hash_buffer(const stdlib::byte_array< Builder > &input, GeneratorContext context={})
Definition:
pedersen.cpp:61
barretenberg
constexpr_utils defines some helper methods that perform some stl-equivalent operations but in a cons...
Definition:
constexpr_utils.hpp:16
crypto::GeneratorContext
Definition:
generator_data.hpp:133
Generated by
1.9.6