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

Function test_decrypt

common/test/run-blindedpath_enctlv.c:88–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88static void test_decrypt(const struct pubkey *blinding,
89 const u8 *enctlv,
90 const struct privkey *me,
91 const struct pubkey *expected_next_node,
92 const struct privkey *expected_next_blinding_priv)
93{
94 struct pubkey expected_next_blinding, dummy, next_node, next_blinding;
95 struct secret ss;
96
97 /* We don't actually have an onion, so we put some dummy */
98 pubkey_from_privkey(me, &dummy);
99
100 mykey = me;
101 assert(unblind_onion(blinding, test_ecdh, &dummy, &ss));
102 assert(decrypt_enctlv(blinding, &ss, enctlv, &next_node, &next_blinding));
103
104 pubkey_from_privkey(expected_next_blinding_priv, &expected_next_blinding);
105 assert(pubkey_eq(&next_blinding, &expected_next_blinding));
106 assert(pubkey_eq(&next_node, expected_next_node));
107}
108
109static void test_final_decrypt(const struct pubkey *blinding,
110 const u8 *enctlv,

Callers 1

mainFunction · 0.85

Calls 3

pubkey_from_privkeyFunction · 0.85
unblind_onionFunction · 0.85
decrypt_enctlvFunction · 0.85

Tested by

no test coverage detected