Changeset View
Changeset View
Standalone View
Standalone View
src/pubkey.h
Show First 20 Lines • Show All 130 Lines • ▼ Show 20 Lines | public: | ||||
//! fully validate whether this is a valid public key (more expensive than | //! fully validate whether this is a valid public key (more expensive than | ||||
//! IsValid()) | //! IsValid()) | ||||
bool IsFullyValid() const; | bool IsFullyValid() const; | ||||
//! Check whether this is a compressed public key. | //! Check whether this is a compressed public key. | ||||
bool IsCompressed() const { return size() == 33; } | bool IsCompressed() const { return size() == 33; } | ||||
/** | /** | ||||
* Verify a DER signature (~72 bytes). | * Verify an ECDSA DER signature (~72 bytes). | ||||
* If this public key is not fully valid, the return value will be false. | * If this public key is not fully valid, the return value will be false. | ||||
*/ | */ | ||||
bool Verify(const uint256 &hash, const std::vector<uint8_t> &vchSig) const; | bool Verify(const uint256 &hash, const std::vector<uint8_t> &vchSig) const; | ||||
/** | /** | ||||
* Verify a Schnorr signature (=64 bytes). | |||||
* If this public key is not fully valid, the return value will be false. | |||||
*/ | |||||
bool VerifySchnorr(const uint256 &hash, | |||||
const std::vector<uint8_t> &vchSig) const; | |||||
/** | |||||
* Check whether a signature is normalized (lower-S). | * Check whether a signature is normalized (lower-S). | ||||
*/ | */ | ||||
static bool | static bool | ||||
CheckLowS(const boost::sliced_range<const std::vector<uint8_t>> &vchSig); | CheckLowS(const boost::sliced_range<const std::vector<uint8_t>> &vchSig); | ||||
static bool CheckLowS(const std::vector<uint8_t> &vchSig) { | static bool CheckLowS(const std::vector<uint8_t> &vchSig) { | ||||
return CheckLowS(vchSig | boost::adaptors::sliced(0, vchSig.size())); | return CheckLowS(vchSig | boost::adaptors::sliced(0, vchSig.size())); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines |