say a user has an external public key (unrelated to ethereum address). they use the private key associated with this public key to sign sha3(message) via ECDSA. the message, public key and signature are submitted to a contract. is there a simple way to use solidity to verify the signature? ecrecover returns an address.
i've tried to look for an answer to this but it seems like prior applications have been verifying signatures of ethereum addresses with ecrecover.
EDIT: i suppose i could convert the public key to an address using the following steps (from Steve Waldman):
1.Start with the public key bytes (a bytestring of length 64)
2.Of that public key, take the Keccak-256 hash used ubiquitously by Ethereum (make sure you get that right, as the ultimately standardized SHA3-256 hash differs). You should now have a bytestring of length 32.
3.Drop the first 12 bytes. You should now have a bytestring of length 20, the Ethereum address associated with your public key.
would it be functional to convert the external public key to an ethereum address with solidity then check that address against the result of ecrecover() to determine if the signature is valid?