Rename curves to Pallas/Vesta (Pasta).

This commit is contained in:
Sean Bowe 2020-12-03 13:45:13 -07:00
parent 7536af8b69
commit 95e41fcfcf
No known key found for this signature in database
GPG Key ID: 95684257D8F8B031
19 changed files with 52 additions and 53 deletions

View File

@ -5,7 +5,7 @@ extern crate halo2;
use crate::arithmetic::{small_multiexp, FieldExt}; use crate::arithmetic::{small_multiexp, FieldExt};
use crate::poly::commitment::Params; use crate::poly::commitment::Params;
use crate::transcript::DummyHash; use crate::transcript::DummyHash;
use crate::tweedle::{EqAffine, Fp, Fq}; use crate::pasta::{EqAffine, Fp, Fq};
use halo2::*; use halo2::*;
use criterion::{black_box, Criterion}; use criterion::{black_box, Criterion};

View File

@ -6,7 +6,7 @@ use halo2::arithmetic::FieldExt;
use halo2::plonk::*; use halo2::plonk::*;
use halo2::poly::commitment::Params; use halo2::poly::commitment::Params;
use halo2::transcript::DummyHash; use halo2::transcript::DummyHash;
use halo2::tweedle::{EqAffine, Fp, Fq}; use halo2::pasta::{EqAffine, Fp, Fq};
use std::marker::PhantomData; use std::marker::PhantomData;

View File

@ -4,7 +4,7 @@ use halo2::{
plonk::*, plonk::*,
poly::commitment::{Blind, Params}, poly::commitment::{Blind, Params},
transcript::DummyHash, transcript::DummyHash,
tweedle::{EqAffine, Fp, Fq}, pasta::{EqAffine, Fp, Fq},
}; };
use std::marker::PhantomData; use std::marker::PhantomData;

View File

@ -468,7 +468,7 @@ pub fn lagrange_interpolate<F: FieldExt>(points: &[F], evals: &[F]) -> Vec<F> {
} }
#[cfg(test)] #[cfg(test)]
use crate::tweedle::Fp; use crate::pasta::Fp;
#[test] #[test]
fn test_lagrange_interpolate() { fn test_lagrange_interpolate() {

View File

@ -14,9 +14,9 @@
#![deny(unsafe_code)] #![deny(unsafe_code)]
pub mod arithmetic; pub mod arithmetic;
pub mod pasta;
pub mod plonk; pub mod plonk;
pub mod poly; pub mod poly;
pub mod transcript; pub mod transcript;
pub mod tweedle;
pub mod model; pub mod model;

13
src/pasta.rs Normal file
View File

@ -0,0 +1,13 @@
//! This module contains implementations for the Pallas and Vesta elliptic curve
//! groups.
#[macro_use]
mod macros;
mod curves;
mod fields;
pub mod pallas;
pub mod vesta;
pub use curves::*;
pub use fields::*;

View File

@ -1,5 +1,5 @@
//! This module contains implementations for the Tweedledum and Tweedledee //! This module contains implementations for the Pallas and Vesta elliptic curve
//! elliptic curve groups. //! groups.
use core::cmp; use core::cmp;
use core::fmt::Debug; use core::fmt::Debug;

View File

@ -1,5 +1,5 @@
//! This module contains implementations for the two finite fields of the //! This module contains implementations for the two finite fields of the Pallas
//! Tweedledum and Tweedledee curves. //! and Vesta curves.
mod fp; mod fp;
mod fq; mod fq;

13
src/pasta/pallas.rs Normal file
View File

@ -0,0 +1,13 @@
//! The Pallas elliptic curve group.
/// A Pallas point in the projective coordinate space.
pub type Point = super::Ep;
/// A Pallas point in the affine coordinate space (or the point at infinity).
pub type Affine = super::EpAffine;
/// The base field of the Pallas group.
pub type Base = super::Fp;
/// The scalar field of the Pallas group.
pub type Scalar = super::Fq;

13
src/pasta/vesta.rs Normal file
View File

@ -0,0 +1,13 @@
//! The Vesta elliptic curve group.
/// A Vesta point in the projective coordinate space.
pub type Point = super::Eq;
/// A Vesta point in the affine coordinate space (or the point at infinity).
pub type Affine = super::EqAffine;
/// The base field of the Vesta group.
pub type Base = super::Fq;
/// The scalar field of the Vesta group.
pub type Scalar = super::Fp;

View File

@ -111,7 +111,7 @@ fn test_proving() {
use crate::arithmetic::{Curve, FieldExt}; use crate::arithmetic::{Curve, FieldExt};
use crate::poly::commitment::{Blind, Params}; use crate::poly::commitment::{Blind, Params};
use crate::transcript::DummyHash; use crate::transcript::DummyHash;
use crate::tweedle::{EqAffine, Fp, Fq}; use crate::pasta::{EqAffine, Fp, Fq};
use circuit::{Advice, Column, Fixed}; use circuit::{Advice, Column, Fixed};
use std::marker::PhantomData; use std::marker::PhantomData;
const K: u32 = 5; const K: u32 = 5;

View File

@ -103,7 +103,6 @@ impl<C: CurveAffine> Params<C> {
let h = { let h = {
let mut hasher = H::init(C::Base::zero()); let mut hasher = H::init(C::Base::zero());
hasher.absorb(-C::Base::one());
let x = hasher.squeeze().to_bytes(); let x = hasher.squeeze().to_bytes();
let p = C::from_bytes(&x); let p = C::from_bytes(&x);
p.unwrap() p.unwrap()
@ -227,7 +226,7 @@ fn test_commit_lagrange() {
const K: u32 = 6; const K: u32 = 6;
use crate::transcript::DummyHash; use crate::transcript::DummyHash;
use crate::tweedle::{EpAffine, Fp, Fq}; use crate::pasta::{EpAffine, Fp, Fq};
let params = Params::<EpAffine>::new::<DummyHash<Fp>>(K); let params = Params::<EpAffine>::new::<DummyHash<Fp>>(K);
let domain = super::EvaluationDomain::new(1, K); let domain = super::EvaluationDomain::new(1, K);
@ -256,7 +255,7 @@ fn test_opening_proof() {
}; };
use crate::arithmetic::{eval_polynomial, Curve, FieldExt}; use crate::arithmetic::{eval_polynomial, Curve, FieldExt};
use crate::transcript::{ChallengeScalar, DummyHash, Transcript}; use crate::transcript::{ChallengeScalar, DummyHash, Transcript};
use crate::tweedle::{EpAffine, Fp, Fq}; use crate::pasta::{EpAffine, Fp, Fq};
let params = Params::<EpAffine>::new::<DummyHash<Fp>>(K); let params = Params::<EpAffine>::new::<DummyHash<Fp>>(K);
let domain = EvaluationDomain::new(1, K); let domain = EvaluationDomain::new(1, K);

View File

@ -217,7 +217,7 @@ where
mod tests { mod tests {
use super::{construct_intermediate_sets, Query}; use super::{construct_intermediate_sets, Query};
use crate::arithmetic::FieldExt; use crate::arithmetic::FieldExt;
use crate::tweedle::Fp; use crate::pasta::Fp;
#[derive(Clone)] #[derive(Clone)]
struct MyQuery<F> { struct MyQuery<F> {

View File

@ -1,13 +0,0 @@
//! This module contains implementations for the Tweedledum and Tweedledee
//! elliptic curve groups.
#[macro_use]
mod macros;
mod curves;
mod fields;
pub mod dee;
pub mod dum;
pub use curves::*;
pub use fields::*;

View File

@ -1,13 +0,0 @@
//! The Tweedledee elliptic curve group.
/// A Tweedledee point in the projective coordinate space.
pub type Point = super::Eq;
/// A Tweedledee point in the affine coordinate space (or the point at infinity).
pub type Affine = super::EqAffine;
/// The base field of the Tweedledee group.
pub type Base = super::Fq;
/// The scalar field of the Tweedledee group.
pub type Scalar = super::Fp;

View File

@ -1,13 +0,0 @@
//! The Tweedledum elliptic curve group.
/// A Tweedledum point in the projective coordinate space.
pub type Point = super::Ep;
/// A Tweedledum point in the affine coordinate space (or the point at infinity).
pub type Affine = super::EpAffine;
/// The base field of the Tweedledum group.
pub type Base = super::Fp;
/// The scalar field of the Tweedledum group.
pub type Scalar = super::Fq;