Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::crypto::SchnorrProofOfPossession< G1, Hash > Struct Template Reference

A proof of possession is a Schnorr proof of knowledge of a secret key corresponding to a given public key. More...

#include <proof_of_possession.hpp>

Public Types

using Fq = typename G1::Fq
 
using Fr = typename G1::Fr
 
using affine_element = typename G1::affine_element
 
using element = typename G1::element
 
using key_pair = crypto::schnorr_key_pair< Fr, G1 >
 

Public Member Functions

 SchnorrProofOfPossession ()=default
 
 SchnorrProofOfPossession (const key_pair &account)
 Create a new proof of possession for a given account.
 
bool verify (const affine_element &public_key) const
 verifies that an unserialized signature is valid
 

Public Attributes

std::array< uint8_t, 32 > challenge
 
Fr response = Fr::zero()
 

Static Private Member Functions

static auto generate_challenge (const affine_element &public_key, const affine_element &R)
 Generate the Fiat-Shamir challenge e = H_reg(G,X,X,R)
 

Detailed Description

template<typename G1, typename Hash>
struct bb::crypto::SchnorrProofOfPossession< G1, Hash >

A proof of possession is a Schnorr proof of knowledge of a secret key corresponding to a given public key.

This implementation follows the specification detailed in https://eprint.iacr.org/2021/1375.pdf

Template Parameters
G1group over which the key pair was generated
Hashfunction used to derive the Fiat-Shamir challenge

Definition at line 24 of file proof_of_possession.hpp.

Member Typedef Documentation

◆ affine_element

template<typename G1 , typename Hash >
using bb::crypto::SchnorrProofOfPossession< G1, Hash >::affine_element = typename G1::affine_element

Definition at line 27 of file proof_of_possession.hpp.

◆ element

template<typename G1 , typename Hash >
using bb::crypto::SchnorrProofOfPossession< G1, Hash >::element = typename G1::element

Definition at line 28 of file proof_of_possession.hpp.

◆ Fq

template<typename G1 , typename Hash >
using bb::crypto::SchnorrProofOfPossession< G1, Hash >::Fq = typename G1::Fq

Definition at line 25 of file proof_of_possession.hpp.

◆ Fr

template<typename G1 , typename Hash >
using bb::crypto::SchnorrProofOfPossession< G1, Hash >::Fr = typename G1::Fr

Definition at line 26 of file proof_of_possession.hpp.

◆ key_pair

template<typename G1 , typename Hash >
using bb::crypto::SchnorrProofOfPossession< G1, Hash >::key_pair = crypto::schnorr_key_pair<Fr, G1>

Definition at line 29 of file proof_of_possession.hpp.

Constructor & Destructor Documentation

◆ SchnorrProofOfPossession() [1/2]

template<typename G1 , typename Hash >
bb::crypto::SchnorrProofOfPossession< G1, Hash >::SchnorrProofOfPossession ( )
default

◆ SchnorrProofOfPossession() [2/2]

template<typename G1 , typename Hash >
bb::crypto::SchnorrProofOfPossession< G1, Hash >::SchnorrProofOfPossession ( const key_pair account)
inline

Create a new proof of possession for a given account.

Warning
Proofs are not deterministic.
Parameters
accounta key_pair (secret_key, public_key)

Definition at line 46 of file proof_of_possession.hpp.

Member Function Documentation

◆ generate_challenge()

template<typename G1 , typename Hash >
static auto bb::crypto::SchnorrProofOfPossession< G1, Hash >::generate_challenge ( const affine_element public_key,
const affine_element R 
)
inlinestaticprivate

Generate the Fiat-Shamir challenge e = H_reg(G,X,X,R)

Parameters
public_keyX = secret_key•G
Rthe commitment R = k•G
Returns
e = H_reg(X,X,R)

Definition at line 103 of file proof_of_possession.hpp.

◆ verify()

template<typename G1 , typename Hash >
bool bb::crypto::SchnorrProofOfPossession< G1, Hash >::verify ( const affine_element public_key) const
inline

verifies that an unserialized signature is valid

Parameters
public_keythe public key for which this proof is intended
Returns
whether the proof is correct

Definition at line 75 of file proof_of_possession.hpp.

Member Data Documentation

◆ challenge

template<typename G1 , typename Hash >
std::array<uint8_t, 32> bb::crypto::SchnorrProofOfPossession< G1, Hash >::challenge

Definition at line 32 of file proof_of_possession.hpp.

◆ response

template<typename G1 , typename Hash >
Fr bb::crypto::SchnorrProofOfPossession< G1, Hash >::response = Fr::zero()

Definition at line 34 of file proof_of_possession.hpp.


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