const bn128 = require("snarkjs").bn128; const bigInt = require("snarkjs").bigInt; const babyJub = require("./babyjub"); const assert = require("assert"); const createBlakeHash = require("blake-hash"); const GENPOINT_PREFIX = "Iden3_PedersenGenerator"; const windowSize = 4; const nWindowsPerSegment = 50; exports.hash = pedersenHash; exports.getBasePoint = getBasePoint; function pedersenHash(msg) { const bitsPerSegment = windowSize*nWindowsPerSegment; const bits = buffer2bits(msg); const nSegments = Math.floor((bits.length - 1)/(windowSize*nWindowsPerSegment)) +1; let accP = [bigInt.zero,bigInt.one]; for (let s=0; s