Scalar field should be guaranteed to be SqrtField.

This commit is contained in:
Sean Bowe 2017-11-25 20:57:10 -07:00
parent affead11a5
commit aa0cc06e5e
No known key found for this signature in database
GPG Key ID: 95684257D8F8B031
1 changed files with 3 additions and 3 deletions

View File

@ -37,7 +37,7 @@ use std::io::{self, Read, Write};
pub trait Engine: Sized + 'static + Clone
{
/// This is the scalar field of the G1/G2 groups.
type Fr: PrimeField;
type Fr: PrimeField + SqrtField;
/// The projective representation of an element in G1.
type G1: CurveProjective<Engine=Self, Base=Self::Fq, Scalar=Self::Fr, Affine=Self::G1Affine> + From<Self::G1Affine>;
@ -99,7 +99,7 @@ pub trait CurveProjective: PartialEq +
'static
{
type Engine: Engine<Fr=Self::Scalar>;
type Scalar: PrimeField;
type Scalar: PrimeField + SqrtField;
type Base: SqrtField;
type Affine: CurveAffine<Projective=Self, Scalar=Self::Scalar>;
@ -168,7 +168,7 @@ pub trait CurveAffine: Copy +
'static
{
type Engine: Engine<Fr=Self::Scalar>;
type Scalar: PrimeField;
type Scalar: PrimeField + SqrtField;
type Base: SqrtField;
type Projective: CurveProjective<Affine=Self, Scalar=Self::Scalar>;
type Prepared: Clone + Send + Sync + 'static;