This introduces a new data type secp256k1_pubkey_t, which is an abstract parsed public key, convertible to/from serialized variable-size public keys.
This avoids all API problems resulting from needing to pass pubkey sizes and pointers to pubkey sizes anywhere public keys are needed.
Advantages:
- No need for secp256k1_ec_pubkey_verify, secp256k1_ec_pubkey_compress, secp256k1_ec_pubkey_decompress
- Reusing the same public key in multiple operations is faster due to avoiding decompression costs on every use.
- Less parameters to pass around.
- No need for separate secp256k1_ecdsa_verify return code to deal with invalid public keys.
Disadvantages:
- Need for API calls secp256k1_ec_pubkey_serialize and secp256k1_ec_pubkey_parse.
- Slightly slower for verification (0.4%) due to extra serialization and weak validation overhead between parsing and verifying.
- Potentially unsafe when passing an uninitialized secp256k1_pubkey_t for verification, though this is mitigated as much as possible by wiping the output secp256k1_pubkey_t any time an invalid one would be returned, and not accepting a wiped one as input.