* 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.
Initially I had hoped that the deprecated `#![allow(clippy)]` would no
longer be put into the generated rust files, but -- as of 2019-01-30 --
it still is (see [1] for details). Since we explicitly update the
protobuf files I decided to *manually edit the generated code* and
replace this with `#![allow(clippy:all)]`. Hopefully, by the time we do
the next upgrade, no such manual tweaking would be necessary anymore. I
think the benefit of a less polluted clippy output is worth it this
time.
[1]: https://github.com/stepancheg/rust-protobuf/pull/332
* Add an Error associated type to transports
* Improve raw swarm a bit
* Rename map_other to map
* Use source() instead of cause()
* RawSwarmIncErr -> IncomingError
* remove tokio_current_thread tests
* Review changes:
Removed newline
Moved uds tokio test crate to top to avoid self and keep with convention of other test crates
Removed sleep from uds test and block until all futures are completed.
Instead of having one struct with uninitialised fields
which are mutated, have explicit states and ensure that the types
show that there is no ambiguity which data is available or not.
Consequently, this removes quite a few `unwrap`/`expect` calls.
* Use the sha2 crate in the handshake
* Return a Digest in algo_support instead of a ring ref
* Switch to ed25519-dalek for keys
* Make ring more or less optional
* Switch to ed25519_dalek for the verification
* Extract the key exchange to its own module
* Remove the ring RNG from the handshake
* Some warning fixes and forgot file
* Move key exchange to own module
* Remove usage of ring::digest
* Remove ring from handshake entirely
* Implement ECDH for WebCrypto
* Remove the libp2p-secio feature
* Fix ring being included
* Address some concerns
* Provde some panics in WebCrypto
* Prove the Hmac panic
* Prove more panics
* secio: keep ciphertext if start_send is not ready
Otherwise ciphertext may be thrown away and once sent, the cipher states
have diverged, resulting in nonsense messages on decryption side.
* Also attempt to send pending data `Sink::close`.
* Inline `send_pending`.
* Introduce NULL cipher and allow more configuration.
* Back to using the hash-code for handshake.
Using `Endpoint` would be incompatible with the existing protocol.
* Add comments.