Changeset View
Changeset View
Standalone View
Standalone View
src/key.cpp
Show First 20 Lines • Show All 279 Lines • ▼ Show 20 Lines | static bool DoSignSchnorr(const CKey &key, const uint256 &hash, uint8_t *buf, | ||||
int ret = secp256k1_schnorr_sign( | int ret = secp256k1_schnorr_sign( | ||||
secp256k1_context_sign, buf, hash.begin(), key.begin(), | secp256k1_context_sign, buf, hash.begin(), key.begin(), | ||||
secp256k1_nonce_function_rfc6979, test_case ? extra_entropy : nullptr); | secp256k1_nonce_function_rfc6979, test_case ? extra_entropy : nullptr); | ||||
assert(ret); | assert(ret); | ||||
return true; | return true; | ||||
} | } | ||||
bool CKey::SignSchnorr(const uint256 &hash, | bool CKey::SignSchnorr(const uint256 &hash, SchnorrSig &sig, | ||||
std::array<uint8_t, CPubKey::SCHNORR_SIZE> &sig, | |||||
uint32_t test_case) const { | uint32_t test_case) const { | ||||
return DoSignSchnorr(*this, hash, sig.data(), test_case); | return DoSignSchnorr(*this, hash, sig.data(), test_case); | ||||
} | } | ||||
bool CKey::SignSchnorr(const uint256 &hash, std::vector<uint8_t> &vchSig, | bool CKey::SignSchnorr(const uint256 &hash, std::vector<uint8_t> &vchSig, | ||||
uint32_t test_case) const { | uint32_t test_case) const { | ||||
if (!fValid) { | if (!fValid) { | ||||
return false; | return false; | ||||
▲ Show 20 Lines • Show All 162 Lines • Show Last 20 Lines |