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 "../../hash/pedersen/pedersen.hpp"
10
11namespace bb::stdlib {
12
25template <typename Builder>
28{
29 const auto base_points = context.generators->get(inputs.size(), context.offset, context.domain_separator);
30
33 for (const auto [scalar, point] : zip_view(inputs, base_points)) {
34 scalars.emplace_back(cycle_scalar::create_from_bn254_scalar(scalar));
35 // Construct circuit-constant cycle_group objects representing the generators
36 points.emplace_back(point);
37 }
38
39 return cycle_group::batch_mul(points, scalars);
40}
41
44
45} // namespace bb::stdlib
cycle_group represents a group Element of the proving system's embedded curve, i.e....
static cycle_group batch_mul(const std::vector< cycle_group > &base_points, const std::vector< BigScalarField > &scalars, GeneratorContext context={})
static cycle_scalar create_from_bn254_scalar(const field_t &_in)
Construct a cycle scalar (grumpkin scalar field element) from a bn254 scalar field element.
In-circuit Pedersen commitment implementation.
Definition pedersen.hpp:19
static cycle_group commit(const std::vector< field_t > &inputs, GeneratorContext context={})
Compute a Pedersen commitment to the provided inputs.
Definition pedersen.cpp:26
StrictMock< MockContext > context
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13