Pasta curves (Pallas/Vesta) — formal verification source
Find a file
Jack Grigg 6a47700b1d fields: Ensure that trait impl dependencies match trait bounds
The `FieldExt` trait was originally the only trait implemented in this
crate. When we added `ff` support, we reworked `FieldExt` to be an
extension trait on top of `ff::PrimeField`, but left the existing impls
in `FieldExt`. This resulted in some circular dependencies that prevent
us from making `FieldExt` conditional (e.g. for no-std support).

This commit removes the cycles like so:

- `ff::PrimeField::{from_repr, to_repr}` were implemented as calls to
  `FieldExt::{from_bytes, to_bytes}`. The field encoding/decoding logic
  is moved into the `ff::PrimeField` trait impl, and `FieldExt` now
  calls into `ff::PrimeField`.

- `ff::Field::sqrt` was implemented in terms of `FieldExt::sqrt_alt`.
  Given that the latter is a trivial wrapper around the `SqrtTables`
  implementation, we duplicate the call to eliminate the cycle.

- `ff::Field::random` used `FieldExt::from_bytes_wide`, which wraps
  either `Fp::from_u512` or `Fq::from_u512`. We now use these internal
  methods directly.
2021-09-20 17:41:46 +01:00
.github CI: Add no-std build check 2021-09-20 13:58:41 +01:00
benches Add benchmarks for point operations. 2021-08-11 15:09:34 +01:00
book book: Fix broken links 2021-03-04 14:02:12 +00:00
src fields: Ensure that trait impl dependencies match trait bounds 2021-09-20 17:41:46 +01:00
.gitignore Add book/Makefile for local HTML generation. 2020-12-26 15:33:59 +00:00
Cargo.toml pasta_curves 0.2.1 2021-09-17 16:37:00 +01:00
CHANGELOG.md pasta_curves 0.2.1 2021-09-17 16:37:00 +01:00
katex-header.html Initial commit 2020-08-22 14:15:39 -06:00
LICENSE-APACHE Relicense pasta_curves as MIT OR Apache-2.0 2021-09-17 16:32:36 +01:00
LICENSE-MIT Relicense pasta_curves as MIT OR Apache-2.0 2021-09-17 16:32:36 +01:00
README.md Relicense pasta_curves as MIT OR Apache-2.0 2021-09-17 16:32:36 +01:00
rust-toolchain Bump MSRV to 1.51.0 2021-06-01 23:22:25 +01:00

pasta_curves

This crate provides an implementation of the Pasta elliptic curve constructions, Pallas and Vesta. More details about the Pasta curves can be found in this blog post.

Documentation

Minimum Supported Rust Version

Requires Rust 1.51 or higher.

Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump.

Curve Descriptions

  • Pallas: y2 = x3 + 5 over GF(0x40000000000000000000000000000000224698fc094cf91b992d30ed00000001).

  • Vesta: y2 = x3 + 5 over GF(0x40000000000000000000000000000000224698fc0994a8dd8c46eb2100000001).

The Pasta curves form a cycle with one another: the order of each curve is exactly the base field of the other. This property is critical to the efficiency of recursive proof systems. They are designed to be highly 2-adic, meaning that a large power-of-two multiplicative subgroup exists in each field. This is important for the performance of polynomial arithmetic over their scalar fields and is essential for protocols similar to PLONK.

These curves can be reproducibly obtained using a curve search utility weve published.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.