Poseidon in SMT

This commit is contained in:
Jordi Baylina
2019-06-04 17:32:28 +02:00
parent 590d62a07c
commit c4490b2ce9
9 changed files with 98 additions and 20 deletions

10
src/smt_hashes_mimc.js Normal file
View File

@@ -0,0 +1,10 @@
const mimc7 = require("./mimc7");
const bigInt = require("snarkjs").bigInt;
exports.hash0 = function (left, right) {
return mimc7.multiHash(left, right);
};
exports.hash1 = function(key, value) {
return mimc7.multiHash([key, value], bigInt.one);
};