Add ScalarEngine trait

This is extracted from pairing's Engine trait.
This commit is contained in:
Jack Grigg 2018-07-02 21:31:35 +01:00
parent 0eb9f5040b
commit 2067360930
No known key found for this signature in database
GPG Key ID: 1B8D649257DB0829
1 changed files with 8 additions and 0 deletions

View File

@ -290,6 +290,14 @@ pub trait PrimeField: Field {
fn root_of_unity() -> Self; fn root_of_unity() -> Self;
} }
/// An "engine" is a collection of types (fields, elliptic curve groups, etc.)
/// with well-defined relationships. Specific relationships (for example, a
/// pairing-friendly curve) can be defined in a subtrait.
pub trait ScalarEngine: Sized + 'static + Clone {
/// This is the scalar field of the engine's groups.
type Fr: PrimeField + SqrtField;
}
#[derive(Debug)] #[derive(Debug)]
pub struct BitIterator<E> { pub struct BitIterator<E> {
t: E, t: E,