-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### 🕓 Changelog In the test function `testVerifyWycheproofData` for the `p256` contract, we flip the `s` parameter if it is higher than the malleability threshold to validate the correctness of the underlying implementation (h/t @cairoeth for raising this point). We also `bound` the fuzzed private key in the `testFuzzVerifyWithValidSignature` test to account for the secp256r1 curve specifications. Finally, we refactor (i.e. remove) the `_SIGNATURE_INCREMENT` constant in the `ecdsa` contract by using the built-in Vyper constant `max_value(int256)` instead. You can validate the equivalence of the two constants by using [`titanoboa`](https://github.com/vyperlang/titanoboa): ```console ~$ pip install git+https://github.com/vyperlang/[email protected] ~$ python >>> import boa >>> boa.eval("convert(max_value(int256), uint256)") == 57_896_044_618_658_097_711_785_492_504_343_953_926_634_992_332_820_282_019_728_792_003_956_564_819_967 True ``` --------- Signed-off-by: Pascal Marco Caversaccio <[email protected]>
- Loading branch information
1 parent
0babe4d
commit 4ce4f28
Showing
6 changed files
with
140 additions
and
129 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Submodule solady
updated
6 files
+551 −549 | .gas-snapshot | |
+1 −1 | package.json | |
+15 −7 | src/utils/EfficientHashLib.sol | |
+1 −1 | src/utils/EnumerableSetLib.sol | |
+1 −1 | src/utils/P256.sol | |
+34 −3 | test/EfficientHashLib.t.sol |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters