I have to generate a signature for concatenation of multiple independent values say A | B | C. Two options are :
- concatenate all attributes and generate the hash. Then Sign hash.
$$ signature = Sign\big(Hash(A\mathbin\| B \mathbin\| C)\big)$$
- Use hash of previous value along with current value to generate the hash. Sign the generated hash.
$$ signature = Sign\big(Hash\big(Hash\big(Hash(A)\mathbin\| B) \mathbin\| C)\big)\big)\big)$$
Analogous to taking two hashes of a value, option 2 seems cryptographically strong. Kindly help in picking right practice and why?