mirror of
https://github.com/bitcoin/bips.git
synced 2026-11-16 19:48:35 +00:00
A public key and its negation have the same X coordinate, and their compressed encodings differ only in the first byte. Add a Sign test vector with a secnonce generated for the negation of the signer's public key, and a KeyAgg test vector with a public key and its negation. They detect implementations that compare public keys only by their X coordinates, in the public key check of Sign, in GetSecondKey, or in KeyAggCoeffInternal. Distinct public keys in the previous test vectors also have distinct X coordinates. The public key check in Sign ensures that the secret key provided to Sign is determined when NonceGen is invoked. Comparing only X coordinates determines the secret key only up to negation.