MCPcopy Create free account
hub / github.com/ElementsProject/lightning / sha_mix_in_key

Function sha_mix_in_key

connectd/handshake.c:212–221  ·  view source on GitHub ↗

h = SHA-256(h || pub.serializeCompressed()) */

Source from the content-addressed store, hash-verified

210
211/* h = SHA-256(h || pub.serializeCompressed()) */
212static 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)` */
224static void hkdf_two_keys(struct secret *out1, struct secret *out2,

Callers 5

new_handshakeFunction · 0.85
act_two_initiator2Function · 0.85
act_one_initiatorFunction · 0.85
act_two_responderFunction · 0.85
act_one_responder2Function · 0.85

Calls 1

sha_mix_inFunction · 0.85

Tested by

no test coverage detected