This commit is contained in:
Roman Storm 2020-05-21 12:29:33 -07:00
commit 2e4d59aed0
No known key found for this signature in database
GPG key ID: 522F2A785F34E71F
15 changed files with 703783 additions and 0 deletions

13
lib/MiMC.js Normal file
View file

@ -0,0 +1,13 @@
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