-
Notifications
You must be signed in to change notification settings - Fork 1
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
refac: upstream latest plonky2 #7
Conversation
1a09f28
to
67e7e4e
Compare
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!
Cargo.toml
Outdated
@@ -13,7 +13,7 @@ ark-std = "0.4.0" | |||
num-bigint = "0.4.3" | |||
num-traits = "0.2" | |||
rand = "0.8.5" | |||
plonky2_ecdsa = { git = "https://github.com/Lagrange-Labs/plonky2-ecdsa", features = [ | |||
plonky2_ecdsa = { git = "https://github.com/Lagrange-Labs/plonky2-ecdsa", rev = "5dd47af", features = [ |
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.
May need to update after merging PR Lagrange-Labs/plonky2-ecdsa#3.
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.
Updated in commit c37edcd. Thanks!
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.
Approve for sake of time but left a comment, doesn't seem necessary to me this new function but maybe i'm missing something.
And Lagrange-Labs/plonky2-ecdsa#3 have been merged so you can update deps 🙏
src/fields/fq_target.rs
Outdated
} | ||
} | ||
|
||
fn compare_same_length( |
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.
Sorry I fail to see why the two functions are different - if you give same length inputs to the compare_different_lengths
then it should be returning the same no ?
I think the only change required is to move if lhs.len() < rhs.len()
to if lhs.len() <= rhs.len()
.
In case it's equal for &limb in longer.iter().skip(shorter.len()) {
will never run so it'll give the same results no ?
TLDR do we really need this new function ?
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.
Makes sense, it could be simplified as you said. Fixed in commit 698cc66, thanks!
* Update `plonky2`. * Delete the useless patch `plonky2_field`. * refac: upstream latest plonky2 (#7) * fix: add fq comparison logic with different limb length * build: fix plonky2_ecdsa rev * build: remove rev from plonky2_ecdsa deps * refac: simplify conditions without using helper functions --------- Co-authored-by: Merlyn <[email protected]>
This PR includes changes to make it compatible with latest Plonky2.