Skip to content

sphinx: Actually use the pad stream to generate the packet#3427

Merged
cdecker merged 3 commits into
ElementsProject:masterfrom
cdecker:sphinx-spec-padding
Jan 27, 2020
Merged

sphinx: Actually use the pad stream to generate the packet#3427
cdecker merged 3 commits into
ElementsProject:masterfrom
cdecker:sphinx-spec-padding

Conversation

@cdecker
Copy link
Copy Markdown
Member

@cdecker cdecker commented Jan 21, 2020

Turns out #3246 did not actually do anything. We flipped two buffers and were not actually using the chacha20 stream. The buffer we were initializing with the chacha20 stream was simply being overwritten in the next iteration. We need to initialize the packet->routinginfo instead.

Keeping this as a draft until we've resolved the broken test-vectors in lightning/bolts#697

Changelog-None

@cdecker cdecker force-pushed the sphinx-spec-padding branch 2 times, most recently from 6d0b7a1 to f64e015 Compare January 22, 2020 11:03
@cdecker cdecker marked this pull request as ready for review January 24, 2020 17:17
@cdecker
Copy link
Copy Markdown
Member Author

cdecker commented Jan 24, 2020

This is now ready for review.

Ping @ZmnSCPxj and @rustyrussell

Copy link
Copy Markdown
Contributor

@ZmnSCPxj ZmnSCPxj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK f64e015

We flipped two buffers and were not actually using the chacha20 stream.
We were for some reason encoding all payloads as raw payloads instead of
loading legacy payloads into a padded array.
This avoids having to re-serialize the block header just to compute the
hash. It also frees us from having to carry around all the details in the
header and we can hand around a minimal version.
@cdecker cdecker force-pushed the sphinx-spec-padding branch from f64e015 to 2368e8a Compare January 27, 2020 20:19
@cdecker
Copy link
Copy Markdown
Member Author

cdecker commented Jan 27, 2020

Re-applying @ZmnSCPxj's ack:

ACK 2368e8a

@cdecker cdecker merged commit c2434ad into ElementsProject:master Jan 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants