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.
This commit is contained in:
parent
72540cee4a
commit
2d922b66b0
|
@ -1091,7 +1091,7 @@ uint256 GetOutputsHash(const CTransaction& txTo) {
|
||||||
}
|
}
|
||||||
|
|
||||||
uint256 GetJoinSplitsHash(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++) {
|
for (unsigned int n = 0; n < txTo.vjoinsplit.size(); n++) {
|
||||||
ss << txTo.vjoinsplit[n];
|
ss << txTo.vjoinsplit[n];
|
||||||
}
|
}
|
||||||
|
@ -1165,7 +1165,7 @@ uint256 SignatureHash(
|
||||||
memcpy(personalization, "ZcashSigHash", 12);
|
memcpy(personalization, "ZcashSigHash", 12);
|
||||||
memcpy(personalization+12, &leConsensusBranchId, 4);
|
memcpy(personalization+12, &leConsensusBranchId, 4);
|
||||||
|
|
||||||
CBLAKE2bWriter ss(SER_GETHASH, static_cast<int>(txTo.GetHeader()), personalization);
|
CBLAKE2bWriter ss(SER_GETHASH, 0, personalization);
|
||||||
// Header
|
// Header
|
||||||
ss << txTo.GetHeader();
|
ss << txTo.GetHeader();
|
||||||
// Version group ID
|
// Version group ID
|
||||||
|
|
Loading…
Reference in New Issue