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

#include <ecdsa_provider_impl.hpp>

Inheritance diagram for kagome::crypto::EcdsaProviderImpl:
Collaboration diagram for kagome::crypto::EcdsaProviderImpl:

Public Types

enum  Error { Error::VERIFICATION_FAILED = 1, Error::SIGN_FAILED }
 
using Libp2pEcdsaProvider = libp2p::crypto::ecdsa::EcdsaProvider
 
using Libp2pEcdsaProviderImpl = libp2p::crypto::ecdsa::EcdsaProviderImpl
 

Public Member Functions

 EcdsaProviderImpl ()
 
 EcdsaProviderImpl (std::shared_ptr< Libp2pEcdsaProvider > provider)
 
outcome::result< EcdsaKeypairAndSeedgenerate () const override
 
outcome::result< EcdsaPublicKey > derive (const EcdsaSeed &seed) const override
 
outcome::result< EcdsaSignaturesign (gsl::span< const uint8_t > message, const EcdsaPrivateKey &key) const override
 
outcome::result< EcdsaSignaturesignPrehashed (const EcdsaPrehashedMessage &message, const EcdsaPrivateKey &key) const override
 
outcome::result< bool > verify (gsl::span< const uint8_t > message, const EcdsaSignature &signature, const EcdsaPublicKey &publicKey) const override
 
outcome::result< bool > verifyPrehashed (const EcdsaPrehashedMessage &message, const EcdsaSignature &signature, const EcdsaPublicKey &publicKey) const override
 
- Public Member Functions inherited from kagome::crypto::EcdsaProvider
virtual ~EcdsaProvider ()=default
 

Private Attributes

std::shared_ptr< Libp2pEcdsaProviderprovider_
 
log::Logger logger_
 

Detailed Description

Definition at line 16 of file ecdsa_provider_impl.hpp.

Member Typedef Documentation

using kagome::crypto::EcdsaProviderImpl::Libp2pEcdsaProvider = libp2p::crypto::ecdsa::EcdsaProvider

Definition at line 19 of file ecdsa_provider_impl.hpp.

using kagome::crypto::EcdsaProviderImpl::Libp2pEcdsaProviderImpl = libp2p::crypto::ecdsa::EcdsaProviderImpl

Definition at line 20 of file ecdsa_provider_impl.hpp.

Member Enumeration Documentation

Enumerator
VERIFICATION_FAILED 
SIGN_FAILED 

Definition at line 18 of file ecdsa_provider_impl.hpp.

Constructor & Destructor Documentation

kagome::crypto::EcdsaProviderImpl::EcdsaProviderImpl ( )

Definition at line 10 of file ecdsa_provider_impl.cpp.

kagome::crypto::EcdsaProviderImpl::EcdsaProviderImpl ( std::shared_ptr< Libp2pEcdsaProvider provider)
explicit

Definition at line 13 of file ecdsa_provider_impl.cpp.

Member Function Documentation

outcome::result< EcdsaPublicKey > kagome::crypto::EcdsaProviderImpl::derive ( const EcdsaSeed seed) const
overridevirtual

Implements kagome::crypto::EcdsaProvider.

Definition at line 31 of file ecdsa_provider_impl.cpp.

outcome::result< EcdsaKeypairAndSeed > kagome::crypto::EcdsaProviderImpl::generate ( ) const
overridevirtual

Implements kagome::crypto::EcdsaProvider.

Definition at line 20 of file ecdsa_provider_impl.cpp.

outcome::result< EcdsaSignature > kagome::crypto::EcdsaProviderImpl::sign ( gsl::span< const uint8_t >  message,
const EcdsaPrivateKey &  key 
) const
overridevirtual

Implements kagome::crypto::EcdsaProvider.

Definition at line 40 of file ecdsa_provider_impl.cpp.

outcome::result< EcdsaSignature > kagome::crypto::EcdsaProviderImpl::signPrehashed ( const EcdsaPrehashedMessage message,
const EcdsaPrivateKey &  key 
) const
overridevirtual

Implements kagome::crypto::EcdsaProvider.

Definition at line 45 of file ecdsa_provider_impl.cpp.

outcome::result< bool > kagome::crypto::EcdsaProviderImpl::verify ( gsl::span< const uint8_t >  message,
const EcdsaSignature signature,
const EcdsaPublicKey &  publicKey 
) const
overridevirtual

Implements kagome::crypto::EcdsaProvider.

Definition at line 50 of file ecdsa_provider_impl.cpp.

outcome::result< bool > kagome::crypto::EcdsaProviderImpl::verifyPrehashed ( const EcdsaPrehashedMessage message,
const EcdsaSignature signature,
const EcdsaPublicKey &  publicKey 
) const
overridevirtual

Implements kagome::crypto::EcdsaProvider.

Definition at line 57 of file ecdsa_provider_impl.cpp.

Member Data Documentation

log::Logger kagome::crypto::EcdsaProviderImpl::logger_
private

Definition at line 51 of file ecdsa_provider_impl.hpp.

std::shared_ptr<Libp2pEcdsaProvider> kagome::crypto::EcdsaProviderImpl::provider_
private

Definition at line 50 of file ecdsa_provider_impl.hpp.


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