pasta_curves/
lib.rs

1//! Implementation of the Pallas / Vesta curve cycle.
2
3#![no_std]
4#![cfg_attr(docsrs, feature(doc_cfg))]
5#![allow(unknown_lints)]
6#![allow(clippy::op_ref, clippy::same_item_push, clippy::upper_case_acronyms)]
7#![deny(rustdoc::broken_intra_doc_links)]
8#![deny(missing_debug_implementations)]
9#![deny(missing_docs)]
10#![deny(unsafe_code)]
11
12#[cfg(feature = "alloc")]
13extern crate alloc;
14
15#[cfg(test)]
16#[macro_use]
17extern crate std;
18
19#[macro_use]
20mod macros;
21mod curves;
22mod fields;
23
24pub mod arithmetic;
25pub mod pallas;
26pub mod vesta;
27
28#[cfg(feature = "alloc")]
29mod hashtocurve;
30
31#[cfg(feature = "serde")]
32mod serde_impl;
33
34pub use curves::*;
35pub use fields::*;
36
37pub extern crate group;
38
39#[cfg(feature = "alloc")]
40#[test]
41fn test_endo_consistency() {
42    use crate::arithmetic::CurveExt;
43    use group::{ff::WithSmallOrderMulGroup, Group};
44
45    let a = pallas::Point::generator();
46    assert_eq!(a * pallas::Scalar::ZETA, a.endo());
47    let a = vesta::Point::generator();
48    assert_eq!(a * vesta::Scalar::ZETA, a.endo());
49}