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
Testing so I noticed, when I generate a proof.json below
When I generate solidity contract parameters for following method:
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[2] calldata _pubSignals) public view returns (bool)
It seems proof parameters for this method when dealing with matrix, so [2][2] input need to be provided in reverse order.
Which means for example input is to _pB parameter should be [
[pi_b[0][1], pi_b[0][0]],
[pi_b[1][1], pi_b[1][0]],
];
This was hard to detect as I was getting wrong result with verifyProof method, but off-chain verification with snarkjs verify was successful. Finally when I executed snarkjs generatecall in terminal I saw that for matrix parameters order was wrong.
Is this expected that in proof.json for 2-d arrays order is not aligned with generatecall command ?
Note that 1-d array are aligned.
Hi,
Testing so I noticed, when I generate a proof.json below
When I generate solidity contract parameters for following method:
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[2] calldata _pubSignals) public view returns (bool)
It seems proof parameters for this method when dealing with matrix, so [2][2] input need to be provided in reverse order.
Which means for example input is to _pB parameter should be [
[pi_b[0][1], pi_b[0][0]],
[pi_b[1][1], pi_b[1][0]],
];
comparing to my expectation:
[
[pi_b[0][0], pi_b[0][1]],
[pi_b[1][0], pi_b[1][1]],
];
This was hard to detect as I was getting wrong result with verifyProof method, but off-chain verification with snarkjs verify was successful. Finally when I executed snarkjs generatecall in terminal I saw that for matrix parameters order was wrong.
Is this expected that in proof.json for 2-d arrays order is not aligned with generatecall command ?
Note that 1-d array are aligned.
The text was updated successfully, but these errors were encountered: