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

#include <ed25519_provider.hpp>

Inheritance diagram for kagome::crypto::Ed25519Provider:
Collaboration diagram for kagome::crypto::Ed25519Provider:

Public Member Functions

virtual ~Ed25519Provider ()=default
 
virtual Ed25519KeypairAndSeed generateKeypair () const =0
 
virtual Ed25519Keypair generateKeypair (const Ed25519Seed &seed) const =0
 generates key pair by seed More...
 
virtual outcome::result< Ed25519Signature > sign (const Ed25519Keypair &keypair, gsl::span< const uint8_t > message) const =0
 
virtual outcome::result< bool > verify (const Ed25519Signature &signature, gsl::span< const uint8_t > message, const Ed25519PublicKey &public_key) const =0
 

Detailed Description

Definition at line 15 of file ed25519_provider.hpp.

Constructor & Destructor Documentation

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

Member Function Documentation

virtual Ed25519KeypairAndSeed kagome::crypto::Ed25519Provider::generateKeypair ( ) const
pure virtual

Generates random keypair for signing the message

Returns
ed25519 key pair if succeeded of error if failed

Implemented in kagome::crypto::Ed25519ProviderImpl.

virtual Ed25519Keypair kagome::crypto::Ed25519Provider::generateKeypair ( const Ed25519Seed &  seed) const
pure virtual

generates key pair by seed

Parameters
seedseed value
Returns
ed25519 key pair

Implemented in kagome::crypto::Ed25519ProviderImpl.

virtual outcome::result<Ed25519Signature> kagome::crypto::Ed25519Provider::sign ( const Ed25519Keypair keypair,
gsl::span< const uint8_t >  message 
) 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
keypairpair of public and private ed25519 keys
messagebytes to be signed
Returns
signed message

Implemented in kagome::crypto::Ed25519ProviderImpl.

virtual outcome::result<bool> kagome::crypto::Ed25519Provider::verify ( const Ed25519Signature &  signature,
gsl::span< const uint8_t >  message,
const Ed25519PublicKey &  public_key 
) const
pure virtual

Verifies that

Parameters
messagewas derived using
public_keyon
signature

Implemented in kagome::crypto::Ed25519ProviderImpl.


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