Switching to ECDH for key encryption.
Removed unused code and warnings.