-
Notifications
You must be signed in to change notification settings - Fork 59
refactor: guest bindings #1613
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
base: release-v1.2.1-rc.0
Are you sure you want to change the base?
refactor: guest bindings #1613
Conversation
1027e21
to
88bf100
Compare
56207ac
to
63931ab
Compare
2a47052
to
c9c0989
Compare
63931ab
to
6fbc163
Compare
cd66383
to
828553b
Compare
This comment has been minimized.
This comment has been minimized.
56c28d0
to
1d30696
Compare
This comment has been minimized.
This comment has been minimized.
fabaddf
to
656670c
Compare
656670c
to
bea1fb1
Compare
bea1fb1
to
4357ece
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, but don't merge because we will merge the other PR into this one
This comment has been minimized.
This comment has been minimized.
use halo2curves_axiom::ff; | ||
|
||
use crate::{field::Field, DivAssignUnsafe, DivUnsafe}; | ||
|
||
impl<'a, F: ff::Field> DivUnsafe<&'a F> for F { |
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.
it doesn't really matter, but what stopped you from doing a blanket implementation for all ff::Field
?
let mut is_less = 0u8.into(); | ||
// Iterate over limbs in little endian order and retain the result of the last non-equal comparison. | ||
for (x_limb, p_limb) in self.0.iter().zip(<Self as ::openvm_algebra_guest::IntMod>::MODULUS.iter()) { | ||
if x_limb < p_limb { |
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 think this is technically not constant time because of branching
It is weird to keep |
This reverts commit 6196617. cannot move because of phantom module
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.
Two follow-ups, but let's merge this first:
- constant time algorithms (constant time doesn't really make sense in zkvm context I think, but let's revisit)
- redundant code for k256.rs
This comment has been minimized.
This comment has been minimized.
…u64;limbs] field" This reverts commit 0201ee1.
Commit: fa869e0 |
This PR removes parts of the guest libraries for each extension. These libraries are to be moved into a new repo as part of the guest library re-org.
Summary of changes for each extension:
halo2curves_shims
module, along with a minimal set of constants remain in the openvm repo, while the bn254 and bls12_381 implementations were moved outsha256
andset_sha256
functions were deleted, leaving behind only the Rust bindingkeccak256
andset_keccak256
functions were deleted, leaving behind only the Rust bindingNotes:
mod_sqrt
implementation was moved from the ecc extension to the algebra extensionBenchmarks and examples are now outdated since they depend on guest libraries that no longer exist. These need to be redesigned and rewritten to use the new guest libraries. I wasn't able to easily port the benchmarks and examples because depending on the new guest libraries creates weird linker issues (I'm guessing due to double-importing openvm).
TODO:
Closes INT-3788