Yul based wrapper for ECDSA
Vectorized opened this issue · comments
Vectorized commented
The OpenZeppelin library has a convenient wrapper over the ecrecover
function to ensure that the signature is valid and non-malleable.
However, most of the time, users only need check whether the signature is valid, without throwing or getting error codes.
I'd suggest a Yul based wrapper that simply returns an address.
If the address doesn't match the signer, the signature is simply treated as invalid.
The implementation at #247 should save you about 700 gas over OpenZeppelin's version.
Let me know your opinions.