multiHash function
Chunks inputs in five elements and hash with Poseidon all them togheter @param {Array} arr - inputs hash @returns {BigInt} - final hash
Implementation
BigInt multiHash(List<BigInt> arr) {
BigInt r = BigInt.zero;
for (int i = 0; i < arr.length; i += 5) {
const fiveElems = [];
for (int j = 0; j < 5; j++) {
if (i + j < arr.length) {
fiveElems.add(arr[i + j]);
} else {
fiveElems.add(BigInt.zero);
}
}
Pointer<Uint8> ptr =
Uint8ArrayUtils.toPointer(Uint8List.fromList(fiveElems as List<int>));
//final ph = eddsaBabyJub.hashPoseidon(ptr);
//r = F.add(r, ph);
}
// TODO: fix this
return BigInt.zero;
//return F.normalize(r);
}