Improve handling of ephemeral ECDH keys