Commit Graph

13 Commits

Author SHA1 Message Date
Pratyush Mishra
1959a3de63 Rename curves 2020-06-12 18:37:04 -07:00
Kobi Gurkan
5cc094be6b Adds alloc_constant to AllocGadget (#189)
* adds alloc constant to AllocGadget

* fmt

* fmt

* more alloc constant impls

* fmt

* even more impls

* fixes type

* fixes alloc_constant in gm17

* uses alloc_constant from field gadget in group gadgets

* fmt

* handle most comments
2020-04-18 16:03:33 -07:00
Pascal Berrang
d4a2d31d07 Fix Vec imports for no_std 2020-04-09 11:04:50 -07:00
Pratyush Mishra
33a9da08f8 Switch to stable cargo formatting options 2020-04-07 19:30:27 -07:00
Pratyush Mishra
b1913a9ca7 Change default to_bits and to_bytes functions to the safe versions 2020-03-18 23:24:54 -07:00
Pratyush Mishra
8bf042a029 Refactor algebra API, split into algebra and algebra-core. (#100) 2020-02-26 21:42:04 -08:00
Marek Kotewicz
d4896ade47 crypto-primitives no-std (#96) 2020-02-20 11:35:53 -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
Kobi Gurkan
fb87c421e7 Runs cargo fmt 2019-10-21 18:57:39 -07:00
Pratyush Mishra
cb2ff3b412 Add ToConstraintField impls for some primitives 2019-10-11 19:25:53 -07:00
Pratyush Mishra
a244e719d1 Initial commit to extract crypto-primitives to new crate 2019-10-11 19:25:53 -07:00