use super::{
cyclotomic::exp_by_x_cyclo_bn254,
fp12::{
conjugate_fp12_bn254, frobenius1_fp12_bn254, frobenius2_fp12_bn254, frobenius3_fp12_bn254,
inv_fp12_bn254, mul_fp12_bn254, square_fp12_bn254,
},
};
pub fn final_exp_bn254(f: &[u64; 48], #[cfg(feature = "hints")] hints: &mut Vec<u64>) -> [u64; 48] {
let f_conj = conjugate_fp12_bn254(
f,
#[cfg(feature = "hints")]
hints,
);
let f_inv = inv_fp12_bn254(
f,
#[cfg(feature = "hints")]
hints,
);
let easy1 = mul_fp12_bn254(
&f_conj,
&f_inv,
#[cfg(feature = "hints")]
hints,
);
let mut m = frobenius2_fp12_bn254(
&easy1,
#[cfg(feature = "hints")]
hints,
);
m = mul_fp12_bn254(
&m,
&easy1,
#[cfg(feature = "hints")]
hints,
);
let mx = exp_by_x_cyclo_bn254(
&m,
#[cfg(feature = "hints")]
hints,
);
let mxx = exp_by_x_cyclo_bn254(
&mx,
#[cfg(feature = "hints")]
hints,
);
let mxxx = exp_by_x_cyclo_bn254(
&mxx,
#[cfg(feature = "hints")]
hints,
);
let mp = frobenius1_fp12_bn254(
&m,
#[cfg(feature = "hints")]
hints,
);
let mpp = frobenius2_fp12_bn254(
&m,
#[cfg(feature = "hints")]
hints,
);
let mppp = frobenius3_fp12_bn254(
&m,
#[cfg(feature = "hints")]
hints,
);
let mxp = frobenius1_fp12_bn254(
&mx,
#[cfg(feature = "hints")]
hints,
);
let mxxp = frobenius1_fp12_bn254(
&mxx,
#[cfg(feature = "hints")]
hints,
);
let mxxxp = frobenius1_fp12_bn254(
&mxxx,
#[cfg(feature = "hints")]
hints,
);
let mxxpp = frobenius2_fp12_bn254(
&mxx,
#[cfg(feature = "hints")]
hints,
);
let mut y1 = mul_fp12_bn254(
&mp,
&mpp,
#[cfg(feature = "hints")]
hints,
);
y1 = mul_fp12_bn254(
&y1,
&mppp,
#[cfg(feature = "hints")]
hints,
);
let y2 = conjugate_fp12_bn254(
&m,
#[cfg(feature = "hints")]
hints,
);
let y4 = conjugate_fp12_bn254(
&mxp,
#[cfg(feature = "hints")]
hints,
);
let mut y5 = mul_fp12_bn254(
&mx,
&mxxp,
#[cfg(feature = "hints")]
hints,
);
y5 = conjugate_fp12_bn254(
&y5,
#[cfg(feature = "hints")]
hints,
);
let y6 = conjugate_fp12_bn254(
&mxx,
#[cfg(feature = "hints")]
hints,
);
let mut y7 = mul_fp12_bn254(
&mxxx,
&mxxxp,
#[cfg(feature = "hints")]
hints,
);
y7 = conjugate_fp12_bn254(
&y7,
#[cfg(feature = "hints")]
hints,
);
let mut t11 = square_fp12_bn254(
&y7,
#[cfg(feature = "hints")]
hints,
);
t11 = mul_fp12_bn254(
&t11,
&y5,
#[cfg(feature = "hints")]
hints,
);
t11 = mul_fp12_bn254(
&t11,
&y6,
#[cfg(feature = "hints")]
hints,
);
let mut t21 = mul_fp12_bn254(
&t11,
&y4,
#[cfg(feature = "hints")]
hints,
);
t21 = mul_fp12_bn254(
&t21,
&y6,
#[cfg(feature = "hints")]
hints,
);
let t12 = mul_fp12_bn254(
&t11,
&mxxpp,
#[cfg(feature = "hints")]
hints,
);
let mut t22 = square_fp12_bn254(
&t21,
#[cfg(feature = "hints")]
hints,
);
t22 = mul_fp12_bn254(
&t22,
&t12,
#[cfg(feature = "hints")]
hints,
);
let t23 = square_fp12_bn254(
&t22,
#[cfg(feature = "hints")]
hints,
);
let t24 = mul_fp12_bn254(
&t23,
&y1,
#[cfg(feature = "hints")]
hints,
);
let t13 = mul_fp12_bn254(
&t23,
&y2,
#[cfg(feature = "hints")]
hints,
);
let mut t14 = square_fp12_bn254(
&t13,
#[cfg(feature = "hints")]
hints,
);
t14 = mul_fp12_bn254(
&t14,
&t24,
#[cfg(feature = "hints")]
hints,
);
t14
}