Say I have three 64 byte values that I hash into three sha256 hashes (H1, H2, H3). The data does not contain any secrets and it all public data. I am instead hashing the data for integrity purposes.

Now lets say I do the following:

CombinedHashesValue = H1(as bigInt) + H2(as bigInt) + H3(as bigInt)

H4 = sha256(CombinedHashesValue)


Lets call H4 our FinalHash. One of the features of this hash is that it is position independent because adding is communicative.

Now say I want to be able to prove that I know one of the 64 byte chunks of data that makes up the FinalHash. Lets say the 64byte chunk I know is for H3 above.

So:

ProposedH3 = sha256(64bytesOfData)

PropsosedCombinedHashesValue = H1(as bigInt) + H2(as bigInt) + ProposedH3(as bigInt)

ProposedFinalHash = sha256(ProposedCombinedHashesValue)

If ProposedFinalHash == FinalHash {
print "ok great!"
}
else {
print "Nope"
}


1. Reduce the security of each hash or the final hash
2. Increase the chances of collision, PreImage attacks, etc
3. Something else I am not thinking of

I can barely math let alone understand cryptography so I am asking this question because I am pretty sure I am doing something incredibly wrong and short sighted and thus am seeking feedback.

Thanks!

You make up the string you want to prove, say, "FooBar"; you hash it, and pick two 32 byte values which sum to the value $$ProposedCombinedHashesValue - Hash(\text{"FooBar"})$$; propose those as your H1, H2 values and there you go.