We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Note that if b>n this method: https://github.com/musalbas/solidity-BN256G2/blob/master/BN256G2.sol#L151
doesn't give the correct representation of (n-b). It gives 2^256+(n-b).
Example: submod(3,11,10) would give you addmod(3,(10-11),10).
10-11 in solidity is 2^256-1 which is 115792089237316195423570985008687907853269984665640564039457584007913129639935
so 3 + 115792089237316195423570985008687907853269984665640564039457584007913129639935 modulo 10 is 8, not 3-11 mod 10 which is 2.
I don't know if that's the issue for the project, I just wanted to note this.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Note that if b>n this method:
https://github.com/musalbas/solidity-BN256G2/blob/master/BN256G2.sol#L151
doesn't give the correct representation of (n-b). It gives 2^256+(n-b).
Example: submod(3,11,10) would give you addmod(3,(10-11),10).
10-11 in solidity is 2^256-1 which is 115792089237316195423570985008687907853269984665640564039457584007913129639935
so 3 + 115792089237316195423570985008687907853269984665640564039457584007913129639935 modulo 10 is 8, not 3-11 mod 10 which is 2.
I don't know if that's the issue for the project, I just wanted to note this.
The text was updated successfully, but these errors were encountered: