dalek-cryptography / bulletproofs

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

Merge main into develop #277

Closed hdevalence closed 5 years ago

hdevalence commented 5 years ago

This updates the develop branch with R1CS code to include the extra validation changes made in the main branch for 1.0.2.

hdevalence commented 5 years ago

Ah, looks like this doesn't quite work, because of the lack of error conversions...

hdevalence commented 5 years ago

Updated. There's an issue with the R1CS benchmarks -- it looks like they fell out of sync with the RandomizedConstraintSystem / RandomizableConstraintSystem change.

In the long term, I think that it would be better to combine R1CSError with ProofError, if we can do that without breaking stability. If not, we should refactor the TranscriptProtocol so that it returns a TranscriptError type that can be converted into either a ProofError or an R1CSError. For now I would prefer to keep the "bad conversion" and then remove it later by one of those two means.

rubdos commented 5 years ago

Have you considered using something like failure for the exported error types? In my experience it aids with three things:

  1. Rapid writing of new errors using bail!() et al., if you're prototyping something new.
  2. Easily returning "generic" errors using the Error struct and ? ...
  3. ... while it still allows to return non-generic errors (if performance might be at stake).
hdevalence commented 5 years ago

Yep, we are using failure, but we don't want to use Error because it's not as lightweight as we'd like. I think that the correct fix is to add a TranscriptError type.

hdevalence commented 5 years ago

We should probably update and merge this branch before merging #280. I think the things left to do here are:

hdevalence commented 5 years ago

Fixed the R1CS benchmarks.

hdevalence commented 5 years ago

Moved the error item into #286, let's fix it there instead of here.