Kagome
Polkadot Runtime Engine in C++17
kagome::crypto::VRFProvider Class Referenceabstract

#include <vrf_provider.hpp>

Inheritance diagram for kagome::crypto::VRFProvider:
Collaboration diagram for kagome::crypto::VRFProvider:

Public Member Functions

virtual ~VRFProvider ()=default
 
virtual Sr25519Keypair generateKeypair () const =0
 
virtual std::optional< VRFOutputsign (const common::Buffer &msg, const Sr25519Keypair &keypair, const VRFThreshold &threshold) const =0
 
virtual VRFVerifyOutput verify (const common::Buffer &msg, const VRFOutput &output, const Sr25519PublicKey &public_key, const VRFThreshold &threshold) const =0
 
virtual std::optional< VRFOutputsignTranscript (const primitives::Transcript &msg, const Sr25519Keypair &keypair, const VRFThreshold &threshold) const =0
 
virtual std::optional< VRFOutputsignTranscript (const primitives::Transcript &msg, const Sr25519Keypair &keypair) const =0
 
virtual VRFVerifyOutput verifyTranscript (const primitives::Transcript &msg, const VRFOutput &output, const Sr25519PublicKey &public_key, const VRFThreshold &threshold) const =0
 

Detailed Description

SR25519 based verifiable random function implementation

Definition at line 20 of file vrf_provider.hpp.

Constructor & Destructor Documentation

virtual kagome::crypto::VRFProvider::~VRFProvider ( )
virtualdefault

Member Function Documentation

virtual Sr25519Keypair kagome::crypto::VRFProvider::generateKeypair ( ) const
pure virtual

Generates random keypair for signing the message

Implemented in kagome::crypto::VRFProviderImpl.

virtual std::optional<VRFOutput> kagome::crypto::VRFProvider::sign ( const common::Buffer msg,
const Sr25519Keypair keypair,
const VRFThreshold threshold 
) const
pure virtual

Sign message

Parameters
msgusing
keypair.If computed value is less than
thresholdthen return optional containing this value and proof. Otherwise none returned

Implemented in kagome::crypto::VRFProviderImpl.

virtual std::optional<VRFOutput> kagome::crypto::VRFProvider::signTranscript ( const primitives::Transcript msg,
const Sr25519Keypair keypair,
const VRFThreshold threshold 
) const
pure virtual

Sign transcript message

Parameters
msgusing
keypair.If computed value is less than
thresholdthen return optional containing this value and proof. Otherwise none returned

Implemented in kagome::crypto::VRFProviderImpl.

virtual std::optional<VRFOutput> kagome::crypto::VRFProvider::signTranscript ( const primitives::Transcript msg,
const Sr25519Keypair keypair 
) const
pure virtual

Sign transcript message

Parameters
msgusing
keypairwithout any threshold check. Returns proof if no error happened.

Implemented in kagome::crypto::VRFProviderImpl.

virtual VRFVerifyOutput kagome::crypto::VRFProvider::verify ( const common::Buffer msg,
const VRFOutput output,
const Sr25519PublicKey &  public_key,
const VRFThreshold threshold 
) const
pure virtual

Verifies that

Parameters
outputwas derived using
public_keyon
msg

Implemented in kagome::crypto::VRFProviderImpl.

virtual VRFVerifyOutput kagome::crypto::VRFProvider::verifyTranscript ( const primitives::Transcript msg,
const VRFOutput output,
const Sr25519PublicKey &  public_key,
const VRFThreshold threshold 
) const
pure virtual

Verifies that

Parameters
outputwas derived using
public_keyon transcript
msg

Implemented in kagome::crypto::VRFProviderImpl.


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