| 107 | } |
| 108 | |
| 109 | static 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 | |
| 131 | int main(int argc, char *argv[]) |
| 132 | { |
no test coverage detected