Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quic: further optimize packet number parser #3329

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ripatel-fd
Copy link
Contributor

For all valid QUIC v1 packets, there are at least 16 bytes after
the packet number field. (The AES-GCM MAC tag)

Thus, we can use a trailing read to make fd_quic_pktnum_decode
branchless.

For all valid QUIC v1 packets, there are at least 16 bytes after
the packet number field.  (The AES-GCM MAC tag)

Thus, we can use a trailing read to make fd_quic_pktnum_decode
branchless.
@ripatel-fd ripatel-fd force-pushed the ripatel/quic-pktnum-decode-opt branch from 4c86939 to 52f9c92 Compare November 6, 2024 08:42
@ripatel-fd ripatel-fd marked this pull request as ready for review November 6, 2024 09:16
Copy link
Contributor

@ptaffet-jump ptaffet-jump left a comment

Choose a reason for hiding this comment

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

Looks great! I'd keep sz a ulong. That's more normal, and I don't see any noticeable difference in the assembly it produces. I didn't do a fully exhaustive check though, so if you see a difference, I'm happy to stamp as is.

Copy link
Collaborator

@two-heart two-heart left a comment

Choose a reason for hiding this comment

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

lgtm from a security pov

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.

4 participants