-
Notifications
You must be signed in to change notification settings - Fork 158
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
feat(zk): implement faster pke proof #1302
Conversation
cargo builds is red, could be good to have a review with JB potentially |
b3cd597
to
d56f3f8
Compare
tfhe-zk-pok/src/proofs/mod.rs
Outdated
pub mod pke_v2 { | ||
pub use super::pke_v2_impl::*; | ||
|
||
pub use super::pke_v2_impl::crs_gen_cs as crs_gen; | ||
} |
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.
what is the reason for the indirection here from pke_v2 to pke_v2_impl ?
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.
just cause i wanted a quick way to swap out pke for pke_v2 for benchmarks. i'll fix it
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.
got it
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 removed the indirection
tfhe-zk-pok/src/curve_api.rs
Outdated
#[cfg(target_family = "wasm")] | ||
{ | ||
msm::msm_wnaf_g1_446(bases, scalars) | ||
} | ||
#[cfg(not(target_family = "wasm"))] | ||
{ | ||
Self::Affine::multi_mul_scalar(bases, scalars) | ||
} |
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.
is the if cfg!(target_family = "wasm") {
usable here ? I think it makes it easier to read
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.
yeah
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.
fixed
#[track_caller] | ||
fn multi_mul_scalar(bases: &[Self::Affine], scalars: &[bls12_446::Zp]) -> Self { |
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.
this function can fail ?
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.
same question elsewhere
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.
yeah, if the slices aren't the same size
d56f3f8
to
e710f13
Compare
this will need a rebase to have proper CI |
t: u64, | ||
rng: &mut dyn RngCore, | ||
) -> PublicParams<G> { | ||
crs_gen_cs(d, k, B, q, t, rng) |
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.
what's the cs vs. ghl notation ? It seems the CRS we use in the test is the ghl one ? @sarah-ek
e710f13
to
a8944a8
Compare
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: sarah el kazdadi.
|
- original work by Sarah El kazdadi co-authored-by: sarah el kazdadi <sarah.elkazdadi@zama.ai>
a8944a8
to
6c68ae8
Compare
PR content/description
implements Benoit's new private key encryption zk proof
Check-list: