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
Copy file name to clipboardExpand all lines: packages/crypto/src/secp256r1.rs
+6-35Lines changed: 6 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -53,31 +53,17 @@ pub fn secp256r1_verify(
53
53
54
54
/// Recovers a public key from a message hash and a signature.
55
55
///
56
-
/// This is required when working with Ethereum where public keys
57
-
/// are not stored on chain directly.
56
+
/// This is required when working with an application where public keys
57
+
/// are not stored directly.
58
58
///
59
-
/// `recovery_param` must be 0 or 1. The values 2 and 3 are unsupported by this implementation,
60
-
/// which is the same restriction as Ethereum has (https://github.com/ethereum/go-ethereum/blob/v1.9.25/internal/ethapi/api.go#L466-L469).
61
-
/// All other values are invalid.
59
+
/// `recovery_param` must be 0, 1, 2 or 3.
62
60
///
63
61
/// Returns the recovered pubkey in compressed form, which can be used
64
62
/// in secp256r1_verify directly.
65
63
///
66
64
/// This implementation accepts both high-S and low-S signatures. This is the
67
65
/// same behavior as Ethereum's `ecrecover`. The reason is that high-S signatures
68
66
/// may be perfectly valid if the application protocol does not disallow them.
69
-
/// Or as [EIP-2] put it "The ECDSA recover precompiled contract remains unchanged
70
-
/// and will keep accepting high s-values; this is useful e.g. if a contract
71
-
/// recovers old Bitcoin signatures.".
72
-
///
73
-
/// See also OpenZeppelin's [ECDSA.recover implementation](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.8.1/contracts/utils/cryptography/ECDSA.sol#L138-L149)
74
-
/// which adds further restrictions to avoid potential signature malleability.
75
-
/// Please note that restricting signatures to low-S does not make signatures unique
76
-
/// in the sense that for each (pubkey, message) there is only one signature. The
77
-
/// signer can generate an arbitrary amount of valid signatures.
0 commit comments