When computing tagged-hashes for Schnorr sigs the 3 methods (challenge, aux, nonce) first call secp256k1_sha256_initialize
that sets the hashstate (ie. s[0] to s[7] and bytes) to their default SHA256 values then they each immediately change all those values to the precomputed “midstate” values. The first call to secp256k1_sha256_initialize
seems wasteful.
Cross post: https://github.com/bitcoin/bitcoin/issues/26712