2021-03-03 21:46:11 +00:00
|
|
|
//! Implementation of the Pallas / Vesta curve cycle.
|
2020-08-22 20:15:39 +00:00
|
|
|
|
2021-09-20 16:44:11 +00:00
|
|
|
#![no_std]
|
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)]
|
2021-06-01 22:34:22 +00:00
|
|
|
#![allow(clippy::op_ref, clippy::same_item_push, clippy::upper_case_acronyms)]
|
2022-05-04 23:11:59 +00:00
|
|
|
#![deny(rustdoc::broken_intra_doc_links)]
|
2020-08-22 20:15:39 +00:00
|
|
|
#![deny(missing_debug_implementations)]
|
|
|
|
|
#![deny(missing_docs)]
|
|
|
|
|
#![deny(unsafe_code)]
|
|
|
|
|
|
2021-12-22 04:59:49 +00:00
|
|
|
#[cfg(feature = "alloc")]
|
|
|
|
|
extern crate alloc;
|
|
|
|
|
|
2021-12-22 05:41:04 +00:00
|
|
|
#[cfg(test)]
|
2021-09-20 16:44:11 +00:00
|
|
|
#[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;
|
|
|
|
|
|
2021-12-22 05:41:04 +00:00
|
|
|
#[cfg(feature = "alloc")]
|
2021-09-20 16:44:11 +00:00
|
|
|
mod hashtocurve;
|
|
|
|
|
|
2022-09-02 15:06:02 +00:00
|
|
|
#[cfg(feature = "serde")]
|
|
|
|
|
mod serde_impl;
|
|
|
|
|
|
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;
|
|
|
|
|
|
2021-12-22 05:41:04 +00:00
|
|
|
#[cfg(feature = "alloc")]
|
2021-03-03 21:51:54 +00:00
|
|
|
#[test]
|
|
|
|
|
fn test_endo_consistency() {
|
2022-11-24 05:11:46 +00:00
|
|
|
use crate::arithmetic::CurveExt;
|
|
|
|
|
use group::{ff::WithSmallOrderMulGroup, Group};
|
2021-03-03 21:51:54 +00:00
|
|
|
|
|
|
|
|
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());
|
|
|
|
|
}
|