Commit Graph

13 Commits

Author SHA1 Message Date
Pratyush Mishra
33a9da08f8 Switch to stable cargo formatting options 2020-04-07 19:30:27 -07:00
Pascal Berrang
8631f883c4 MNT4/6 curves and recursive SNARKs (#150)
* Add mnt6_753 curve
Generalize mnt6 curve model

* Add mnt4 curves

* Use resampled generators

* Calculate correct G2 cofactors

* Add fields to r1cs-std

* Add pairings

* Improve reusing of Fq/Fr among MNT curves

* Add instantiations of curves
Fix Fp6_2over3
Rebase code to current master

* Add test for recursive NIZK proof verification

* Address comments in PR

* Improve test case and port to GM17
Also fix a minor bug in to_field_vec
2020-04-04 10:50:46 -07:00
Pratyush Mishra
7adcc69799 Generalize FFT infrastructure to work with group elements as well 2020-02-28 18:10:00 -08:00
Pratyush Mishra
8bf042a029 Refactor algebra API, split into algebra and algebra-core. (#100) 2020-02-26 21:42:04 -08:00
Marek Kotewicz
9621bd34a4 r1cs-std works with no-std (#92) 2020-02-05 13:55:38 -08:00
François Garillot
b26867f267 Runs rustfmt on the repo 2020-01-27 11:44:23 -08:00
Pratyush Mishra
40cf13b7b8 num_traits:: -> algebra:: 2020-01-18 18:26:45 -08:00
François Garillot
722a901ae7 [RFC] Convert identity functions in Field, Group, and {Projective,Affine}Curve traits with One/Zero traits from num_traits.
- contributes to #50,
- depends on #53 and builds on it,
- due to coherence & requirements of `num_traits::{Zero, One}` to implement `std::ops::Add<Self, ..>` and (resp.) `std::ops::Mul<Self, ..>`, I've had to replace the afferent `impl<'a, P: ..> (Add|Mul)<&'a Self> for Group(Affine|Projective)<P>` by direct implementations on `Self`,
- I did not have to fight the borrow checker for this conversion => I think this hints arithmetic operations are called in contexts where the operand is owned,
- hence should this end up on a merge track, we may want to open an issue to convert the `impl<'a, P:..> (Neg|Sub|..)<&'a Self> for ..<P>` trait usage to direct `impl<P:..> (Neg|Sub|..)<Self> for ..<P>`
- the `impl AddAssign for GroupAffine<P>` in curves/models/short_weierstrass_jacobian.rs is provided to fit trait bounds, and without any guarantee of suitability for any particular purpose
- and that, even though I don't think it's used.
2020-01-17 11:22:41 -08:00
François Garillot
c42c7dd98a Remove a few unnecessary clones 2019-12-02 09:54:14 -08:00
François Garillot
10c6e85c1a Remove a few unnecessary .into_iter() explicit calls, and some cloning.
See https://rust-lang.github.io/rust-clippy/master/#explicit_into_iter_loop
2019-12-02 09:54:14 -08:00
Kobi Gurkan
581f3df55f Adds Bowe-Hopwood hash 2019-11-17 09:07:23 -08:00
Pratyush Mishra
c610ecbcc5 Update r1cs-std tests 2019-08-14 13:13:33 +03:00
Pratyush Mishra
e00d667330 Move snark-gadgets to r1cs-std 2019-08-14 13:13:33 +03:00