Skip to content

feat(ed25519): Add a feature to serialize with serde's bytes type#338

Closed
connec wants to merge 1 commit intoRustCrypto:masterfrom
connec:serde_as_bytes
Closed

feat(ed25519): Add a feature to serialize with serde's bytes type#338
connec wants to merge 1 commit intoRustCrypto:masterfrom
connec:serde_as_bytes

Conversation

@connec
Copy link
Copy Markdown
Contributor

@connec connec commented Jul 21, 2021

An alternative fix for #336 introducing a feature to swap between *_bytes and non-*_bytes serialization – the two are mutually exclusive!


This introduces a new feature, serde_as_bytes, that switches the
implementation of (de)serialization to use serde's *_bytes methods,
allowing crate consumers to opt-in to this approach which is beneficial
for formats with optimised byte array representations.

This has required a small change to the test workflow, since it's
necessary to test both with and without the serde_as_bytes feature.
The features cannot be made mutually exclusive, though logically they
are, without changing the serde feature flag, which would be
backwards-incompatible.

Fixes #336.

This introduces a new feature, `serde_as_bytes`, that switches the
implementation of (de)serialization to use serde's `*_bytes` methods,
allowing crate consumers to opt-in to this approach which is beneficial
for formats with optimised byte array representations.

This has required a small change to the test workflow, since it's
necessary to test both with and without the `serde_as_bytes` feature.
The features cannot be made mutually exclusive, though logically they
are, without changing the `serde` feature flag, which would be
backwards-incompatible.

Fixes #336.
@connec
Copy link
Copy Markdown
Contributor Author

connec commented Jul 21, 2021

Closing in favour of #337.

@connec connec closed this Jul 21, 2021
@connec connec deleted the serde_as_bytes branch July 21, 2021 15:41
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.

ed25519: Sub-optimal serialization for type-tagged formats

1 participant