Move Pasta implementations into root
This commit is contained in:
parent
b36356667f
commit
d40ed36d50
|
@ -3,7 +3,7 @@
|
|||
use criterion::{criterion_group, criterion_main, Criterion};
|
||||
|
||||
use pasta_curves::arithmetic::CurveExt;
|
||||
use pasta_curves::pasta::{pallas, vesta};
|
||||
use pasta_curves::{pallas, vesta};
|
||||
|
||||
fn criterion_benchmark(c: &mut Criterion) {
|
||||
bench_hash_to_curve(c);
|
||||
|
|
23
src/lib.rs
23
src/lib.rs
|
@ -17,5 +17,26 @@
|
|||
#![deny(missing_docs)]
|
||||
#![deny(unsafe_code)]
|
||||
|
||||
#[macro_use]
|
||||
mod macros;
|
||||
mod curves;
|
||||
mod fields;
|
||||
|
||||
pub mod arithmetic;
|
||||
pub mod pasta;
|
||||
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());
|
||||
}
|
||||
|
|
|
@ -100,8 +100,8 @@ fn test_iso_map_identity() {
|
|||
#[test]
|
||||
fn test_map_to_curve_simple_swu() {
|
||||
use crate::arithmetic::CurveExt;
|
||||
use crate::pasta::curves::IsoEp;
|
||||
use crate::pasta::hashtocurve::map_to_curve_simple_swu;
|
||||
use crate::curves::IsoEp;
|
||||
use crate::hashtocurve::map_to_curve_simple_swu;
|
||||
|
||||
// The zero input is a special case.
|
||||
let p: IsoEp = map_to_curve_simple_swu::<Fp, Ep, IsoEp>(&Fp::zero(), Ep::THETA, Ep::Z);
|
25
src/pasta.rs
25
src/pasta.rs
|
@ -1,25 +0,0 @@
|
|||
//! This module contains implementations for the Pallas and Vesta elliptic curve
|
||||
//! groups.
|
||||
|
||||
#[macro_use]
|
||||
mod macros;
|
||||
mod curves;
|
||||
mod fields;
|
||||
|
||||
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());
|
||||
}
|
|
@ -17,8 +17,8 @@ pub type Affine = EqAffine;
|
|||
#[test]
|
||||
fn test_map_to_curve_simple_swu() {
|
||||
use crate::arithmetic::CurveExt;
|
||||
use crate::pasta::curves::IsoEq;
|
||||
use crate::pasta::hashtocurve::map_to_curve_simple_swu;
|
||||
use crate::curves::IsoEq;
|
||||
use crate::hashtocurve::map_to_curve_simple_swu;
|
||||
|
||||
// The zero input is a special case.
|
||||
let p: IsoEq = map_to_curve_simple_swu::<Fq, Eq, IsoEq>(&Fq::zero(), Eq::THETA, Eq::Z);
|
Loading…
Reference in New Issue