-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
[zk-token-sdk] Refactor zk-token-elgamal
conversion code for authenticated encryption, range proof, and sigma proof types
#31855
[zk-token-sdk] Refactor zk-token-elgamal
conversion code for authenticated encryption, range proof, and sigma proof types
#31855
Conversation
Codecov Report
@@ Coverage Diff @@
## master #31855 +/- ##
=========================================
- Coverage 81.9% 81.9% -0.1%
=========================================
Files 752 752
Lines 206799 206751 -48
=========================================
- Hits 169480 169398 -82
- Misses 37319 37353 +34 |
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.
Couple comment nits
|
||
/// Serialization of range proofs for 64-bit numbers (for `Withdraw` instruction) | ||
/// The `RangeProof` type as a `Pod` restricted to proofs on 64-bit numbers. | ||
#[derive(Clone, Copy)] | ||
#[repr(transparent)] | ||
pub struct RangeProof64(pub [u8; 672]); |
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.
If it's not too late, could we rename these to ...U64
to match the instructions and other types? (different PR)
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.
Yes, I was going to do that. I don't think SPL or any of the dependencies use range proof types directly, so I think it should be okay.
…ticated encryption, range proof, and sigma proof types (#31855) * refactor convert logic for `AeCiphertext` * refactor convert logic for `RangeProof` * refactor convert logic for sigma proof types * Apply suggestions from code review Co-authored-by: Tyera <[email protected]> --------- Co-authored-by: Tyera <[email protected]> (cherry picked from commit e4fe933)
… authenticated encryption, range proof, and sigma proof types (backport of #31855) (#31887) [zk-token-sdk] Refactor `zk-token-elgamal` conversion code for authenticated encryption, range proof, and sigma proof types (#31855) * refactor convert logic for `AeCiphertext` * refactor convert logic for `RangeProof` * refactor convert logic for sigma proof types * Apply suggestions from code review Co-authored-by: Tyera <[email protected]> --------- Co-authored-by: Tyera <[email protected]> (cherry picked from commit e4fe933) Co-authored-by: samkim-crypto <[email protected]>
Problem
This is a follow-up to #31846 on refactoring conversion logic in
convert.rs
(#31813).Summary of Changes
Try
andTryFrom
implementation for authenticated encryption type tozk_token_elgamal::auth_encryption
Try
andTryFrom
implementation for range proof types tozk_token_elgamal::range_proof
Try
andTryFrom
implementation for sigma proof types tozk_token_elgamal::sigma_proofs
Fixes #