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

Coconut Proof allows empty blinding messages #21

Merged
merged 6 commits into from
Nov 6, 2023

Conversation

0xvon
Copy link
Contributor

@0xvon 0xvon commented Nov 6, 2023

Issue

#20

What I do

  • change UnpackedBlindedMessages impl to return empty proof even if blinding message is empty
  • change ps_proof's proving to use the index not i but j

@0xvon 0xvon mentioned this pull request Nov 6, 2023
let pok = MessagesPoKGenerator::init(&mut rng, &[], &params, &h)
.unwrap();

let mut chal_bytes_prover = vec![];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you are using the same variables for prover's and verifier's challenge, they should not have suffix _prover, chal_bytes is good.

@@ -178,7 +178,7 @@ impl<'pair, Pair, F: PrimeField> UnpackedBlindedMessages<'pair, Pair, F> {
let (paired, (msgs, blindings)): (Vec<_>, _) =
process_results(paired, |iter| iter.unzip())?;
if paired.is_empty() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove this if block as the last else block will return the desired result.

);
let pok = SignaturePoKGenerator::init(&mut rng, &[], &sig, &pk, &params).unwrap();

let mut chal_bytes_prover = vec![];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar comment as above on naming.

@0xvon
Copy link
Contributor Author

0xvon commented Nov 6, 2023

@lovesh Thank you so much for your quick feedbacks! I modified for all of your comments!

@lovesh
Copy link
Member

lovesh commented Nov 6, 2023

@0xvon I have fixed the failing tests in this commit but I am not able to edit this PR even when this PR is marked appropriately. Can you please get these changes in your PR? Thanks

@0xvon
Copy link
Contributor Author

0xvon commented Nov 6, 2023

@0xvon I have fixed the failing tests in this commit but I am not able to edit this PR even when this PR is marked appropriately. Can you please get these changes in your PR? Thanks

I pushed!

@lovesh lovesh merged commit 25b7339 into docknetwork:main Nov 6, 2023
5 checks passed
@lovesh
Copy link
Member

lovesh commented Nov 6, 2023

Thank you @0xvon for the contribution.

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 this pull request may close these issues.

None yet

2 participants