class Net::SSH::Transport::Kex::Curve25519Sha256

def compute_shared_secret(server_ecdh_pubkey)

compute shared secret from server's public key and client's private key
def compute_shared_secret(server_ecdh_pubkey)
  pk = ::X25519::MontgomeryU.new(server_ecdh_pubkey)
  OpenSSL::BN.new(ecdh.diffie_hellman(pk).to_bytes, 2)
end