1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
use core::ops::Mul;
use super::{
curve::{Affine, Projective},
field::PrimeField,
};
#[cfg(feature = "std")]
use super::{algebra::Field, comp::ParallelCmp};
#[cfg(feature = "std")]
pub trait FftField: PrimeField + ParallelCmp + From<u64> {
const S: usize;
const ROOT_OF_UNITY: Self;
fn pow(self, val: u64) -> Self;
}
#[cfg(feature = "std")]
pub trait Polynomial: Field + ParallelCmp {
type Domain: FftField;
fn evaluate(self, at: Self::Domain) -> Self::Domain;
}
pub trait Commitment {
type G1Affine: Affine + From<Self::G1Projective>;
type G1Projective: Projective
+ From<Self::G1Affine>
+ Mul<Self::ScalarField, Output = Self::G1Projective>;
type G2Affine: Affine + From<Self::G2Projective>;
type G2Projective: Projective
+ From<Self::G2Affine>
+ Mul<Self::ScalarField, Output = Self::G2Projective>;
type ScalarField: FftField;
}