refactor and validate ecdsa and hmac