| 99 | } |
| 100 | |
| 101 | static void test_decrypt(const struct pubkey *path_key, |
| 102 | const u8 *enctlv, |
| 103 | const struct privkey *me, |
| 104 | const struct pubkey *expected_next_node, |
| 105 | const struct privkey *expected_next_path_key_priv) |
| 106 | { |
| 107 | struct pubkey expected_next_path_key, dummy, next_path_key; |
| 108 | struct secret ss; |
| 109 | struct tlv_encrypted_data_tlv *enc; |
| 110 | |
| 111 | /* We don't actually have an onion, so we put some dummy */ |
| 112 | pubkey_from_privkey(me, &dummy); |
| 113 | |
| 114 | mykey = me; |
| 115 | assert(unblind_onion(path_key, test_ecdh, &dummy, &ss)); |
| 116 | enc = decrypt_encrypted_data(tmpctx, &ss, enctlv); |
| 117 | assert(enc); |
| 118 | |
| 119 | pubkey_from_privkey(expected_next_path_key_priv, &expected_next_path_key); |
| 120 | blindedpath_next_path_key(enc, path_key, &ss, &next_path_key); |
| 121 | assert(pubkey_eq(&next_path_key, &expected_next_path_key)); |
| 122 | assert(pubkey_eq(enc->next_node_id, expected_next_node)); |
| 123 | } |
| 124 | |
| 125 | static void test_final_decrypt(const struct pubkey *path_key, |
| 126 | const u8 *enctlv, |
no test coverage detected