This is a work in progress because I wanted to put this up for discussion before writing tests. It addresses the TODOs that didn’t make it in the schnorrsig PR and changes the APIs of schnorrsig_sign, schnorrsig_verify and hardened_nonce_function.
- Ideally, the new aux_rand32argument forsignwould be const, but didn’t find a solution I was happy with.
- Support for variable length message signing and verification supports the suggested BIP amendment for such messages.
- sign_customwith its opaque config object allows adding more arguments later without having to change the API again. Perhaps there are other sensible customization options, but I’m thinking of sign-to-contract/covert-channel in particular. It would require adding the fields- unsigned char *s2c_data32and- secp256k1_s2c_opening *s2c_openingto the config struct. The former is the data to commit to and the latter is written to by- sign_custom.