init
This commit is contained in:
commit
44f31f8b9f
402 changed files with 47865 additions and 0 deletions
18
services/mimc.js
Normal file
18
services/mimc.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { buildMimcSponge } from 'circomlibjs'
|
||||
|
||||
class Mimc {
|
||||
constructor() {
|
||||
this.sponge = null
|
||||
this.hash = null
|
||||
this.initMimc()
|
||||
}
|
||||
|
||||
async initMimc() {
|
||||
this.sponge = await buildMimcSponge()
|
||||
this.hash = (left, right) => this.sponge.F.toString(this.sponge.multiHash([BigInt(left), BigInt(right)]))
|
||||
}
|
||||
}
|
||||
|
||||
const mimc = new Mimc()
|
||||
|
||||
export { mimc }
|
Loading…
Add table
Add a link
Reference in a new issue