dalek-cryptography / bulletproofs

A pure-Rust implementation of Bulletproofs using Ristretto.
MIT License
1.02k stars 216 forks source link

R1CS: Add `constraints_len`, `deferred_constraints_len` and `total_constraints_len` #322

Closed rubdos closed 4 years ago

rubdos commented 4 years ago

Add methods to count the different kinds of constraints, which comes in handy when developing and benchmarking larger circuits. This is analogue with #284, ConstraintSystem::multipliers_len().

rubdos commented 4 years ago

Made a r1cs::Metrics struct instead!

rubdos commented 4 years ago

Squashed together; didn't make any sense anymore as separate commits. Note that this removes multipliers_len, as suggested by @oleganza .

oleganza commented 4 years ago

I've added documentation suggestions - please feel free to reword how you please. This patch looks great!

rubdos commented 4 years ago

I hadn't seen your update, I have accepted your suggestions!

oleganza commented 4 years ago

Nightly is already broken for everyone using dalek libraries since Rust renamed asm! macro to llvm_asm!, which breaks subtle (https://github.com/dalek-cryptography/subtle/pull/70), so I'm merging this PR even with CI failing on nightly.