mirror of
https://github.com/tornadocash/tornado-core.git
synced 2025-03-01 11:21:13 -05:00
tweaked poseidon (wip)
This commit is contained in:
parent
d38647aeaa
commit
33723a731e
@ -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;
|
||||||
|
|
||||||
|
@ -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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user