2021-03-03 21:46:11 +00:00
|
|
|
//! Implementation of the Pallas / Vesta curve cycle.
|
2020-08-22 20:15:39 +00:00
|
|
|
|
2021-01-22 21:13:11 +00:00
|
|
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
2021-02-15 14:53:27 +00:00
|
|
|
#![allow(unknown_lints)]
|
2020-08-22 20:15:39 +00:00
|
|
|
#![allow(
|
|
|
|
|
clippy::op_ref,
|
2021-02-14 16:39:05 +00:00
|
|
|
clippy::same_item_push,
|
2021-02-15 14:53:27 +00:00
|
|
|
clippy::upper_case_acronyms,
|
|
|
|
|
clippy::unknown_clippy_lints
|
2020-08-22 20:15:39 +00:00
|
|
|
)]
|
2020-11-27 14:40:37 +00:00
|
|
|
#![deny(broken_intra_doc_links)]
|
2020-08-22 20:15:39 +00:00
|
|
|
#![deny(missing_debug_implementations)]
|
|
|
|
|
#![deny(missing_docs)]
|
|
|
|
|
#![deny(unsafe_code)]
|
|
|
|
|
|
2021-03-03 21:51:54 +00:00
|
|
|
#[macro_use]
|
|
|
|
|
mod macros;
|
|
|
|
|
mod curves;
|
|
|
|
|
mod fields;
|
|
|
|
|
|
2020-08-22 20:15:39 +00:00
|
|
|
pub mod arithmetic;
|
2021-03-03 21:51:54 +00:00
|
|
|
mod hashtocurve;
|
|
|
|
|
pub mod pallas;
|
|
|
|
|
pub mod vesta;
|
|
|
|
|
|
|
|
|
|
pub use curves::*;
|
|
|
|
|
pub use fields::*;
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn test_endo_consistency() {
|
|
|
|
|
use crate::arithmetic::{CurveExt, FieldExt};
|
|
|
|
|
use group::Group;
|
|
|
|
|
|
|
|
|
|
let a = pallas::Point::generator();
|
|
|
|
|
assert_eq!(a * pallas::Scalar::ZETA, a.endo());
|
|
|
|
|
let a = vesta::Point::generator();
|
|
|
|
|
assert_eq!(a * vesta::Scalar::ZETA, a.endo());
|
|
|
|
|
}
|