|
std::vector< uint8_t > | computePubKey (const std::vector< uint8_t > &privKey, bool compress) override |
|
std::vector< uint8_t > | computeUncompressedPubKey (const std::vector< uint8_t > &pubKey) override |
|
std::vector< uint8_t > | sign (const std::vector< uint8_t > &privKey, const std::vector< uint8_t > &data) override |
|
bool | verify (const std::vector< uint8_t > &data, const std::vector< uint8_t > &signature, const std::vector< uint8_t > &pubKey) override |
|
◆ computePubKey()
std::vector< uint8_t > ledger::core::Secp256k1Api::computePubKey |
( |
const std::vector< uint8_t > & |
privKey, |
|
|
bool |
compress |
|
) |
| |
|
overridevirtual |
Generates public key from private key.
- Parameters
-
privKey | 32 byte private key |
compress | get compressed (35 bytes) or uncompressed (65 bytes) |
- Returns
- public key can be compressed (35 bytes starting with 02 or 03) or un compressed (65 bytes starting with 04)
Implements ledger::core::api::Secp256k1.
◆ computeUncompressedPubKey()
std::vector< uint8_t > ledger::core::Secp256k1Api::computeUncompressedPubKey |
( |
const std::vector< uint8_t > & |
pubKey | ) |
|
|
overridevirtual |
Generates uncompressed public key from compressed public key.
- Parameters
-
pubKey | 33 byte private key (starting with 02 or 03) |
- Returns
- uncompressed public key (65 bytes starting with 04)
Implements ledger::core::api::Secp256k1.
◆ sign()
std::vector< uint8_t > ledger::core::Secp256k1Api::sign |
( |
const std::vector< uint8_t > & |
privKey, |
|
|
const std::vector< uint8_t > & |
data |
|
) |
| |
|
overridevirtual |
Signs message using a given private key.
- Parameters
-
privKey | 32 bytes private key |
data | 32 bytes message to sign |
- Returns
- 32 bytes signed message
Implements ledger::core::api::Secp256k1.
◆ verify()
bool ledger::core::Secp256k1Api::verify |
( |
const std::vector< uint8_t > & |
data, |
|
|
const std::vector< uint8_t > & |
signature, |
|
|
const std::vector< uint8_t > & |
pubKey |
|
) |
| |
|
overridevirtual |
Check if message was signed with given signature and public key.
- Parameters
-
data | 32 bytes signed message |
signature | 32 bytes signature (generated from private key) |
oubkey | 32 bytes public key |
- Returns
- true if message was signed with signature and public key (both issued from same private key)
Implements ledger::core::api::Secp256k1.
The documentation for this class was generated from the following files: