mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
sphinx: Variable left-shift when unwrapping onion
This is all it takes on the read side to use multiple frames. We are overshooting the padding a bit since we can at most use 16 additional frames, but ChaCha20 is cheap. Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
committed by
Rusty Russell
parent
7bc4cf83b1
commit
d607afd195
@@ -83,15 +83,24 @@ struct hop_data {
|
||||
struct short_channel_id channel_id;
|
||||
struct amount_msat amt_forward;
|
||||
u32 outgoing_cltv;
|
||||
/* Padding omitted, will be zeroed */
|
||||
u8 hmac[HMAC_SIZE];
|
||||
};
|
||||
|
||||
enum sphinx_payload_type {
|
||||
SPHINX_V0_PAYLOAD = 0,
|
||||
SPHINX_RAW_PAYLOAD = 255,
|
||||
};
|
||||
|
||||
struct route_step {
|
||||
enum route_next_case nextcase;
|
||||
struct onionpacket *next;
|
||||
struct hop_data hop_data;
|
||||
u8 realm;
|
||||
enum sphinx_payload_type type;
|
||||
union {
|
||||
struct hop_data v0;
|
||||
} payload;
|
||||
u8 *raw_payload;
|
||||
u8 payload_frames;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user