Refactor ECDSA canonical checks