sgns::crypto::VRFProvider¶
#include <vrf_provider.hpp>
Inherits from IComponent
Inherited by sgns::crypto::VRFProviderImpl
Public Functions¶
| Name | |
|---|---|
| ~VRFProvider() override =default | |
| virtual SR25519Keypair | generateKeypair() const =0 |
| virtual boost::optional< VRFOutput > | sign(const base::Buffer & msg, const SR25519Keypair & keypair, const VRFThreshold & threshold) const =0 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 =0 Verify VRF output against message and public key. |
Additional inherited members¶
Public Functions inherited from IComponent
| Name | |
|---|---|
| virtual | ~IComponent() =default |
| virtual std::string | GetName() =0 |
Detailed Description¶
SR25519 based verifiable random function implementation
Public Functions Documentation¶
function ~VRFProvider¶
function generateKeypair¶
Reimplemented by: sgns::crypto::VRFProviderImpl::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 =0
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.
Reimplemented by: sgns::crypto::VRFProviderImpl::sign
function verify¶
virtual VRFVerifyOutput verify(
const base::Buffer & msg,
const VRFOutput & output,
const SR25519PublicKey & public_key,
const VRFThreshold & threshold
) const =0
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.
Reimplemented by: sgns::crypto::VRFProviderImpl::verify
Updated on 2026-03-04 at 13:10:43 -0800