2021-03-03 13:46:11 -08:00
|
|
|
//! Implementation of the Pallas / Vesta curve cycle.
|
2020-08-22 13:15:39 -07:00
|
|
|
|
2021-01-22 13:13:11 -08:00
|
|
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
2021-02-15 06:53:27 -08:00
|
|
|
#![allow(unknown_lints)]
|
2021-06-01 15:34:22 -07:00
|
|
|
#![allow(clippy::op_ref, clippy::same_item_push, clippy::upper_case_acronyms)]
|
2020-11-27 06:40:37 -08:00
|
|
|
#![deny(broken_intra_doc_links)]
|
2020-08-22 13:15:39 -07:00
|
|
|
#![deny(missing_debug_implementations)]
|
|
|
|
#![deny(missing_docs)]
|
|
|
|
#![deny(unsafe_code)]
|
|
|
|
|
2021-03-03 13:51:54 -08:00
|
|
|
#[macro_use]
|
|
|
|
mod macros;
|
|
|
|
mod curves;
|
|
|
|
mod fields;
|
|
|
|
|
2020-08-22 13:15:39 -07:00
|
|
|
pub mod arithmetic;
|
2021-03-03 13:51:54 -08:00
|
|
|
mod hashtocurve;
|
|
|
|
pub mod pallas;
|
|
|
|
pub mod vesta;
|
|
|
|
|
|
|
|
pub use curves::*;
|
|
|
|
pub use fields::*;
|
|
|
|
|
2021-09-02 13:19:32 -07:00
|
|
|
pub extern crate group;
|
|
|
|
|
2021-03-03 13:51:54 -08:00
|
|
|
#[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());
|
|
|
|
}
|