mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
sphinx: Moving HMAC to the end of the packet
Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
parent
157c2da778
commit
652d999dbd
@ -70,8 +70,8 @@ u8 *serialize_onionpacket(
|
||||
|
||||
write_buffer(dst, &m->version, 1, &p);
|
||||
write_buffer(dst, der, outputlen, &p);
|
||||
write_buffer(dst, m->mac, sizeof(m->mac), &p);
|
||||
write_buffer(dst, m->routinginfo, ROUTING_INFO_SIZE, &p);
|
||||
write_buffer(dst, m->mac, sizeof(m->mac), &p);
|
||||
return dst;
|
||||
}
|
||||
|
||||
@ -100,8 +100,8 @@ struct onionpacket *parse_onionpacket(
|
||||
if (secp256k1_ec_pubkey_parse(secp256k1_ctx, &m->ephemeralkey, rawEphemeralkey, 33) != 1)
|
||||
return tal_free(m);
|
||||
|
||||
read_buffer(&m->mac, src, 20, &p);
|
||||
read_buffer(&m->routinginfo, src, ROUTING_INFO_SIZE, &p);
|
||||
read_buffer(&m->mac, src, 20, &p);
|
||||
return m;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user