Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
pedersen.cpp
Go to the documentation of this file.
1
#include "
./pedersen.hpp
"
2
#include "
barretenberg/common/serialize.hpp
"
3
#include "
barretenberg/common/throw_or_abort.hpp
"
4
#include <iostream>
5
6
namespace
bb::crypto
{
7
17
template
<
typename
Curve>
18
typename
Curve::AffineElement
pedersen_commitment_base<Curve>::commit_native
(
const
std::vector<Fq>
&
inputs
,
19
const
GeneratorContext
context
)
20
{
21
const
auto
generators =
context
.generators->get(
inputs
.size(),
context
.offset,
context
.domain_separator);
22
Element
result = Group::point_at_infinity;
23
24
for
(
size_t
i = 0; i <
inputs
.size(); ++i) {
25
result +=
Element
(generators[i]) *
static_cast<
uint256_t
>
(
inputs
[i]);
26
}
27
return
result.normalize();
28
}
29
template
class
pedersen_commitment_base<curve::Grumpkin>
;
30
}
// namespace bb::crypto
bb::crypto::pedersen_commitment_base
Performs pedersen commitments!
Definition
pedersen.hpp:21
bb::crypto::pedersen_commitment_base::Element
typename Curve::Element Element
Definition
pedersen.hpp:24
bb::crypto::pedersen_commitment_base::commit_native
static AffineElement commit_native(const std::vector< Fq > &inputs, GeneratorContext context={})
Given a vector of fields, generate a pedersen commitment using the indexed generators.
Definition
pedersen.cpp:18
bb::crypto::pedersen_commitment_base::GeneratorContext
typename crypto::GeneratorContext< Curve > GeneratorContext
Definition
pedersen.hpp:28
bb::curve::Grumpkin::AffineElement
typename Group::affine_element AffineElement
Definition
grumpkin.hpp:63
bb::numeric::uint256_t
Definition
uint256.hpp:32
context
StrictMock< MockContext > context
Definition
data_copy.test.cpp:59
inputs
AvmProvingInputs inputs
Definition
hinting_dbs.test.cpp:45
bb::crypto
Definition
aes128.cpp:158
std::get
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition
tuple.hpp:13
pedersen.hpp
Element
Curve::Element Element
Definition
pippenger.bench.cpp:30
serialize.hpp
throw_or_abort.hpp
src
barretenberg
crypto
pedersen_commitment
pedersen.cpp
Generated by
1.9.8