Add SCRIPT_ENABLE_SCHNORR support to sigencoding
Summary:
(includes a new error code SCRIPT_ERR_SIG_BADLENGTH)
motivation for banning 65 byte sigs in CHECKMULTISIG: When Schnorr signatures (64 bytes + 1 hashtype byte) are added, we have the option of leaving CHECKMULTISIG untouched which would mean it would still accept 64+1 byte signatures and interpret them as ECDSA while at the same time, CHECKSIG would accept 64+1 byte signatures and interpret them as Schnorr. This is a sort of awkward ambiguity however, and hopefully it will create less ambiguity, and less risk of consensus break with other implementations, if post-fork *all* 64+1 byte signatures are now Schnorr signatures.
Test Plan:
added direct tests in sigencoding_tests
added script_tests that ensure each opcode is calling the right function
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Subscribers: Mengerian, teamcity, schancel
Maniphest Tasks: T527
Differential Revision: https://reviews.bitcoinabc.org/D2469