Skip to content

src/crypto/vrf_provider.hpp

Namespaces

Name
sgns
sgns::crypto

Classes

Name
class sgns::crypto::VRFProvider

Source code

#ifndef SUPERGENIUS_SRC_CRYPTO_VRF_VRF_PROVIDER_HPP
#define SUPERGENIUS_SRC_CRYPTO_VRF_VRF_PROVIDER_HPP

#include <boost/optional.hpp>

#include "base/buffer.hpp"
#include "crypto/sr25519_types.hpp"
#include "singleton/IComponent.hpp"

namespace sgns::crypto {
  class VRFProvider : public IComponent {
   public:
       ~VRFProvider() override = default;

    virtual SR25519Keypair generateKeypair() const = 0;

    virtual boost::optional<VRFOutput> sign(
        const base::Buffer &msg,
        const SR25519Keypair &keypair,
        const VRFThreshold &threshold) const = 0;

    virtual VRFVerifyOutput verify(const base::Buffer &msg,
                        const VRFOutput &output,
                        const SR25519PublicKey &public_key,
                        const VRFThreshold &threshold) const = 0;
  };
}

#endif 

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