New secp256k1 modules often take use of BIP340 tagged hashes, with corresponding functions to initialize _sha256 objects with a fixed midstate for efficiency reasons. Right now there seems to be no standard way to create these functions, presumably every contributor does this in a slightly different way (I guess all ways involve cluttering the code with printf statements though). I was wondering if it’s worth it to provide a small tool for that, which could also be useful for reviewing.
Proof-of-concept (not involving the build system yet): https://github.com/theStack/secp256k1/commit/009cac68a3bb571901636809183778bc70caf260