mirror of
https://github.com/tornadocash/tornado-cli.git
synced 2025-05-13 20:02:17 -04:00
init
This commit is contained in:
commit
2e4d59aed0
15 changed files with 703783 additions and 0 deletions
13
lib/MiMC.js
Normal file
13
lib/MiMC.js
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue