Skip to content
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

The problem of scope proof failure #25

Open
china-tomcheng opened this issue Aug 10, 2021 · 2 comments · May be fixed by #26
Open

The problem of scope proof failure #25

china-tomcheng opened this issue Aug 10, 2021 · 2 comments · May be fixed by #26

Comments

@china-tomcheng
Copy link

The proof generated by RangeProofNi sometimes fails, try to loop many times, and some of the proof results are false

@omershlo
Copy link
Contributor

Thank you! do you have some test code that can help us understand where it fails?
how many times you run the proof until it fails?

@china-tomcheng
Copy link
Author

  let tom_key = common::tom_keypair();
    for _ in 1..100 {
        let range = BigInt::from(6000);
        let nonce = BigInt::sample_below(&tom_key.0.n);
        let hide_value = BigInt::sample_below(&range.div_floor(&BigInt::from(3)));
        let hide_data = Paillier::encrypt_with_chosen_randomness(
            &tom_key.0,
            RawPlaintext::from(&hide_value),
            &Randomness(nonce.clone()),
        );
        let range_proof = RangeProofNi::prove(&tom_key.0, &range, &hide_data.0, &hide_value, &nonce);
        let result = range_proof.verify(&tom_key.0, &hide_data.0);
        println!("result:{}", result.is_ok());
    }

@survived survived linked a pull request Aug 10, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants