forked from joemphilips/DotNetLightning
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for custom initial fillers
All-zero initial packets should only be used for generating test vectors or other instances that requires deterministic packet generation also according to bolt #4, The packet is initialized with 1300 random bytes derived from a CSPRNG (ChaCha20). The pad key is used to extract additional random 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 generate 1300 random bytes. Those random bytes are then used as the starting state of the mix-header to be created. See more (https://github.com/lightningnetwork/lightning-rfc/blob/master/04-onion-routing.md#packet-construction)
- Loading branch information
Showing
2 changed files
with
18 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters