sphinx: Add functions to decompress

Also implements a way to decompress an onion using the devtools/onion tool

Changelog-Added: devtools: The `onion` tool can now generate, compress and decompress onions for rendez-vous routing
This commit is contained in:
Christian Decker
2020-02-28 17:55:43 +01:00
committed by Rusty Russell
parent 4724d55e80
commit 49a3321d7e
3 changed files with 64 additions and 0 deletions

View File

@@ -246,6 +246,13 @@ u8 *serialize_compressed_onion(const tal_t *ctx,
bool sphinx_path_set_rendezvous(struct sphinx_path *sp,
const struct node_id *rendezvous_id);
/**
* Given a compressed onion expand it by re-generating the prefiller and
* inserting it in the appropriate place.
*/
u8 *sphinx_decompress(const tal_t *ctx, const u8 *compressed,
struct secret *shared_secret);
#if DEVELOPER
/* Override to force us to reject valid onion packets */
extern bool dev_fail_process_onionpacket;