You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In circomlibjs version 0.1.7, the generated Solidity code and JS functions for poseidon produce a different hash for the same input. Hardhat running with solc version 0.8.27 if that matters.
asyncinitialize(){// deploy hash contractsletposeidon2Factory=newethers.ContractFactory(poseidonContract.generateABI(2),poseidonContract.createCode(2),this.owner);this.poseidon2=awaitposeidon2Factory.deploy();// test itletonchainP2Result=ethers.toBigInt(awaitthis.poseidon2['poseidon(uint256[2])']([1,2]));letoffchainP2Result=ethers.toBigInt((awaitbuildPoseidon(2))([1,2]));if(onchainP2Result!==offchainP2Result){console.log(onchainP2Result,offchainP2Result);thrownewError('Poseidon2 test failed',{onchainP2Result, offchainP2Result});}}
it's talking about circom vs JS (not Solidity vs JS)
for that bug, it seems to be outputting the same hashes, just with different return types. For this bug, the functions output entirely different bytes.
Please let me know if you need any help reproducing this. I actually can't get the two implementations to output the same hash at all.
The text was updated successfully, but these errors were encountered:
In circomlibjs version 0.1.7, the generated Solidity code and JS functions for poseidon produce a different hash for the same input. Hardhat running with solc version 0.8.27 if that matters.
I saw issue #13, but:
Please let me know if you need any help reproducing this. I actually can't get the two implementations to output the same hash at all.
The text was updated successfully, but these errors were encountered: