@@ -16,6 +16,7 @@ contract P256Test is Test {
1616 (bytes32 r , bytes32 s ) = vm.signP256 (privateKey, digest);
1717 s = _ensureLowerS (s);
1818 assertTrue (P256.verify (digest, r, s, bytes32 (x), bytes32 (y)));
19+ assertTrue (P256.verifyNative (digest, r, s, bytes32 (x), bytes32 (y)));
1920 assertTrue (P256.verifySolidity (digest, r, s, bytes32 (x), bytes32 (y)));
2021 }
2122
@@ -31,22 +32,6 @@ contract P256Test is Test {
3132 assertTrue ((qx0 == bytes32 (x) && qy0 == bytes32 (y)) || (qx1 == bytes32 (x) && qy1 == bytes32 (y)));
3233 }
3334
34- function testVerifyNativeUnsupportedRIP7212 (bytes32 digest , uint256 seed ) public {
35- // By default, the precompile at address 0x100 is not supported.
36-
37- uint256 privateKey = _asPrivateKey (seed);
38-
39- (uint256 x , uint256 y ) = vm.publicKeyP256 (privateKey);
40- (bytes32 r , bytes32 s ) = vm.signP256 (privateKey, digest);
41- s = _ensureLowerS (s);
42-
43- (bool success , bytes memory returndata ) = address (this ).call (
44- abi.encodeCall (P256Test.verifyNative, (digest, r, s, bytes32 (x), bytes32 (y)))
45- );
46- assertFalse (success);
47- assertEq (returndata, abi.encodeWithSelector (Errors.MissingPrecompile.selector , address (0x100 )));
48- }
49-
5035 function _asPrivateKey (uint256 seed ) private pure returns (uint256 ) {
5136 return bound (seed, 1 , P256.N - 1 );
5237 }
@@ -57,9 +42,4 @@ contract P256Test is Test {
5742 return _s > P256.N / 2 ? bytes32 (P256.N - _s) : s;
5843 }
5944 }
60-
61- // See https://github.com/foundry-rs/foundry/issues/10237
62- function verifyNative (bytes32 digest , bytes32 r , bytes32 s , bytes32 x , bytes32 y ) external view {
63- P256.verifyNative (digest, r, s, x, y);
64- }
6545}
0 commit comments