tornado-cli/lib/MiMC.js
Roman Storm 2e4d59aed0
init
2020-05-21 12:29:33 -07:00

14 lines
315 B
JavaScript

const circomlib = require('circomlib')
const mimcsponge = circomlib.mimcsponge
const snarkjs = require('snarkjs')
const bigInt = snarkjs.bigInt
class MimcSpongeHasher {
hash(level, left, right) {
return mimcsponge.multiHash([bigInt(left), bigInt(right)]).toString()
}
}
module.exports = MimcSpongeHasher