ledger-core
|
#include <Secp256k1.hpp>
Public Member Functions | |
virtual std::vector< uint8_t > | computePubKey (const std::vector< uint8_t > &privKey, bool compress)=0 |
virtual std::vector< uint8_t > | computeUncompressedPubKey (const std::vector< uint8_t > &pubKey)=0 |
virtual std::vector< uint8_t > | sign (const std::vector< uint8_t > &privKey, const std::vector< uint8_t > &data)=0 |
virtual bool | verify (const std::vector< uint8_t > &data, const std::vector< uint8_t > &signature, const std::vector< uint8_t > &pubKey)=0 |
Static Public Member Functions | |
static std::shared_ptr< Secp256k1 > | createInstance () |
static std::shared_ptr< Secp256k1 > | newInstance () |
Class implementing secp256k1 used in Bitcoin.
|
pure virtual |
Generates public key from private key.
privKey | 32 byte private key |
compress | get compressed (35 bytes) or uncompressed (65 bytes) |
Implemented in ledger::core::Secp256k1Api.
|
pure virtual |
Generates uncompressed public key from compressed public key.
pubKey | 33 byte private key (starting with 02 or 03) |
Implemented in ledger::core::Secp256k1Api.
|
static |
|
pure virtual |
Signs message using a given private key.
privKey | 32 bytes private key |
data | 32 bytes message to sign |
Implemented in ledger::core::Secp256k1Api.
|
pure virtual |
Check if message was signed with given signature and public key.
data | 32 bytes signed message |
signature | 32 bytes signature (generated from private key) |
oubkey | 32 bytes public key |
Implemented in ledger::core::Secp256k1Api.