Auto merge of #67 - ebfull:static-engine, r=ebfull

Engine should always be 'static, for flexibility in downstream code.
This commit is contained in:
bmerge 2017-11-21 06:47:28 +00:00
commit affead11a5
2 changed files with 3 additions and 2 deletions

View File

@ -21,7 +21,7 @@ use super::{Engine, CurveAffine, Field, BitIterator};
const BLS_X: u64 = 0xd201000000010000;
const BLS_X_IS_NEGATIVE: bool = true;
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct Bls12;
impl Engine for Bls12 {

View File

@ -34,7 +34,8 @@ use std::io::{self, Read, Write};
/// An "engine" is a collection of types (fields, elliptic curve groups, etc.)
/// with well-defined relationships. In particular, the G1/G2 curve groups are
/// of prime order `r`, and are equipped with a bilinear pairing function.
pub trait Engine: Sized {
pub trait Engine: Sized + 'static + Clone
{
/// This is the scalar field of the G1/G2 groups.
type Fr: PrimeField;