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

Function test_final_decrypt

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

Source from the content-addressed store, hash-verified

107}
108
109static void test_final_decrypt(const struct pubkey *blinding,
110 const u8 *enctlv,
111 const struct privkey *me,
112 const struct pubkey *expected_alias,
113 const struct secret *expected_self_id)
114{
115 struct pubkey my_pubkey, dummy, alias;
116 struct secret ss, *self_id;
117
118 /* We don't actually have an onion, so we put some dummy */
119 pubkey_from_privkey(me, &dummy);
120
121 mykey = me;
122 pubkey_from_privkey(me, &my_pubkey);
123 assert(unblind_onion(blinding, test_ecdh, &dummy, &ss));
124 assert(decrypt_final_enctlv(tmpctx, blinding, &ss, enctlv, &my_pubkey,
125 &alias, &self_id));
126
127 assert(pubkey_eq(&alias, expected_alias));
128 assert(secret_eq_consttime(self_id, expected_self_id));
129}
130
131int main(int argc, char *argv[])
132{

Callers 1

mainFunction · 0.85

Calls 4

pubkey_from_privkeyFunction · 0.85
unblind_onionFunction · 0.85
decrypt_final_enctlvFunction · 0.85
secret_eq_consttimeFunction · 0.85

Tested by

no test coverage detected