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

Function init

tests/fuzz/fuzz-cryptomsg.c:27–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27void init(int *argc, char ***argv)
28{
29 /* BOLT #8:
30 *
31 * name: transport-initiator successful handshake
32 *...
33 * # ck,temp_k3=0x919219dbb2920afa8db80f9a51787a840bcf111ed8d588caf9ab4be716e42b01,0x981a46c820fb7a241bc8184ba4bb1f01bcdfafb00dde80098cb8c38db9141520
34 * # encryptWithAD(0x981a46c820fb7a241bc8184ba4bb1f01bcdfafb00dde80098cb8c38db9141520, 0x000000000000000000000000, 0x5dcb5ea9b4ccc755e0e3456af3990641276e1d5dc9afd82f974d90a47c918660, <empty>)
35 * # t=0x8dc68b1c466263b47fdf31e560e139ba
36 * output: 0x00b9e3a702e93e3a9948c2ed6e5fd7590a6e1c3a0344cfc9d5b57357049aa22355361aa02e55a8fc28fef5bd6d71ad0c38228dc68b1c466263b47fdf31e560e139ba
37 * # HKDF(0x919219dbb2920afa8db80f9a51787a840bcf111ed8d588caf9ab4be716e42b01,zero)
38 * output: sk,rk=0x969ab31b4d288cedf6218839b27a3e2140827047f2c0f01bf5c04435d43511a9,0xbb9020b8965f4df047e07f955f3c4b88418984aadc5cdb35096b9ea8fa5c3442
39 */
40 struct secret sk = secret_from_hex("0x969ab31b4d288cedf6218839b27a3e214"
41 "0827047f2c0f01bf5c04435d43511a9");
42 struct secret rk = secret_from_hex("0xbb9020b8965f4df047e07f955f3c4b884"
43 "18984aadc5cdb35096b9ea8fa5c3442");
44 struct secret ck = secret_from_hex("0x919219dbb2920afa8db80f9a51787a840"
45 "bcf111ed8d588caf9ab4be716e42b01");
46
47 init_cs_out.sk = sk;
48 init_cs_out.rk = rk;
49 init_cs_out.s_ck = ck;
50 init_cs_out.r_ck = ck;
51
52 init_cs_in.sk = rk;
53 init_cs_in.rk = sk;
54 init_cs_in.s_ck = ck;
55 init_cs_in.r_ck = ck;
56
57 /* Don't call this if we're in unit-test mode, as libfuzz.c does it */
58 if (!tmpctx)
59 common_setup("fuzzer");
60}
61
62/* Test that encrypting and decrypting the message does not alter it. */
63static void test_encrypt_decrypt_equality(const u8 *msg)

Callers

nothing calls this directly

Calls 2

common_setupFunction · 0.85
secret_from_hexFunction · 0.70

Tested by

no test coverage detected