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

Unverified claim (C,r,v) for some witness polynomial p(X) such that. More...

#include <claim.hpp>

Public Types

using Builder = std::conditional_t< std::is_same_v< Curve, stdlib::grumpkin< UltraCircuitBuilder > >, UltraCircuitBuilder, void >
 

Public Member Functions

uint32_t set_public ()
 Set the witness indices for the opening claim to public.
 
auto get_native_opening_claim () const
 
bool verify (std::shared_ptr< CK > ck, const bb::Polynomial< Fr > &polynomial) const
 inefficiently check that the claim is correct by recomputing the commitment and evaluating the polynomial in r.
 
bool operator== (const OpeningClaim &other) const =default
 

Static Public Member Functions

static OpeningClaim< Curvereconstruct_from_public (const std::span< const stdlib::field_t< Builder >, PUBLIC_INPUTS_SIZE > &limbs)
 Reconstruct an opening claim from limbs stored on the public inputs.
 
static OpeningClaim< Curvereconstruct_from_public (const std::span< const bb::fr, PUBLIC_INPUTS_SIZE > &limbs)
 Reconstruct a native opening claim from native field elements.
 

Public Attributes

OpeningPair< Curveopening_pair
 
Commitment commitment
 

Static Public Attributes

static constexpr bool IS_GRUMPKIN
 
static constexpr size_t PUBLIC_INPUTS_SIZE = IS_GRUMPKIN ? GRUMPKIN_OPENING_CLAIM_SIZE : INVALID_PUBLIC_INPUTS_SIZE
 

Private Types

using CK = CommitmentKey< Curve >
 
using Commitment = typename Curve::AffineElement
 
using Fr = typename Curve::ScalarField
 

Detailed Description

template<typename Curve>
class bb::OpeningClaim< Curve >

Unverified claim (C,r,v) for some witness polynomial p(X) such that.

  • C = Commit(p(X))
  • p(r) = v
Template Parameters
Paramsfor the given commitment scheme

Definition at line 53 of file claim.hpp.

Member Typedef Documentation

◆ Builder

◆ CK

template<typename Curve >
using bb::OpeningClaim< Curve >::CK = CommitmentKey<Curve>
private

Definition at line 54 of file claim.hpp.

◆ Commitment

template<typename Curve >
using bb::OpeningClaim< Curve >::Commitment = typename Curve::AffineElement
private

Definition at line 55 of file claim.hpp.

◆ Fr

template<typename Curve >
using bb::OpeningClaim< Curve >::Fr = typename Curve::ScalarField
private

Definition at line 56 of file claim.hpp.

Member Function Documentation

◆ get_native_opening_claim()

template<typename Curve >
auto bb::OpeningClaim< Curve >::get_native_opening_claim ( ) const
inline

Definition at line 129 of file claim.hpp.

◆ operator==()

template<typename Curve >
bool bb::OpeningClaim< Curve >::operator== ( const OpeningClaim< Curve > &  other) const
default

◆ reconstruct_from_public() [1/2]

template<typename Curve >
static OpeningClaim< Curve > bb::OpeningClaim< Curve >::reconstruct_from_public ( const std::span< const bb::fr, PUBLIC_INPUTS_SIZE > &  limbs)
inlinestatic

Reconstruct a native opening claim from native field elements.

Note
Implemented for native curve::Grumpkin for use with IPA.

Definition at line 113 of file claim.hpp.

◆ reconstruct_from_public() [2/2]

template<typename Curve >
static OpeningClaim< Curve > bb::OpeningClaim< Curve >::reconstruct_from_public ( const std::span< const stdlib::field_t< Builder >, PUBLIC_INPUTS_SIZE > &  limbs)
inlinestatic

Reconstruct an opening claim from limbs stored on the public inputs.

Note
Implemented only for an opening claim over Grumpkin for use with IPA.

Definition at line 91 of file claim.hpp.

◆ set_public()

template<typename Curve >
uint32_t bb::OpeningClaim< Curve >::set_public ( )
inline

Set the witness indices for the opening claim to public.

Note
Implemented only for an opening claim over Grumpkin for use with IPA.

Definition at line 76 of file claim.hpp.

◆ verify()

template<typename Curve >
bool bb::OpeningClaim< Curve >::verify ( std::shared_ptr< CK ck,
const bb::Polynomial< Fr > &  polynomial 
) const
inline

inefficiently check that the claim is correct by recomputing the commitment and evaluating the polynomial in r.

Parameters
ckCommitmentKey used
polynomialthe claimed witness polynomial p(X)
Returns
C = Commit(p(X)) && p(r) = v

Definition at line 146 of file claim.hpp.

Member Data Documentation

◆ commitment

template<typename Curve >
Commitment bb::OpeningClaim< Curve >::commitment

Definition at line 64 of file claim.hpp.

◆ IS_GRUMPKIN

template<typename Curve >
constexpr bool bb::OpeningClaim< Curve >::IS_GRUMPKIN
staticconstexpr
Initial value:
=
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13

Definition at line 66 of file claim.hpp.

◆ opening_pair

template<typename Curve >
OpeningPair<Curve> bb::OpeningClaim< Curve >::opening_pair

Definition at line 62 of file claim.hpp.

◆ PUBLIC_INPUTS_SIZE

template<typename Curve >
constexpr size_t bb::OpeningClaim< Curve >::PUBLIC_INPUTS_SIZE = IS_GRUMPKIN ? GRUMPKIN_OPENING_CLAIM_SIZE : INVALID_PUBLIC_INPUTS_SIZE
staticconstexpr

Definition at line 69 of file claim.hpp.


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