[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.
4 years ago |
|
[package] name = "r1cs-std" version = "0.1.0" authors = [ "Sean Bowe", "Alessandro Chiesa", "Matthew Green", "Ian Miers", "Pratyush Mishra", "Howard Wu" ] description = "A standard library for constraint system gadgets" homepage = "https://libzexe.org" repository = "https://github.com/scipr/zexe" documentation = "https://docs.rs/r1cs-std/" keywords = ["zero knowledge", "cryptography", "zkSNARK", "SNARK"] categories = ["cryptography"] include = ["Cargo.toml", "src", "README.md", "LICENSE-APACHE", "LICENSE-MIT"] license = "MIT/Apache-2.0" edition = "2018"
################################# Dependencies ################################
[dependencies] algebra = { path = "../algebra" } r1cs-core = { path = "../r1cs-core" } derivative = "1" num-traits = { version = "0.2.11" } radix_trie = "0.1"
[dev-dependencies] rand = { version = "0.7" } rand_xorshift = { version = "0.2" }
|