import {getCurveFromName} from "../src/curves.js"; async function run() { const curve = await getCurveFromName("bn128"); const Fr = curve.Fr; Fr.s = 2; const p = [Fr.e(1), Fr.e(2), Fr.e(3), Fr.e(4), Fr.e(-1), Fr.e(-2), Fr.e(-3), Fr.e(-4)]; printArr("p", p); const P = await Fr.fft(p); printArr("P", P); const pOdd = []; let accShift; const shift_to_small_m = Fr.exp(Fr.shift, 4); // accShift = Fr.e(-1); accShift = Fr.sub(Fr.one, shift_to_small_m); for (let i=0; i<4; i++) { pOdd[i] = Fr.mul(p[i], accShift); accShift = Fr.mul(accShift, Fr.shift); } printArr("pOdd", pOdd); const POdd = await Fr.fft(pOdd); printArr("POdd", POdd); function printArr(s, a) { console.log(s+": ["); for (let i=0; i { process.exit(0); });