Browse Source
Pass transaction header into correct SignatureHash serialization level
We need to indicate whether PHGR or Groth proofs are expected to vjoinsplit,
which is serialized in an inner hash, not the outer hash.
pull/4/head
Jack Grigg
6 years ago
No known key found for this signature in database
GPG Key ID: 665DBCD284F7DAFF
1 changed files with
2 additions and
2 deletions
-
src/script/interpreter.cpp
|
|
@ -1091,7 +1091,7 @@ uint256 GetOutputsHash(const CTransaction& txTo) { |
|
|
|
} |
|
|
|
|
|
|
|
uint256 GetJoinSplitsHash(const CTransaction& txTo) { |
|
|
|
CBLAKE2bWriter ss(SER_GETHASH, 0, ZCASH_JOINSPLITS_HASH_PERSONALIZATION); |
|
|
|
CBLAKE2bWriter ss(SER_GETHASH, static_cast<int>(txTo.GetHeader()), ZCASH_JOINSPLITS_HASH_PERSONALIZATION); |
|
|
|
for (unsigned int n = 0; n < txTo.vjoinsplit.size(); n++) { |
|
|
|
ss << txTo.vjoinsplit[n]; |
|
|
|
} |
|
|
@ -1165,7 +1165,7 @@ uint256 SignatureHash( |
|
|
|
memcpy(personalization, "ZcashSigHash", 12); |
|
|
|
memcpy(personalization+12, &leConsensusBranchId, 4); |
|
|
|
|
|
|
|
CBLAKE2bWriter ss(SER_GETHASH, static_cast<int>(txTo.GetHeader()), personalization); |
|
|
|
CBLAKE2bWriter ss(SER_GETHASH, 0, personalization); |
|
|
|
// Header
|
|
|
|
ss << txTo.GetHeader(); |
|
|
|
// Version group ID
|
|
|
|