mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
sphinx: Treat compressed onions as a standalone struct
Expands the interface to play with onions a bit more. Potentially a bit slower due to allocations, but that's a small price to pay. It also allows us to avoid serializing a compressed onion to `u8*` if we process it right away.
This commit is contained in:
committed by
Rusty Russell
parent
fd37c5b672
commit
e79cda8c9a
@@ -294,9 +294,11 @@ static void decompress(char *hexprivkey, char *hexonion)
|
||||
{
|
||||
struct privkey rendezvous_key;
|
||||
size_t onionlen = hex_data_size(strlen(hexonion));
|
||||
u8 *compressed, *decompressed;
|
||||
u8 *compressed;
|
||||
struct pubkey ephkey;
|
||||
struct secret shared_secret;
|
||||
struct onionpacket *onion;
|
||||
struct sphinx_compressed_onion *tinyonion;
|
||||
|
||||
if (!hex_decode(hexprivkey, strlen(hexprivkey), &rendezvous_key, sizeof(rendezvous_key)))
|
||||
errx(1, "Invalid private key hex '%s'", hexprivkey);
|
||||
|
||||
Reference in New Issue
Block a user