h = SHA-256(h || pub.serializeCompressed()) */
| 210 | |
| 211 | /* h = SHA-256(h || pub.serializeCompressed()) */ |
| 212 | static void sha_mix_in_key(struct sha256 *h, const struct pubkey *key) |
| 213 | { |
| 214 | u8 der[PUBKEY_CMPR_LEN]; |
| 215 | size_t len = sizeof(der); |
| 216 | |
| 217 | secp256k1_ec_pubkey_serialize(secp256k1_ctx, der, &len, &key->pubkey, |
| 218 | SECP256K1_EC_COMPRESSED); |
| 219 | assert(len == sizeof(der)); |
| 220 | sha_mix_in(h, der, sizeof(der)); |
| 221 | } |
| 222 | |
| 223 | /* out1, out2 = HKDF(in1, in2)` */ |
| 224 | static void hkdf_two_keys(struct secret *out1, struct secret *out2, |
no test coverage detected