pasta_curves-source/src/lib.rs

47 lines
958 B
Rust
Raw Normal View History

//! Implementation of the Pallas / Vesta curve cycle.
2020-08-22 20:15:39 +00:00
#![no_std]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![allow(unknown_lints)]
2021-06-01 22:34:22 +00:00
#![allow(clippy::op_ref, clippy::same_item_push, clippy::upper_case_acronyms)]
#![deny(rustdoc::broken_intra_doc_links)]
2020-08-22 20:15:39 +00:00
#![deny(missing_debug_implementations)]
#![deny(missing_docs)]
#![deny(unsafe_code)]
#[cfg(feature = "alloc")]
extern crate alloc;
#[cfg(test)]
#[macro_use]
extern crate std;
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
pub mod pallas;
pub mod vesta;
#[cfg(feature = "alloc")]
mod hashtocurve;
2021-03-03 21:51:54 +00:00
pub use curves::*;
pub use fields::*;
2021-09-02 20:19:32 +00:00
pub extern crate group;
#[cfg(feature = "alloc")]
2021-03-03 21:51:54 +00: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());
}