We originally generated the hash to append to the PMMR by
concatenating the pos, the sum and the output hash
and hashing them together -
let node_hash = (idx, &sum, hash).hash();
HashSum {
hash: node_hash,
sum: sum,
}
I _think_ we are now simply using the hash of the output (and not including the pos in there)?
Do we need to include the pos in the data that we are hashing?
let mut current_hash = elmt.hash();
We simplified the PMMR to get rid of the Sum so that is no longer relevant.
But do we still need the pos in there?
I'm not clear on what the rationale was for originally including the pos in the data being hashed.
Presumably each entry in the PMMR would be pos specific and unique even if the same output was added multiple times?
@yeastplume @ignopeverell
I think we do, it provides additional collision resistance.
If that's the case I can get the position back in there.. about to delve back into storage anyhow for the PMMR index files.
Most helpful comment
If that's the case I can get the position back in there.. about to delve back into storage anyhow for the PMMR index files.