Skip to content

sgns::crypto::ED25519Provider

#include <ed25519_provider.hpp>

Inherits from IComponent

Inherited by sgns::crypto::ED25519ProviderImpl

Public Functions

Name
~ED25519Provider() override =default
virtual outcome::result< ED25519Keypair > generateKeypair() const =0
virtual ED25519Keypair generateKeypair(const ED25519Seed & seed) const =0
generates key pair by seed
virtual outcome::result< ED25519Signature > sign(const ED25519Keypair & keypair, gsl::span< uint8_t > message) const =0
Sign a message using the given keypair.
virtual outcome::result< bool > verify(const ED25519Signature & signature, gsl::span< uint8_t > message, const ED25519PublicKey & public_key) const =0
Verifies that the message was signed by the given public key.

Additional inherited members

Public Functions inherited from IComponent

Name
virtual ~IComponent() =default
virtual std::string GetName() =0

Public Functions Documentation

function ~ED25519Provider

~ED25519Provider() override =default

function generateKeypair

virtual outcome::result< ED25519Keypair > generateKeypair() const =0

Return: ed25519 key pair if succeeded of error if failed

Reimplemented by: sgns::crypto::ED25519ProviderImpl::generateKeypair

Generates random keypair for signing the message

function generateKeypair

virtual ED25519Keypair generateKeypair(
    const ED25519Seed & seed
) const =0

generates key pair by seed

Parameters:

  • seed seed value

Return: ed25519 key pair

Reimplemented by: sgns::crypto::ED25519ProviderImpl::generateKeypair

function sign

virtual outcome::result< ED25519Signature > sign(
    const ED25519Keypair & keypair,
    gsl::span< uint8_t > message
) const =0

Sign a message using the given keypair.

Parameters:

  • keypair Pair of public and private ed25519 keys.
  • message Bytes to be signed.

Return: Signature of the message.

Reimplemented by: sgns::crypto::ED25519ProviderImpl::sign

function verify

virtual outcome::result< bool > verify(
    const ED25519Signature & signature,
    gsl::span< uint8_t > message,
    const ED25519PublicKey & public_key
) const =0

Verifies that the message was signed by the given public key.

Parameters:

  • signature Signature to verify.
  • message Message bytes.
  • public_key Public key to verify against.

Return: true if signature is valid, false otherwise.

Reimplemented by: sgns::crypto::ED25519ProviderImpl::verify


Updated on 2026-03-04 at 13:10:43 -0800