Commit Graph

9 Commits

Author SHA1 Message Date
Jack Grigg 9999964d17 Add no-std support
We re-introduce the Tonelli-Shank square root algoritm that was removed
in zcash/halo2#120, to use in no-std mode (the table-based impl requires
allocations, and also uses 29kiB of memory which is a problem for
constrained environments that typically need no-std).
2021-09-20 18:56:23 +01:00
Jack Grigg 8fabb44ad4 fields: Use `ff::PrimeField` instead of `FieldExt` where possible 2021-09-20 17:41:46 +01:00
Jack Grigg fd7a6edbb1 ff 0.11, group 0.11 2021-09-02 18:10:05 +01:00
Jack Grigg 43251286c0 Enable Pasta curve elements to be used with `group::Wnaf` 2021-08-06 01:23:27 +01:00
Jack Grigg a6b018fb0e impl CofactorCurve for Pallas and Vesta
They already implement CofactorGroup (trivially, with the prime-order
subgroup being Self); this just enables Pallas and Vesta to be used in
cofactor-aware protocols that also want to leverage the affine point
representation.
2021-06-04 00:54:39 +01:00
Jack Grigg b016b972f8 Replace (x, y) tuple with Coordinates struct
The previous `CurveAffine::get_xy` method returned the coordinates as
`CtOption<(C::Base, C::Base)>`. However, `ConditionallySelectable` is
not implemented for any tuple or array types, making it impossible to
use any of the useful `CtOption` methods like `and_then`. We replace it
with `CurveAffine::coordinates -> CtOption<Coordinates<Self>>` and
`impl ConditionallySelectable for Coordinates` to enable operating over
coordinates in constant time.
2021-04-18 09:21:18 +12:00
Jack Grigg 901ef2381e clippy: Allow binary operators in Mul impls for curves
We use binary operators specifically to implement constant-time scalar
multiplication.
2021-03-03 22:00:22 +00:00
Jack Grigg b06937103d clippy: Use *Assign to implement arithmetic::Group trait 2021-03-03 22:00:22 +00:00
Jack Grigg d40ed36d50 Move Pasta implementations into root 2021-03-03 21:59:08 +00:00