ark-curves-cherry-picked/ed_on_bls12_381_bandersnatch/src/lib.rs
ed_on_bls12_381_bandersnatch/src/lib.rsRaw
1#![cfg_attr(not(feature = "std"), no_std)]
2#![deny(
3 warnings,
4 unused,
5 future_incompatible,
6 nonstandard_style,
7 rust_2018_idioms
8)]
9#![forbid(unsafe_code)]
10
11//! This library implements the Bendersnatch curve, a twisted Edwards curve
12//! whose base field is the scalar field of the curve BLS12-381. This allows
13//! defining cryptographic primitives that use elliptic curves over the scalar
14//! field of the latter curve. This curve was generated by Simon Masson from Anoma,
15//! and Antonio Sanso from Ethereum Foundation, and is also known as [bandersnatch](https://ethresear.ch/t/introducing-bandersnatch-a-fast-elliptic-curve-built-over-the-bls12-381-scalar-field/9957).
16//!
17//! See [here](https://github.com/asanso/Bandersnatch/blob/main/README.md) for the specification of the curve.
18//! There was also a Python implementation [here](https://github.com/asanso/Bandersnatch/).
19//!
20//! Curve information:
21//! * Base field: q =
22//! 52435875175126190479447740508185965837690552500527637822603658699938581184513
23//! * Scalar field: r =
24//! 13108968793781547619861935127046491459309155893440570251786403306729687672801
25//! * Valuation(q - 1, 2) = 32
26//! * Valuation(r - 1, 2) = 5
27//! * Curve equation: ax^2 + y^2 =1 + dx^2y^2, where
28//! * a = -5
29//! * d = 45022363124591815672509500913686876175488063829319466900776701791074614335719
30
31#[cfg(feature = "r1cs")]
32pub mod constraints;
33mod curves;
34mod fields;
35
36pub use curves::*;
37pub use fields::*;