11 : provider_{std::make_shared<Libp2pEcdsaProviderImpl>()} {}
14 std::shared_ptr<Libp2pEcdsaProvider> provider)
21 OUTCOME_TRY(key_pair,
provider_->generate());
34 OUTCOME_TRY(public_key,
provider_->derive(EcdsaPrivateKey{seed}));
36 std::copy(public_key.begin(), public_key.end(), res.begin());
41 gsl::span<const uint8_t> message,
const EcdsaPrivateKey &key)
const {
47 return provider_->signPrehashed(message, key);
51 gsl::span<const uint8_t> message,
53 const EcdsaPublicKey &publicKey)
const {
54 return provider_->verify(message, signature, publicKey);
60 const EcdsaPublicKey &publicKey)
const {
61 return provider_->verifyPrehashed(message, signature, publicKey);
outcome::result< EcdsaPublicKey > derive(const EcdsaSeed &seed) const override
outcome::result< EcdsaSignature > signPrehashed(const EcdsaPrehashedMessage &message, const EcdsaPrivateKey &key) const override
outcome::result< EcdsaKeypairAndSeed > generate() const override
std::vector< uint8_t > EcdsaSignature
outcome::result< bool > verify(gsl::span< const uint8_t > message, const EcdsaSignature &signature, const EcdsaPublicKey &publicKey) const override
libp2p::crypto::ecdsa::PrehashedMessage EcdsaPrehashedMessage
Logger createLogger(const std::string &tag)
outcome::result< bool > verifyPrehashed(const EcdsaPrehashedMessage &message, const EcdsaSignature &signature, const EcdsaPublicKey &publicKey) const override
outcome::result< EcdsaSignature > sign(gsl::span< const uint8_t > message, const EcdsaPrivateKey &key) const override
std::shared_ptr< Libp2pEcdsaProvider > provider_