mirror of https://github.com/zcash/halo2.git
Remove isogenous curve from public API.
This commit is contained in:
parent
b488355e13
commit
d14d2314a1
|
@ -12,11 +12,11 @@ use super::{Fp, Fq};
|
||||||
use crate::arithmetic::{Curve, CurveAffine, FieldExt, Group};
|
use crate::arithmetic::{Curve, CurveAffine, FieldExt, Group};
|
||||||
|
|
||||||
macro_rules! new_curve_impl {
|
macro_rules! new_curve_impl {
|
||||||
($name:ident, $name_affine:ident, $iso_affine:ident, $base:ident, $scalar:ident, $blake2b_personalization:literal,
|
(($($privacy:tt)*), $name:ident, $name_affine:ident, $iso_affine:ident, $base:ident, $scalar:ident, $blake2b_personalization:literal,
|
||||||
$curve_id:literal, $a_raw:expr, $b_raw:expr, $curve_type:ident) => {
|
$curve_id:literal, $a_raw:expr, $b_raw:expr, $curve_type:ident) => {
|
||||||
/// Represents a point in the projective coordinate space.
|
/// Represents a point in the projective coordinate space.
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub struct $name {
|
$($privacy)* struct $name {
|
||||||
x: $base,
|
x: $base,
|
||||||
y: $base,
|
y: $base,
|
||||||
z: $base,
|
z: $base,
|
||||||
|
@ -35,7 +35,7 @@ macro_rules! new_curve_impl {
|
||||||
/// Represents a point in the affine coordinate space (or the point at
|
/// Represents a point in the affine coordinate space (or the point at
|
||||||
/// infinity).
|
/// infinity).
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct $name_affine {
|
$($privacy)* struct $name_affine {
|
||||||
x: $base,
|
x: $base,
|
||||||
y: $base,
|
y: $base,
|
||||||
infinity: Choice,
|
infinity: Choice,
|
||||||
|
@ -845,6 +845,7 @@ macro_rules! impl_affine_curve_specific {
|
||||||
}
|
}
|
||||||
|
|
||||||
new_curve_impl!(
|
new_curve_impl!(
|
||||||
|
(pub),
|
||||||
Ep,
|
Ep,
|
||||||
EpAffine,
|
EpAffine,
|
||||||
IsoEpAffine,
|
IsoEpAffine,
|
||||||
|
@ -857,6 +858,7 @@ new_curve_impl!(
|
||||||
special_a0_b5
|
special_a0_b5
|
||||||
);
|
);
|
||||||
new_curve_impl!(
|
new_curve_impl!(
|
||||||
|
(pub),
|
||||||
Eq,
|
Eq,
|
||||||
EqAffine,
|
EqAffine,
|
||||||
IsoEqAffine,
|
IsoEqAffine,
|
||||||
|
@ -869,6 +871,7 @@ new_curve_impl!(
|
||||||
special_a0_b5
|
special_a0_b5
|
||||||
);
|
);
|
||||||
new_curve_impl!(
|
new_curve_impl!(
|
||||||
|
(pub(crate)),
|
||||||
IsoEp,
|
IsoEp,
|
||||||
IsoEpAffine,
|
IsoEpAffine,
|
||||||
EpAffine,
|
EpAffine,
|
||||||
|
@ -886,6 +889,7 @@ new_curve_impl!(
|
||||||
general
|
general
|
||||||
);
|
);
|
||||||
new_curve_impl!(
|
new_curve_impl!(
|
||||||
|
(pub(crate)),
|
||||||
IsoEq,
|
IsoEq,
|
||||||
IsoEqAffine,
|
IsoEqAffine,
|
||||||
EqAffine,
|
EqAffine,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//! The Pallas and iso-Pallas elliptic curve groups.
|
//! The Pallas and iso-Pallas elliptic curve groups.
|
||||||
|
|
||||||
use super::{Ep, EpAffine, Fp, Fq, IsoEp, IsoEpAffine};
|
use super::{Ep, EpAffine, Fp, Fq};
|
||||||
|
|
||||||
/// The base field of the Pallas and iso-Pallas curves.
|
/// The base field of the Pallas and iso-Pallas curves.
|
||||||
pub type Base = Fp;
|
pub type Base = Fp;
|
||||||
|
@ -14,12 +14,6 @@ pub type Point = Ep;
|
||||||
/// A Pallas point in the affine coordinate space (or the point at infinity).
|
/// A Pallas point in the affine coordinate space (or the point at infinity).
|
||||||
pub type Affine = EpAffine;
|
pub type Affine = EpAffine;
|
||||||
|
|
||||||
/// An iso-Pallas point in the projective coordinate space.
|
|
||||||
pub type IsoPoint = IsoEp;
|
|
||||||
|
|
||||||
/// A iso-Pallas point in the affine coordinate space (or the point at infinity).
|
|
||||||
pub type IsoAffine = IsoEpAffine;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_map_to_curve_pallas() {
|
fn test_map_to_curve_pallas() {
|
||||||
use crate::arithmetic::Curve;
|
use crate::arithmetic::Curve;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//! The Vesta and iso-Vesta elliptic curve groups.
|
//! The Vesta and iso-Vesta elliptic curve groups.
|
||||||
|
|
||||||
use super::{Eq, EqAffine, Fp, Fq, IsoEq, IsoEqAffine};
|
use super::{Eq, EqAffine, Fp, Fq};
|
||||||
|
|
||||||
/// The base field of the Vesta and iso-Vesta curves.
|
/// The base field of the Vesta and iso-Vesta curves.
|
||||||
pub type Base = Fq;
|
pub type Base = Fq;
|
||||||
|
@ -14,12 +14,6 @@ pub type Point = Eq;
|
||||||
/// A Vesta point in the affine coordinate space (or the point at infinity).
|
/// A Vesta point in the affine coordinate space (or the point at infinity).
|
||||||
pub type Affine = EqAffine;
|
pub type Affine = EqAffine;
|
||||||
|
|
||||||
/// An iso-Vesta point in the projective coordinate space.
|
|
||||||
pub type IsoPoint = IsoEq;
|
|
||||||
|
|
||||||
/// A iso-Vesta point in the affine coordinate space (or the point at infinity).
|
|
||||||
pub type IsoAffine = IsoEqAffine;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_map_to_curve_vesta() {
|
fn test_map_to_curve_vesta() {
|
||||||
use crate::arithmetic::Curve;
|
use crate::arithmetic::Curve;
|
||||||
|
|
Loading…
Reference in New Issue