-
Notifications
You must be signed in to change notification settings - Fork 129
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
hybrid-array: Added serde impls for Array
#979
Conversation
It looks like some tests whose MSRV hasn't been bumped have a problem with this |
Array
Array
We've been there and back again with the various tradeoffs of There is so much errata involved here across various serde-based format implementations that I have trouble keeping it all in my head. The array serializers look like this: https://github.com/RustCrypto/formats/blob/master/serdect/src/array.rs We tried to use the tuple serializers initially to avoid the length prefix, but it turns out those have terrible interactions with MessagePack because serde lacks the ability to describe homogenously typed tuples. I guess the question is whether we should worry about these particular issues in the context of this crate, namely formats like MessagePack will do a lot of branching on the data and encode it oddly because they have to encode type information for each entry in the tuple, rather than storing it in one place. p.s. I am very, very tired of reviewing serde-related code. Just when I think I understand what's happening I discover yet another fun new surprise. |
We can definitely bump MSRV on |
I'm kind of in agreement here. I think we don't necessarily have to expect If you want to keep |
In this same vein. I thing maybe |
|
I'd love to switch
hpke
over tohybrid-array
, since it's becoming pretty hard to manually auditgeneric-array
, and we expose it so it's not like we can get away with leaving it old forever.One of the really convenient things that
generic-array
provides, though, isSerialize
/Deserialize
impls forGenericArray
. We use this in our Xyber impl. The only other option for autoderiving these traits isserde-bigarray
(upstream support is not coming any time soon), and I'd rather not bring it in.This PR should bring
hybrid-array
a little closer to feature-parity withgeneric-array
. I don't love theunsafe
stuff here, but it's pretty minimal and well-documented, and also has a clear roadmap for removing it once certain functions stabilize.