mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
refactor: use Hash helper for double-SHA256 calculations
This commit is contained in:
parent
b5868f4b1f
commit
87f11ef47f
5 changed files with 8 additions and 23 deletions
|
|
@ -245,8 +245,7 @@ bool CKey::VerifyPubKey(const CPubKey& pubkey) const {
|
|||
unsigned char rnd[8];
|
||||
std::string str = "Bitcoin key verification\n";
|
||||
GetRandBytes(rnd);
|
||||
uint256 hash;
|
||||
CHash256().Write(MakeUCharSpan(str)).Write(rnd).Finalize(hash);
|
||||
uint256 hash{Hash(str, rnd)};
|
||||
std::vector<unsigned char> vchSig;
|
||||
Sign(hash, vchSig);
|
||||
return pubkey.Verify(hash, vchSig);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue