* Consolidate keypairs in core.
Introduce the concept of a node's identity keypair in libp2p-core,
instead of only the public key:
* New module: libp2p_core::identity with submodules for the currently
supported key types. An identity::Keypair and identity::PublicKey
support the creation and verification of signatures. The public key
supports encoding/decoding according to the libp2p specs.
* The secio protocol is simplified as a result of moving code to libp2p-core.
* The noise protocol is slightly simplified by consolidating ed25519
keypairs in libp2p-core and using x25519-dalek for DH. Furthermore,
Ed25519 to X25519 keypair conversion is now complete and tested.
Generalise over the DH keys in the noise protocol.
Generalise over the DH keys and thus DH parameter in handshake patterns
of the Noise protocol, such that it is easy to support other DH schemes
in the future, e.g. X448.
* Address new review comments.
* Fix the dialing priority system
* Bump libp2p-core to 0.3.1
* Cancel dialing attempt if we don't have priority
* Add test for simultaneous dialing
* Improve test
* Fix test stuck forever
* The SwarmFuture is now a Stream
* Return the produced future in the message
* Remove IncomingConnection event
* Pass error when failing to dial
* Fix loop break mistake
* Fix concern
* Rename SwarmFuture to SwarmEvents
* Increase type length limit
* Remove todo
* Stronger typing for the swarm handler future
* The swarm future is now a swarm stream of events
* Rewrite StreamMuxer in core
* Update libp2p_mplex for the new stream muxer
* Update yamux for new stream muxer
* Rewrite multiplex
* Increase the packet size limit to 32 MB
* Fix waiting for poll_complete to finish
* Typo
* Properly close substreams
* Add a limit to the number of substreams
* Add a limit to the length of the internal buffer
* Fix concerns