This adds a limited implementation of HKDF
(defined by rfc5869) that supports only HMAC-SHA256 and length output of 32 bytes (will be required for v2 transport protocol).
This PR also includes a method to negate a private key which is useful to enforce public keys starting with 0x02 (or 0x03) (a requirement for the v2 transport protocol). The new CKey::Negate()
method is pretty much a wrapper around secp256k1_ec_privkey_negate()
.
Including tests.
This is a subset of #14032 and a pre-requirement for the v2 transport protocol.