Closed landabaso closed 1 year ago
This is actually as designed.
As stated in the note, pointCompress requires a boolean to explicitly change the compressed state. If passing no boolean or undefined explicitly, pointCompress returns the input unchanged.
It is a bit confusing, but that is how the API is designed.
As a breaking change, this API could be modified to be a little bit more intuitive.
You're correct. I'm working on an npm package that can serve as an alternative to tiny-secp256k1 for bitcoinjs, but without using WASM so that it can be used in React Native (using Paul Miller's noble). This package will be released as an npm package in the next few days, and I wanted to thoroughly test it using the same tests as tiny-secp256k1. These 2 fixtures failed, which prompted me to open this issue. The errors were on my package instead. My mistake.
The following 2 test vectors for pointCompress should have:
"expected": "022f01e5e15cca351daff3843fb70f3c2f0a1bdd05e5af888a67784ef3e10a2a01"
You can find them here.
See how previous valid test using explicit compress = true, has the expected value above.