1
0
mirror of https://github.com/lightning/bolts.git synced 2024-11-19 01:50:03 +01:00

bolt04: minor JSON fix and generate the exact number of bytes for the padding

This commit is contained in:
Christian Decker 2020-01-21 17:42:07 +01:00
parent 8dd0b75809
commit 7c1edeb063
2 changed files with 3 additions and 3 deletions

View File

@ -509,11 +509,11 @@ The construction returns a single 1366-byte packet along with the first receivin
The packet construction is performed in the reverse order of the route, i.e. The packet construction is performed in the reverse order of the route, i.e.
the last hop's operations are applied first. the last hop's operations are applied first.
The packet is initialized with 1366 _random_ bytes derived from a CSPRNG The packet is initialized with 1300 _random_ bytes derived from a CSPRNG
(ChaCha20). The _pad_ key referenced above is used to extract additional random (ChaCha20). The _pad_ key referenced above is used to extract additional random
bytes from a ChaCha20 stream, using it as a CSPRNG for this purpose. Once the bytes from a ChaCha20 stream, using it as a CSPRNG for this purpose. Once the
`paddingKey` has been obtained, ChaCha20 is used with an all zero nonce, to `paddingKey` has been obtained, ChaCha20 is used with an all zero nonce, to
generate 1366 random bytes. Those random bytes are then used as the starting generate 1300 random bytes. Those random bytes are then used as the starting
state of the mix-header to be created. state of the mix-header to be created.
A filler is generated (see [Filler Generation](#filler-generation)) using the A filler is generated (see [Filler Generation](#filler-generation)) using the

View File

@ -47,7 +47,7 @@
"payload": "0404040404040404000000000000000400000004000000000000000000000000", "payload": "0404040404040404000000000000000400000004000000000000000000000000",
"rhokey": "034e18b8cc718e8af6339106e706c52d8df89e2b1f7e9142d996acf88df8799b", "rhokey": "034e18b8cc718e8af6339106e706c52d8df89e2b1f7e9142d996acf88df8799b",
"mukey": "8e45e5c61c2b24cb6382444db6698727afb063adecd72aada233d4bf273d975a", "mukey": "8e45e5c61c2b24cb6382444db6698727afb063adecd72aada233d4bf273d975a",
"hmac": "16d4553c6084b369073d259381bb5b02c16bb2c590bbd9e69346cf7ebd563229 "hmac": "16d4553c6084b369073d259381bb5b02c16bb2c590bbd9e69346cf7ebd563229"
} }
] ]
}, },