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

serde_extensions: Add helper methods for serialization #179

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

robin-nitrokey
Copy link
Member

This patch adds helper methods to the Extension trait for serializing and deserializing requests and replies. This has two benefits:

  1. It makes clear how requests and replies are serialized and that the format is not part of the public API.
  2. It leads to a small decrease in binary size for the Nitrokey 3 firmware (ca. 2 kB) by marking these helpers as #[inline(never)]. My guess is that serialization was duplicated if mulitple backends implement the same extension.

This patch adds helper methods to the Extension trait for serializing
and deserializing requests and replies.  This has two benefits:

1. It makes clear how requests and replies are serialized and that the
   format is not part of the public API.
2. It leads to a small decrease in binary size for the Nitrokey 3
   firmware (ca. 2 kB) by marking these helpers as #[inline(never)].  My
   guess is that serialization was duplicated if mulitple backends
   implement the same extension.
@robin-nitrokey robin-nitrokey merged commit 459e5b4 into main Nov 4, 2024
2 checks passed
@robin-nitrokey robin-nitrokey deleted the ext-serde branch November 4, 2024 10:08
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