ZIP 244: Add hash_type to the S.2 digest input
ZIP 244: Add hash_type to the S.2 digest input

This was committed to by the ZIP 143 and ZIP 243 transaction digest
algorithms, but had been accidentally omitted from ZIP 244. It is not a
security issue because the encoding of each layer uses sentinel values,
meaning we were indirectly committing to hash_type (unlike BIP 341, which
conditionally omits commitments based on hash_type and therefore needs to
directly commit to it). But not committing directly to hash_type would
complicate security analysis of the digest, and including it keeps the
transparent part of ZIP 244 closer to BIP 341.

We additionally import two new consensus rules from BIP 341 that apply
to hash_type.

Co-authored-by: Daira Hopwood <cd7d43d5556a38ce626d53826fddc46adc597539@jacaranda.org>
Co-authored-by: Kris Nuttycom <b85e401560948e014cfbb1d7b4d352deba57f07e@electriccoin.co>

zcash/zips,zcash/zips,zcash/zips,zcash/zips