...
This program aims to test whether it is possible to narrow down the range of private key values based on the public key by determining if the result of subtracting a private key from a public key is positive or negative.
- 1. You can't subtract a private key from a public key. A private key is a scalar. A public key is a vector.
- 2. A private key doesn't have a sign. It is a number between 1 and 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364140
- 3. There is a major error in your generate_public_key function. The prefix of a compressed public key is solely determined by the value of the public key.