#![doc(hidden)]
use crate::field::NttFriendlyFieldElement;
use crate::flp::gadgets::Mul;
use crate::flp::FlpError;
use crate::ntt::ntt;
use crate::polynomial::{ntt_get_roots, poly_ntt, PolyNttTempMemory};
pub fn benchmarked_iterative_ntt<F: NttFriendlyFieldElement>(outp: &mut [F], inp: &[F]) {
ntt(outp, inp, inp.len()).unwrap();
}
pub fn benchmarked_recursive_ntt<F: NttFriendlyFieldElement>(outp: &mut [F], inp: &[F]) {
let roots_2n = ntt_get_roots(inp.len(), false);
let mut ntt_memory = PolyNttTempMemory::new(inp.len());
poly_ntt(outp, inp, &roots_2n, inp.len(), false, &mut ntt_memory)
}
pub fn benchmarked_gadget_mul_call_poly_ntt<F: NttFriendlyFieldElement>(
g: &mut Mul<F>,
outp: &mut [F],
inp: &[Vec<F>],
) -> Result<(), FlpError> {
g.call_poly_ntt(outp, inp)
}
pub fn benchmarked_gadget_mul_call_poly_direct<F: NttFriendlyFieldElement>(
g: &mut Mul<F>,
outp: &mut [F],
inp: &[Vec<F>],
) -> Result<(), FlpError> {
g.call_poly_direct(outp, inp)
}