Kagome
Polkadot Runtime Engine in C++17
kagome::crypto::Ed25519Suite Class Reference

#include <crypto_suites.hpp>

Inheritance diagram for kagome::crypto::Ed25519Suite:
Collaboration diagram for kagome::crypto::Ed25519Suite:

Public Member Functions

 Ed25519Suite (std::shared_ptr< Ed25519Provider > ed_provider)
 
 ~Ed25519Suite () override=default
 
outcome::result< Ed25519KeypairAndSeedgenerateRandomKeypair () const noexceptoverride
 
outcome::result< Ed25519KeypairgenerateKeypair (const Ed25519Seed &seed) const noexceptoverride
 
Ed25519Keypair composeKeypair (PublicKey pub, PrivateKey priv) const noexceptoverride
 
std::pair< PublicKey, PrivateKeydecomposeKeypair (const Ed25519Keypair &kp) const noexceptoverride
 
outcome::result< PublicKeytoPublicKey (gsl::span< const uint8_t > bytes) const noexceptoverride
 
outcome::result< SeedtoSeed (gsl::span< const uint8_t > bytes) const noexceptoverride
 
- Public Member Functions inherited from kagome::crypto::CryptoSuite< Ed25519PublicKey, Ed25519PrivateKey, Ed25519Keypair, Ed25519KeypairAndSeed, Ed25519Seed >
virtual ~CryptoSuite ()=default
 

Private Attributes

std::shared_ptr< Ed25519Providered_provider_
 

Additional Inherited Members

- Public Types inherited from kagome::crypto::CryptoSuite< Ed25519PublicKey, Ed25519PrivateKey, Ed25519Keypair, Ed25519KeypairAndSeed, Ed25519Seed >
using PublicKey = Ed25519PublicKey
 
using PrivateKey = Ed25519PrivateKey
 
using Keypair = Ed25519Keypair
 
using KeypairAndSeed = Ed25519KeypairAndSeed
 
using Seed = Ed25519Seed
 

Detailed Description

Definition at line 125 of file crypto_suites.hpp.

Constructor & Destructor Documentation

kagome::crypto::Ed25519Suite::Ed25519Suite ( std::shared_ptr< Ed25519Provider ed_provider)
inlineexplicit

Definition at line 131 of file crypto_suites.hpp.

kagome::crypto::Ed25519Suite::~Ed25519Suite ( )
overridedefault

Member Function Documentation

Ed25519Keypair kagome::crypto::Ed25519Suite::composeKeypair ( PublicKey  pub,
PrivateKey  priv 
) const
inlineoverridevirtualnoexcept

Create a keypair from a public key and a private key

Note
Although it is typically just a structure with two fields, from the compiler point of view they all are different types, thus this convenience method emerges

Implements kagome::crypto::CryptoSuite< Ed25519PublicKey, Ed25519PrivateKey, Ed25519Keypair, Ed25519KeypairAndSeed, Ed25519Seed >.

Definition at line 148 of file crypto_suites.hpp.

std::pair<PublicKey, PrivateKey> kagome::crypto::Ed25519Suite::decomposeKeypair ( const Ed25519Keypair kp) const
inlineoverridevirtualnoexcept

Extrace the private key and the public key from a keypair

See also
composeKeypair()

Implements kagome::crypto::CryptoSuite< Ed25519PublicKey, Ed25519PrivateKey, Ed25519Keypair, Ed25519KeypairAndSeed, Ed25519Seed >.

Definition at line 154 of file crypto_suites.hpp.

outcome::result<Ed25519Keypair> kagome::crypto::Ed25519Suite::generateKeypair ( const Ed25519Seed &  seed) const
inlineoverridevirtualnoexcept

Genereate a keypair from

Parameters
seed(mind that in some algorithms a seed is a private key)

Implements kagome::crypto::CryptoSuite< Ed25519PublicKey, Ed25519PrivateKey, Ed25519Keypair, Ed25519KeypairAndSeed, Ed25519Seed >.

Definition at line 143 of file crypto_suites.hpp.

outcome::result<Ed25519KeypairAndSeed> kagome::crypto::Ed25519Suite::generateRandomKeypair ( ) const
inlineoverridevirtualnoexcept

Generate a random keypair (randomness source is determined by an underlying crypto provider)

Implements kagome::crypto::CryptoSuite< Ed25519PublicKey, Ed25519PrivateKey, Ed25519Keypair, Ed25519KeypairAndSeed, Ed25519Seed >.

Definition at line 138 of file crypto_suites.hpp.

outcome::result<PublicKey> kagome::crypto::Ed25519Suite::toPublicKey ( gsl::span< const uint8_t >  bytes) const
inlineoverridevirtualnoexcept
outcome::result<Seed> kagome::crypto::Ed25519Suite::toSeed ( gsl::span< const uint8_t >  bytes) const
inlineoverridevirtualnoexcept

Member Data Documentation

std::shared_ptr<Ed25519Provider> kagome::crypto::Ed25519Suite::ed_provider_
private

Definition at line 171 of file crypto_suites.hpp.


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