Commit graph

27 commits

Author SHA1 Message Date
Jack Grigg
ab03c3d5e1 Remove field traits from behind std feature flag
Now that we have a default implementation of `SqrtRatio::sqrt_ratio`, we
can use it and `FieldExt` in no-std environments.

We introduce an `alloc` feature flag to form a common feature dependency
between `std` and `sqrt-table`. It is currently unused directly, but
will be used after `CurveAffine` is refactored to remove the `std`
dependency.

Closes zcash/pasta_curves#25.
2021-12-22 05:06:16 +00:00
Jack Grigg
96116e20e5 Annotate docs with required feature flags 2021-12-07 14:31:27 +00:00
Jack Grigg
0c58a40a98 Remove pasta_curves::arithmetic::Field 2021-09-23 14:44:10 +01:00
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
b36356667f Rename crate to pasta_curves and remove halo2 code 2021-03-03 21:59:08 +00:00
Jack Grigg
b4ed5295fe Migrate to group traits
The `Curve` trait is now `CurveExt: group::prime::PrimeCurve`, and
`CurveAffine` is now `CurveAffine: group::prime::PrimeCurveAffine`.

There is no `CurveAffine` trait in `group`, and it's a widely-used
trait in this crate, so we don't rename it to `CurveAffineExt`.
2021-02-22 20:20:23 +00:00
Jack Grigg
7037d55320 Rename Curve and CurveAffine properties to match group traits 2021-02-22 20:05:08 +00:00
Sean Bowe
68a7a19d3b Move hashtocurve module into pasta module. 2021-02-19 15:52:11 +00:00
Daira Hopwood
fa3afc29bb Add an implementation of simplified SWU hash-to-curve.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-02-19 15:52:11 +00:00
Sean Bowe
95e41fcfcf
Rename curves to Pallas/Vesta (Pasta). 2020-12-03 13:47:47 -07:00
Jack Grigg
f63f3ff2af Introduce typed challenge scalars
This also centralises the challenge generation logic in Challenge::get,
ensuring it is consistent across the codebase.
2020-12-01 21:09:03 +00:00
Jack Grigg
cdbc41148a Migrate to ff traits
The `Field` trait in this crate is now `FieldExt: ff::PrimeField`.
2020-12-01 20:55:03 +00:00
Jack Grigg
3407d13e4b Move curves and fields into tweedle module 2020-11-12 21:36:59 +00:00
Sean Bowe
588de0e024
Add test for lagrange interpolation. 2020-10-15 14:15:03 -06:00
Sean Bowe
63d7de3bc2
Perform inversions in lagrange_interpolate as part of a batch. 2020-10-15 14:08:13 -06:00
Sean Bowe
5c563eca12
Do not enumerate product inside of lagrange_interpolate. 2020-10-15 13:57:04 -06:00
therealyingtong
742c15bb51 Minor changes and documentation 2020-10-14 08:15:00 +08:00
therealyingtong
088118cc5d Refactor lagrange_interpolate() method
Co-authored-by: daira <daira@electriccoin.co>
Co-authored-by: str4d <jack@z.cash>
2020-10-14 00:35:36 +08:00
therealyingtong
1441193de1 Refactoring from initial code review
Co-authored-by: ebfull <ewillbefull@gmail.com>
2020-10-14 00:35:36 +08:00
therealyingtong
07e2d390a9 Introduce Lagrange interpolation method in arithmetic.rs 2020-10-14 00:35:25 +08:00
Sean Bowe
a37c926a89
Address clippy lints 2020-09-20 13:09:03 -06:00
therealyingtong
ced73c2bf7
Minor fixes 2020-09-17 05:14:01 +08:00
therealyingtong
a63602df2a
Inline bit-shifting 2020-09-16 08:56:45 +08:00
therealyingtong
f2fc068db0
Implement small_multiexp() in arithmetic.rs 2020-09-15 19:15:35 +08:00
Sean Bowe
ff8f9eb20e
Reduce number of inversions by batch inverting when possible. 2020-09-06 12:29:34 -06:00
Sean Bowe
ad106f1119
(WIP) broken implementation of generalized PLONK 2020-08-27 10:10:55 -06:00
Sean Bowe
dd1ad9f114
Initial commit 2020-08-22 14:15:39 -06:00