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

Shrink the size of ServerHandshake::EncryptedExtensions #146

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

GnomedDev
Copy link
Contributor

This shrinks the size of:

  • ServerHandshake::EncryptedExtensions by shrinking
  • EncryptedExtensionsExtension::SupportedGroups (stored 16 times) by shrinking
  • NamedGroup (stored 10 times) from a u16 to a u8

by allowing the compiler to pick it's own discriminants and converting from them to the real values in a new NamedGroup::as_u16.

This results in (on 32 bit targets) a shrink from 456 bytes to 328 bytes for ServerHandshake.

Copy link
Member

@lulf lulf left a comment

Choose a reason for hiding this comment

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

Awesome, thanks!

@GnomedDev GnomedDev mentioned this pull request Aug 1, 2024
@lulf lulf merged commit 6772c60 into drogue-iot:main Aug 1, 2024
1 check failed
@GnomedDev GnomedDev deleted the fix-large-serverhandshake branch August 1, 2024 12:18
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