Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
pedersen.cpp
Go to the documentation of this file.
1
// === AUDIT STATUS ===
2
// internal: { status: not started, auditors: [], date: YYYY-MM-DD }
3
// external_1: { status: not started, auditors: [], date: YYYY-MM-DD }
4
// external_2: { status: not started, auditors: [], date: YYYY-MM-DD }
5
// =====================
6
7
#include "
./pedersen.hpp
"
8
#include "
barretenberg/common/serialize.hpp
"
9
#include "
barretenberg/common/throw_or_abort.hpp
"
10
#include <iostream>
11
12
namespace
bb::crypto
{
13
23
template
<
typename
Curve>
24
typename
Curve::AffineElement
pedersen_commitment_base<Curve>::commit_native
(
const
std::vector<Fq>
& inputs,
25
const
GeneratorContext
context
)
26
{
27
const
auto
generators =
context
.generators->get(inputs.size(),
context
.offset,
context
.domain_separator);
28
Element
result = Group::point_at_infinity;
29
30
for
(
size_t
i = 0; i < inputs.size(); ++i) {
31
result +=
Element
(generators[i]) *
static_cast<
uint256_t
>
(inputs[i]);
32
}
33
return
result.normalize();
34
}
35
template
class
pedersen_commitment_base<curve::Grumpkin>
;
36
}
// namespace bb::crypto
bb::crypto::pedersen_commitment_base
Performs pedersen commitments!
Definition
pedersen.hpp:27
bb::crypto::pedersen_commitment_base::Element
typename Curve::Element Element
Definition
pedersen.hpp:30
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:24
bb::crypto::pedersen_commitment_base::GeneratorContext
typename crypto::GeneratorContext< Curve > GeneratorContext
Definition
pedersen.hpp:34
bb::curve::Grumpkin::AffineElement
typename Group::affine_element AffineElement
Definition
grumpkin.hpp:56
bb::numeric::uint256_t
Definition
uint256.hpp:32
context
StrictMock< MockContext > context
Definition
data_copy.test.cpp:55
bb::crypto
Definition
aes128.cpp:158
std::get
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition
tuple.hpp:13
Element
Curve::Element Element
Definition
pippenger.bench.cpp:30
serialize.hpp
pedersen.hpp
throw_or_abort.hpp
src
barretenberg
crypto
pedersen_commitment
pedersen.cpp
Generated by
1.9.8