Fix Apply key BigBuffer

This commit is contained in:
Jordi Baylina
2020-10-25 10:22:21 +01:00
parent 305b5ca782
commit ff8c427217
2 changed files with 15 additions and 2 deletions

View File

@@ -6677,7 +6677,13 @@ function buildBatchApplyKey(curve, groupName) {
const result = await Promise.all(opPromises);
const outBuff = new Uint8Array(nPoints*sGout);
let outBuff;
if (buff instanceof BigBuffer) {
outBuff = new BigBuffer(nPoints*sGout);
} else {
outBuff = new Uint8Array(nPoints*sGout);
}
let p=0;
for (let i=0; i<result.length; i++) {
outBuff.set(result[i][0], p);

View File

@@ -1,3 +1,4 @@
import BigBuffer from "./bigbuffer.js";
export default function buildBatchApplyKey(curve, groupName) {
const G = curve[groupName];
@@ -101,7 +102,13 @@ export default function buildBatchApplyKey(curve, groupName) {
const result = await Promise.all(opPromises);
const outBuff = new Uint8Array(nPoints*sGout);
let outBuff;
if (buff instanceof BigBuffer) {
outBuff = new BigBuffer(nPoints*sGout);
} else {
outBuff = new Uint8Array(nPoints*sGout);
}
let p=0;
for (let i=0; i<result.length; i++) {
outBuff.set(result[i][0], p);