Kagome
Polkadot Runtime Engine in C++17
ed25519_provider.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_CORE_CRYPTO_ED25519_PROVIDER_HPP
7 #define KAGOME_CORE_CRYPTO_ED25519_PROVIDER_HPP
8 
9 #include <gsl/span>
10 #include <outcome/outcome.hpp>
11 #include "crypto/ed25519_types.hpp"
12 
13 namespace kagome::crypto {
14 
16  public:
17  virtual ~Ed25519Provider() = default;
18 
23  virtual Ed25519KeypairAndSeed generateKeypair() const = 0;
24 
30  virtual Ed25519Keypair generateKeypair(const Ed25519Seed &seed) const = 0;
31 
40  virtual outcome::result<Ed25519Signature> sign(
41  const Ed25519Keypair &keypair,
42  gsl::span<const uint8_t> message) const = 0;
43 
48  virtual outcome::result<bool> verify(
49  const Ed25519Signature &signature,
50  gsl::span<const uint8_t> message,
51  const Ed25519PublicKey &public_key) const = 0;
52  };
53 } // namespace kagome::crypto
54 
55 #endif // KAGOME_CORE_CRYPTO_ED25519_PROVIDER_HPP
virtual outcome::result< bool > verify(const Ed25519Signature &signature, gsl::span< const uint8_t > message, const Ed25519PublicKey &public_key) const =0
virtual ~Ed25519Provider()=default
virtual Ed25519KeypairAndSeed generateKeypair() const =0
virtual outcome::result< Ed25519Signature > sign(const Ed25519Keypair &keypair, gsl::span< const uint8_t > message) const =0