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

Function generate_key

connectd/handshake.c:197–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195};
196
197static struct keypair generate_key(void)
198{
199 struct keypair k;
200
201 do {
202 randbytes(k.priv.secret.data, sizeof(k.priv.secret.data));
203 } while (!secp256k1_ec_pubkey_create(secp256k1_ctx,
204 &k.pub.pubkey, k.priv.secret.data));
205 return k;
206}
207
208/* h = SHA-256(h || data) */
209static void sha_mix_in(struct sha256 *h, const void *data, size_t len)

Callers 2

act_one_initiatorFunction · 0.70
act_two_responderFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected