Skip to content

sgns::crypto::VRFProviderImpl

#include <vrf_provider_impl.hpp>

Inherits from sgns::crypto::VRFProvider, IComponent

Public Functions

Name
VRFProviderImpl(std::shared_ptr< CSPRNG > generator)
~VRFProviderImpl() override =default
virtual SR25519Keypair generateKeypair() const override
virtual boost::optional< VRFOutput > sign(const base::Buffer & msg, const SR25519Keypair & keypair, const VRFThreshold & threshold) const override
Sign message using the given keypair and threshold.
virtual VRFVerifyOutput verify(const base::Buffer & msg, const VRFOutput & output, const SR25519PublicKey & public_key, const VRFThreshold & threshold) const override
Verify VRF output against message and public key.
virtual std::string GetName() override

Additional inherited members

Public Functions inherited from sgns::crypto::VRFProvider

Name
~VRFProvider() override =default

Public Functions inherited from IComponent

Name
virtual ~IComponent() =default

Public Functions Documentation

function VRFProviderImpl

explicit VRFProviderImpl(
    std::shared_ptr< CSPRNG > generator
)

function ~VRFProviderImpl

~VRFProviderImpl() override =default

function generateKeypair

virtual SR25519Keypair generateKeypair() const override

Reimplements: sgns::crypto::VRFProvider::generateKeypair

Generates random keypair for signing the message

function sign

virtual boost::optional< VRFOutput > sign(
    const base::Buffer & msg,
    const SR25519Keypair & keypair,
    const VRFThreshold & threshold
) const override

Sign message using the given keypair and threshold.

Parameters:

  • msg Message bytes.
  • keypair SR25519 keypair.
  • threshold VRF threshold.

Return: Optional VRF output if threshold satisfied.

Reimplements: sgns::crypto::VRFProvider::sign

function verify

virtual VRFVerifyOutput verify(
    const base::Buffer & msg,
    const VRFOutput & output,
    const SR25519PublicKey & public_key,
    const VRFThreshold & threshold
) const override

Verify VRF output against message and public key.

Parameters:

  • msg Message bytes.
  • output VRF output to verify.
  • public_key Public key to verify against.
  • threshold VRF threshold.

Return: Verification output.

Reimplements: sgns::crypto::VRFProvider::verify

function GetName

inline virtual std::string GetName() override

Reimplements: IComponent::GetName


Updated on 2026-03-04 at 13:10:43 -0800