Enforce that Fr of Engine is the scalar for curve points, for simpler downstream abstractions.

This commit is contained in:
Sean Bowe
2017-11-12 16:19:08 -07:00
parent 5d9f77f5bf
commit 471db6ab27

View File

@@ -97,7 +97,7 @@ pub trait CurveProjective: PartialEq +
rand::Rand + rand::Rand +
'static 'static
{ {
type Engine: Engine; type Engine: Engine<Fr=Self::Scalar>;
type Scalar: PrimeField; type Scalar: PrimeField;
type Base: SqrtField; type Base: SqrtField;
type Affine: CurveAffine<Projective=Self, Scalar=Self::Scalar>; type Affine: CurveAffine<Projective=Self, Scalar=Self::Scalar>;
@@ -166,7 +166,7 @@ pub trait CurveAffine: Copy +
Eq + Eq +
'static 'static
{ {
type Engine: Engine; type Engine: Engine<Fr=Self::Scalar>;
type Scalar: PrimeField; type Scalar: PrimeField;
type Base: SqrtField; type Base: SqrtField;
type Projective: CurveProjective<Affine=Self, Scalar=Self::Scalar>; type Projective: CurveProjective<Affine=Self, Scalar=Self::Scalar>;