-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Add custom Serialize/Deserialize impl for EphemeralPublicKey, Pepper, Groth16ZkpAndStatement, G1Bytes, and G2Bytes, which output hex when used to serialize json #12295
Merged
rex1fernando
merged 21 commits into
main
from
rex/add_epk_and_pepper_deserialization_hex
Mar 1, 2024
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…er so that serde_json serializes as hex, while bcs still serializes normally
alinush
approved these changes
Feb 29, 2024
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.
Be sure to run ./scripts/rust_lint.sh
since, judging from the authenticator.rs
changes, I think you might've linted with an older cargo
or rustc
...
heliuchuan
reviewed
Feb 29, 2024
heliuchuan
approved these changes
Feb 29, 2024
…G1Bytes, and G2Bytes so that things serialize as hex when using a human-readable target format. Add tests for the above and for Pepper.
…om:aptos-labs/aptos-core into rex/add_epk_and_pepper_deserialization_hex
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
alinush
reviewed
Mar 1, 2024
alinush
reviewed
Mar 1, 2024
alinush
reviewed
Mar 1, 2024
alinush
reviewed
Mar 1, 2024
alinush
reviewed
Mar 1, 2024
alinush
reviewed
Mar 1, 2024
alinush
reviewed
Mar 1, 2024
alinush
reviewed
Mar 1, 2024
…zation. Add tests for G1Bytes and G2Bytes, and do length sanity checks during tests.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…om:aptos-labs/aptos-core into rex/add_epk_and_pepper_deserialization_hex
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
alinush
pushed a commit
that referenced
this pull request
Mar 4, 2024
… Groth16ZkpAndStatement, G1Bytes, and G2Bytes, which output hex when used to serialize json (#12295) * Expose G1Bytes and G2Bytes * Expose g{1,2}_projective_str_to_affine * Expose g{1,2}_projective_str_to_affine * Rename jwk method * typo * Add custom Serialize/Deserialize impl for EphemeralPublicKey and Pepper so that serde_json serializes as hex, while bcs still serializes normally * rust fmt * Lint fixes * Add custom serialization/deserialization for Groth16ZkpAndStatement, G1Bytes, and G2Bytes so that things serialize as hex when using a human-readable target format. Add tests for the above and for Pepper. * rust linter corrections * Add copyright * Remove to_hex and from_hex, and don't panic on unsuccessful deserialization. Add tests for G1Bytes and G2Bytes, and do length sanity checks during tests. * remove from_hex and to_hex from EphemeralPublicKey
alinush
added a commit
that referenced
this pull request
Mar 4, 2024
* Add custom Serialize/Deserialize impl for EphemeralPublicKey, Pepper, Groth16ZkpAndStatement, G1Bytes, and G2Bytes, which output hex when used to serialize json (#12295) * e2e Move tests for keyless + feature gating (#12296) * add support for passkey-based EPKs & merge non-malleability signature into ephemeral signature (#12333) Co-authored-by: Rex Fernando <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds Serialize/Deserialize implementations for the following types:
instead of using the derive macros. The purpose of this is so that serde_json serializes these two types as hex strings, while bcs behavior is still preserved.
Test plan
This PR includes a new module
aptos_types::unit_tests::keyless_serialization_test
, which has test cases to test the new serialization/deserialization behavior for each of the types above.