Closed 0xvon closed 8 months ago
Hi @0xvon . Thanks for pointing this out and proposing to help. The error is due to a deliberate design choice. It fails when all messages are being revealed which is quite unlikely in practice. But on rethinking, it should be allowed and the calling code should enforce this restriction if needed. So UnpackedBlindedMessages
needs to be changed. Also the test empty_proof
needs to be updated to not throw an error.
I agree with that! Let me try that issue. I'll send a PR today.
@lovesh
Btw, I found that ps_proof's prove_group bench uses the index i instead of j.
For that, when I bench for no less than 30 messages, index out of bounds
error causes.
Can I fix like this? I made sure that works.
--- a/benches/benches/ps_proof.rs
+++ b/benches/benches/ps_proof.rs
@@ -76,7 +76,7 @@ fn pok_sig_benchmark(c: &mut Criterion) {
let sig = &sigs_range[i];
let mut prove_group = c.benchmark_group(format!("Creating proof for Proof-of-knowledge of signature and corresponding multi-message of size {}", count));
- for (_j, r_count) in k.iter().enumerate() {
+ for (j, r_count) in k.iter().enumerate() {
prove_group.bench_with_input(
BenchmarkId::from_parameter(format!("Revealing {} messages", r_count)),
&r_count,
@@ -89,7 +89,7 @@ fn pok_sig_benchmark(c: &mut Criterion) {
.iter()
.enumerate()
.merge_join_by(
- revealed_indices[i].iter(),
+ revealed_indices[j].iter(),
|(m_idx, _), reveal_idx| m_idx.cmp(reveal_idx),
)
.map(|either| match either {
I created a PR for that two issues. Please check when you have time. https://github.com/docknetwork/crypto/pull/21
@0xvon Thanks for the PR. And yes, you are correct about the loop index j
. Thanks for fixing that too.
Hi I'm 0xvon. I'd like to compare some algorithms for blind signatures and its SPKs. That library especially seems to be so helpful for the performance analysis. However, I failed running ps_proof benchmark due to an error.
Issue Description
When I run the benchmark of ps signature's SPK whis that command:
The error causes with that message.
cause
I guess the function
UnpackedBlindedMessages::new()
doesn't allow empty messages.solution
I propose two directions to fix this issue. Can you please give me some comments for it? If you don't take time to fix that quickly, I can help.