Files
bips/bip-0327/vectors
Jonas Nick b7557f897a bip-0327: add a NonceGen test vector without repeated bytes
In the previous NonceGen test vectors, every rand_ consists of the byte
0F repeated 32 times, every present sk of the byte 02 repeated 32 times,
and every pk has an even Y coordinate. Add a test vector whose rand_ and
sk are not a repeated byte and whose pk has an odd Y coordinate. It
detects implementations that reverse the byte order of rand_ or sk, that
replace the first byte of pk with 02, or that use only the first byte of
rand_.

With the last mistake, two NonceGen invocations with the same other
arguments return the same secnonce with probability 1/256, although the
BIP requires that Sign is never executed twice with the same secnonce.
2026-11-16 09:29:52 +00:00
..

BIP327 test vectors

BIP327 specifies the length and number of the inputs of each algorithm, for example that each tweak is a 32-byte array and that there is one tweak mode for each tweak. The test vectors only contain inputs that meet these specifications. Since BIP327 does not specify how algorithms handle other inputs, such as a 31-byte tweak or a missing tweak mode, the test vectors do not test them.

A test vector should only be added if it detects a plausible implementation mistake that the other test vectors do not detect. The comment of the test vector names the mistake, for example "Detects implementations that set gacc to g instead of multiplying it by g".