-
Notifications
You must be signed in to change notification settings - Fork 20
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
Leave serde
as the only serialization method
#110
Conversation
cef0307
to
073f472
Compare
Codecov Report
@@ Coverage Diff @@
## master #110 +/- ##
==========================================
- Coverage 51.12% 48.44% -2.68%
==========================================
Files 17 17
Lines 1160 997 -163
==========================================
- Hits 593 483 -110
+ Misses 567 514 -53
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
what does |
It's the standard format for serializing signatures or certificates, see https://en.wikipedia.org/wiki/X.690#DER_encoding |
// TODO: for a slightly better user experience we can remove qualifiers here, | ||
// because the returned string will be something like "crate_name::module_name::TypeName" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally have nothing against fully-qualified names in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
serde_bytes module may be better extracted into its own crate or added to some existing bytes-handling crate for serde
Rings a bell, serde-bytes-repr
Yes, there is a bunch - see serde-rs/bytes#37 (comment). |
Fixes #109
Fixes #95 (or at least invalidates it)
See nucypher/nucypher-core#41 for the preview of how it will affect
nucypher-core
Changes:
HasTypeName
trait, and useany::type_name()
where some name is still required.serde::Serialize
/Deserialize
implementations forCaspule
,(Verified)CapsuleFrag
,(Verified)KeyFrag
,PublicKey
, andSignature
.VerifiedCapsuleFrag::from_verified_bytes()
andVerifiedKeyFrag::from_verified_bytes()
. For this behavior, deserialize intoCapsuleFrag
orKeyFrag
and callskip_verification()
.DeserializableFromArray
,RepresentableAsArray
,SerializableToArray
,SerializableToSecretArray
.DefaultSerialize
/DefaultDeserialize
for Umbral objects (Caspule
,(Verified)CapsuleFrag
,(Verified)KeyFrag
) which uses MessagePack viaserde
(gated bydefault-serialization
feature). This is what the serialization methods in the bindings use.to_compressed_bytes()
/try_from_compressed_bytes()
forPublicKey
to give access to non-serde representation (just 33 bytes). These are exposed in the bindings in lieu of the "default" methods (e.g.__bytes__()
ortoBytes()
).to_der_bytes()
/try_from_der_bytes()
forSignature
to give access to non-serde representation. These are exposed in the bindings in lieu of the "default" methods (e.g.__bytes__()
ortoBytes()
).SecretKeyFactory::make_secret()
to provide a more straightforward replacement ofSecretKeyFactory::make_secret_key()
->SecretKey::to_secret_bytes()
.Capsule
no longer implementsCopy
(it's ~128 bytes, I don't think it's wise to have it)Internal changes:
Serialize
/Deserialize
implementations forCurveScalar
andCurvePoint
.Remains to be decided:
serde_bytes
module may be better extracted into its own crate or added to some existing bytes-handling crate forserde