Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::crypto::pedersen_commitment_base< Curve > Class Template Reference

Performs pedersen commitments! More...

#include <pedersen.hpp>

Public Types

using AffineElement = typename Curve::AffineElement
 
using Element = typename Curve::Element
 
using Fr = typename Curve::ScalarField
 
using Fq = typename Curve::BaseField
 
using Group = typename Curve::Group
 
using GeneratorContext = typename crypto::GeneratorContext< Curve >
 

Static Public Member Functions

static AffineElement commit_native (const std::vector< Fq > &inputs, GeneratorContext context={})
 Given a vector of fields, generate a pedersen commitment using the indexed generators.
 

Detailed Description

template<typename Curve>
class bb::crypto::pedersen_commitment_base< Curve >

Performs pedersen commitments!

To commit to a size-n list of field elements x, a commitment is defined as:

 Commit(x) = x[0].g[0] + x[1].g[1] + ... + x[n-1].g[n-1]

Where g is a list of generator points defined by generator_data

Definition at line 27 of file pedersen.hpp.

Member Typedef Documentation

◆ AffineElement

template<typename Curve >
using bb::crypto::pedersen_commitment_base< Curve >::AffineElement = typename Curve::AffineElement

Definition at line 29 of file pedersen.hpp.

◆ Element

Definition at line 30 of file pedersen.hpp.

◆ Fq

template<typename Curve >
using bb::crypto::pedersen_commitment_base< Curve >::Fq = typename Curve::BaseField

Definition at line 32 of file pedersen.hpp.

◆ Fr

Definition at line 31 of file pedersen.hpp.

◆ GeneratorContext

template<typename Curve >
using bb::crypto::pedersen_commitment_base< Curve >::GeneratorContext = typename crypto::GeneratorContext<Curve>

Definition at line 34 of file pedersen.hpp.

◆ Group

template<typename Curve >
using bb::crypto::pedersen_commitment_base< Curve >::Group = typename Curve::Group

Definition at line 33 of file pedersen.hpp.

Member Function Documentation

◆ commit_native()

template<typename Curve >
Curve::AffineElement bb::crypto::pedersen_commitment_base< Curve >::commit_native ( const std::vector< Fq > &  inputs,
GeneratorContext  context = {} 
)
static

Given a vector of fields, generate a pedersen commitment using the indexed generators.

This method uses Curve::BaseField members as inputs. This aligns with what we expect when creating grumpkin commitments to field elements inside a BN254 SNARK circuit.

Parameters
inputs
context
Returns
Curve::AffineElement

Definition at line 24 of file pedersen.cpp.


The documentation for this class was generated from the following files: