1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#![no_std]
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]

use cryptix_field::group::AbelianGroup;

pub trait Pairing {
    type G1: AbelianGroup;
    type G2: AbelianGroup;

    type GT: AbelianGroup;

    fn pairing(p: Self::G1, q: Self::G2) -> Self::GT {
        Self::final_exp(Self::miller_loop(p, q))
    }
    
    fn miller_loop(p: Self::G1, q: Self::G2) -> Self::GT;

    fn final_exp(f: Self::GT) -> Self::GT;
}