mirror of
https://github.com/bitcoin/bips.git
synced 2026-11-16 19:48:35 +00:00
ApplyTweak multiplies gacc by g, which is -1 if an x-only tweak negates the aggregate public key. In every previous tweak sequence, the product of all values of g equals the last one. Add a test vector with two x-only tweaks, of which only the first negates the aggregate public key. It detects implementations that set gacc to g instead of multiplying it by g. PartialSigAgg adds e*g*tacc, where g is -1 if the aggregate public key Q has an odd Y coordinate. In the previous PartialSigAgg test vectors, tacc is 0 whenever Q has an odd Y coordinate. Add a test vector with a plain tweak and an odd Q, generated by gen_vectors_helper.py. It detects implementations that omit g.
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".