tweaked poseidon (wip)

This commit is contained in:
poma 2019-10-06 05:56:39 +03:00
parent d38647aeaa
commit 33723a731e
3 changed files with 3 additions and 3 deletions

View File

@ -7,7 +7,7 @@ template HashLeftRight(rounds) {
signal output hash; signal output hash;
component hasher = Poseidon(2, 6, 8, 57); component hasher = Poseidon(2, 3, 8, 57);
hasher.inputs[0] <== left; hasher.inputs[0] <== left;
hasher.inputs[1] <== right; hasher.inputs[1] <== right;

View File

@ -5,7 +5,7 @@ const bigInt = snarkjs.bigInt
class PoseidonHasher { class PoseidonHasher {
hash(level, left, right) { hash(level, left, right) {
const hash = poseidon.createHash(6, 8, 57) const hash = poseidon.createHash(3, 8, 57)
return hash([bigInt(left), bigInt(right)]).toString() return hash([bigInt(left), bigInt(right)]).toString()
} }
} }

View File

@ -12,7 +12,7 @@ module.exports = function(deployer) {
await artifactor.save({ await artifactor.save({
contractName, contractName,
abi: genContract.abi, abi: genContract.abi,
unlinked_binary: genContract.createCode(), unlinked_binary: genContract.createCode(3),
}).then(async () => { }).then(async () => {
const hasherContract = artifacts.require(contractName) const hasherContract = artifacts.require(contractName)
await deployer.deploy(hasherContract) await deployer.deploy(hasherContract)