Add SignerERC7913 and verifiers for P256 and RSA#98
Conversation
…ier for P256 keys
| * @dev Helper library to verify key signatures following the ERC-7913 standard, with fallback to ECDSA and ERC-1271 | ||
| * when the signer's key is empty (as specified in ERC-7913) | ||
| */ | ||
| library ERC7913Utils { |
There was a problem hiding this comment.
I think I would prefer having just one implementation of the isValidSignatureNow function. The rationale is that signature always ends up in memory for any valid verification, and a portion of signer will be copied too. So I doubt there's actual benefits in having two versions. I'll simplify for now following #109
There was a problem hiding this comment.
The memory version uses a slice, that does a memory copy.
Overall, calldata versions are often cheaper because they don't copy to memory until the very last point (when the Abi call is encoded) contrary to the memory version that copy to memory at least once more (in this case 2 times)
Overall not a big deal. Having a single "memory" version is probably good enough. Just explaining the initial idea
There was a problem hiding this comment.
Yeah I saw the memory version is required, so I'd agree with just one "memory" version for now unless there are significant savings measured.
Thanks for answering though, now please you go 👨🍼
Includes
contracts/interfaces/IERC7913.sol: ERC-7913 interfacecontracts/utils/cryptography/ERC7913SignatureVerifierP256.sola stateless verifier for P256 keys. This is unopinionated and production ready, so I don't think it needs to be a mockcontracts/utils/cryptography/ERC7913SignatureVerifierRSA.sola stateless verifier for RSA keys. This is unopinionated and production ready, so I don't think it needs to be a mockcontracts/utils/cryptography/ERC7913Utils.sollibrary for checking signer's signatures using ERC-7913 (with ECDSA/ERC-1271 fallback)contracts/utils/cryptography/SignerERC7913.solabstract signer that uses an ERC-7913 signer.