Implement triple Diffie-Hellman key agreement
This branch implements triple Diffie-Hellman key agreement to agree an ephemeral shared secret, authenticated by static public keys from both parties. This will be used in the handshake protocol.
Part of #1232 (closed)