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
I've been looking into the canonicalisation recommendations for cbor, and realised it's going to be very difficult to implement those restrictions with serde. Also in my opinion using serde implies that you can encode and decode the data structures to any format, when really we want to just limit it to cbor. For that reason I think just implementing a to_cbor_bytes and from_cbor_bytes method on each struct would be best.
I've been looking into the canonicalisation recommendations for cbor, and realised it's going to be very difficult to implement those restrictions with serde. Also in my opinion using serde implies that you can encode and decode the data structures to any format, when really we want to just limit it to cbor. For that reason I think just implementing a
to_cbor_bytes
andfrom_cbor_bytes
method on each struct would be best.I've been looking at this crate as a good option to implement this:
https://twittner.gitlab.io/cbor-codec/cbor/index.html
The
GenericDecoder
appears to handle cbor canonicalisation properly, for example erroring if duplicate keys are found in a map.The text was updated successfully, but these errors were encountered: