-
Notifications
You must be signed in to change notification settings - Fork 0
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: new protocol for zk paillier encryption in range with el gamal … #3
base: m
Are you sure you want to change the base?
feat: new protocol for zk paillier encryption in range with el gamal … #3
Conversation
//! # mod pregenerated { | ||
//! # use super::*; | ||
//! # paillier_zk::load_pregenerated_data!( | ||
//! # verifier_aux: p::Aux, | ||
//! # prover_decryption_key: fast_paillier::DecryptionKey, | ||
//! # ); | ||
//! # } | ||
//! # fn main() -> Result<(), Box<dyn std::error::Error>> { |
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 don't think these lines are providing any useful info.
//! let shared_state = "some shared state"; | ||
//! | ||
//! let mut rng = rand_core::OsRng; | ||
//! # let mut rng = rand_dev::DevRng::new(); |
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.
//! # let mut rng = rand_dev::DevRng::new(); |
Same here
//! let a = Integer::from_rng_pm(&(Integer::ONE << security.l).complete(), &mut rng); | ||
//! let b = Integer::from_rng_pm(&(Integer::ONE << security.l).complete(), &mut 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.
Same discussion as here: I think you should use the curve order instead and the get_invertible
.
{ | ||
fail_if_ne( | ||
InvalidProofReason::EqualityCheck(1), | ||
&data.ciphertext.gcd_ref(data.key.n()).complete(), | ||
Integer::ONE, | ||
)?; |
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 this condition wrt the paper? Can you add a comment here?
// let s_to_e: Integer = commitment | ||
// .s | ||
// .pow_mod_ref(challenge, &aux.rsa_modulo) | ||
// .ok_or(BadExponent::undefined())? | ||
// .into(); |
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.
// let s_to_e: Integer = commitment | |
// .s | |
// .pow_mod_ref(challenge, &aux.rsa_modulo) | |
// .ok_or(BadExponent::undefined())? | |
// .into(); |
let a = Integer::from_rng_pm(&(Integer::ONE << security.l).complete(), &mut rng); | ||
let b = Integer::from_rng_pm(&(Integer::ONE << security.l).complete(), &mut 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.
Same as above. Use the curve order instead
let plaintext = (Integer::ONE << (security.l + security.epsilon)).complete() + 1; | ||
let a = Integer::from_rng_pm(&(Integer::ONE << security.l).complete(), &mut rng); | ||
let b = Integer::from_rng_pm(&(Integer::ONE << security.l).complete(), &mut rng); | ||
let r = run_with::<C, D>(&mut rng, security, plaintext, a,b).expect_err("proof should not pass"); |
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.
let r = run_with::<C, D>(&mut rng, security, plaintext, a,b).expect_err("proof should not pass"); | |
let r = run_with::<C, D>(&mut rng, security, plaintext, a, b).expect_err("proof should not pass"); |
let plaintext = Integer::from_rng_pm(&(Integer::ONE << security.l).complete(), &mut rng); | ||
let a = Integer::from_rng_pm(&(Integer::ONE << security.l).complete(), &mut rng); | ||
let b = Integer::from_rng_pm(&(Integer::ONE << security.l).complete(), &mut rng); | ||
run_with::<C, D>(&mut rng, security, plaintext,a, b).expect("proof failed"); |
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.
run_with::<C, D>(&mut rng, security, plaintext,a, b).expect("proof failed"); | |
run_with::<C, D>(&mut rng, security, plaintext, a, b).expect("proof failed"); |
…commitment