You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Several of our crates have serde integrations, and it'd be nice to expand that.
One thing that'd be really nice to have is some common functionality for for writing serializers/deserializers which don't depend on serde_derive, particularly if this functionality could make writing serializers/deserializers declarative with #[serde(try_from = "...", into = "...")].
Some of the hard lessons were learned writing the serializers for the ed25519 crate which presently depends on the serde_bytes crate for serialization. That was largely a workaround for the inadequacies of the original tuple-based serializers, which resulted in bloated documents when generating CBOR.
Perhaps this could go in crypto-common? Some common concerns:
Lack of const generics support in serde and difficulty serializing arrays larger than 32 elements. serde_bytes addresses this somewhat, but it'd be nice not to have to loop in an additional dependency, and I think a simpler solution is possible.
Choosing what formats to optimize for: serializing a byte array as a tuple of N u8 elements makes for a compact bincode representation, but an extremely bloated CBOR serialization for example. We should have a single place to test commonly used binary serializers, and choose which ones we want to optimize for. I would suggest optimizing for CBOR at the cost of bincode.
Support for choosing different encodings for binary vs human readable formats: in several places, the elliptic-curve crate uses a hex serialization for "human readable" text-based formats like JSON/TOML, and binary otherwise. While I think this sort of autodetection should be opt-in, it'd be nice to have a single place where it's implemented.
The text was updated successfully, but these errors were encountered:
Context: RustCrypto/nacl-compat#27
Several of our crates have
serde
integrations, and it'd be nice to expand that.One thing that'd be really nice to have is some common functionality for for writing serializers/deserializers which don't depend on
serde_derive
, particularly if this functionality could make writing serializers/deserializers declarative with#[serde(try_from = "...", into = "...")]
.Some of the hard lessons were learned writing the serializers for the
ed25519
crate which presently depends on theserde_bytes
crate for serialization. That was largely a workaround for the inadequacies of the original tuple-based serializers, which resulted in bloated documents when generating CBOR.Perhaps this could go in
crypto-common
? Some common concerns:serde
and difficulty serializing arrays larger than 32 elements.serde_bytes
addresses this somewhat, but it'd be nice not to have to loop in an additional dependency, and I think a simpler solution is possible.u8
elements makes for a compactbincode
representation, but an extremely bloated CBOR serialization for example. We should have a single place to test commonly used binary serializers, and choose which ones we want to optimize for. I would suggest optimizing for CBOR at the cost of bincode.elliptic-curve
crate uses a hex serialization for "human readable" text-based formats like JSON/TOML, and binary otherwise. While I think this sort of autodetection should be opt-in, it'd be nice to have a single place where it's implemented.The text was updated successfully, but these errors were encountered: