Changeset View
Changeset View
Standalone View
Standalone View
src/key.h
Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | public: | ||||
/** | /** | ||||
* Compute the public key from a private key. | * Compute the public key from a private key. | ||||
* This is expensive. | * This is expensive. | ||||
*/ | */ | ||||
CPubKey GetPubKey() const; | CPubKey GetPubKey() const; | ||||
/** | /** | ||||
* Create a DER-serialized signature. | * Create a DER-serialized ECDSA signature. | ||||
* The test_case parameter tweaks the deterministic nonce. | * The test_case parameter tweaks the deterministic nonce. | ||||
*/ | */ | ||||
bool Sign(const uint256 &hash, std::vector<uint8_t> &vchSig, | bool Sign(const uint256 &hash, std::vector<uint8_t> &vchSig, | ||||
uint32_t test_case = 0) const; | uint32_t test_case = 0) const; | ||||
/** | /** | ||||
* Create a Schnorr signature. | |||||
* The test_case parameter tweaks the deterministic nonce. | |||||
*/ | |||||
bool SignSchnorr(const uint256 &hash, std::vector<uint8_t> &vchSig, | |||||
uint32_t test_case = 0) const; | |||||
/** | |||||
* Create a compact signature (65 bytes), which allows reconstructing the | * Create a compact signature (65 bytes), which allows reconstructing the | ||||
* used public key. | * used public key. | ||||
* The format is one header byte, followed by two times 32 bytes for the | * The format is one header byte, followed by two times 32 bytes for the | ||||
* serialized r and s values. | * serialized r and s values. | ||||
* The header byte: 0x1B = first key with even y, 0x1C = first key with odd | * The header byte: 0x1B = first key with even y, 0x1C = first key with odd | ||||
* y, | * y, | ||||
* 0x1D = second key with even y, 0x1E = second key with | * 0x1D = second key with even y, 0x1E = second key with | ||||
* odd y, | * odd y, | ||||
▲ Show 20 Lines • Show All 65 Lines • Show Last 20 Lines |