From d5ce479939760e0417e30f2eb28c14a5c39ebcdb Mon Sep 17 00:00:00 2001 From: Jordi Baylina Date: Tue, 26 May 2020 21:19:35 +0200 Subject: [PATCH] Fix export in big files --- src/powersoftau_export.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/powersoftau_export.js b/src/powersoftau_export.js index a6d3a38..04a369c 100644 --- a/src/powersoftau_export.js +++ b/src/powersoftau_export.js @@ -61,10 +61,10 @@ async function exportChallange(pTauFilename, challangeFilename, verbose) { async function exportSection(sectionId, groupName, nPoints, sectionName) { const G = curve[groupName]; const sG = G.F.n8*2; - const nPointsChunk = Math.floor((1<<27)/sG); + const nPointsChunk = Math.floor((1<<24)/sG); await binFileUtils.startReadUniqueSection(fdFrom, sections, sectionId); - for (let i=0; i< nPointsChunk; i+= nPointsChunk) { + for (let i=0; i< nPoints; i+= nPointsChunk) { if ((verbose)&&i) console.log(`${sectionName}: ` + i); const n = Math.min(nPoints-i, nPointsChunk); let buff;