mirror of
https://github.com/arnaucube/ark-r1cs-std.git
synced 2026-01-12 00:41:32 +01:00
[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.
This commit is contained in:
committed by
Pratyush Mishra
parent
b8a81b5dcb
commit
722a901ae7
@@ -6,6 +6,7 @@ use algebra::{
|
||||
to_bytes, ToConstraintField, UniformRand,
|
||||
};
|
||||
use digest::Digest;
|
||||
use num_traits::{One, Zero};
|
||||
use rand::Rng;
|
||||
use std::{
|
||||
hash::Hash,
|
||||
|
||||
Reference in New Issue
Block a user