Rüdiger Klaehn f5e7461cec Implement private networks (#1385)
* Add pnet protocol

copied from plaintext protocol, since that seems to be the closest match

* Minimalize the pnet protocol

* WIP private swarms with fixed key

* Different nonces for write and read

* Use per stream write buffer to avoid allocations

* Add parsing and formating of PSKs

* Directly call handshake

Also remove unneeded InboundUpgrade and OutboundUpgrade

* Add HandshakeError

* Add dedicated pnet example

* Add tests for PSK parsing and formatting

* Some more tests for the parsing, fail case

* Add fingerprint

To be able to check if a go-ipfs and rust-libp2p use the same key without
having to dump the actual key. Not sure if there is a spec for this anywhere,
but it is basically just copied from go-ipfs.

* Minimize dependencies and remove dead code

* Rename PSK to PreSharedKey and use pin_project

* Add crypt_writer

Basically a stripped down and modified version of async_std BufWriter that
also encrypts using the given cipher.

* cargo fmt

* Actually get rid of the Unpin requirement

* Rewrite flushing and remove written count from state

* Add docs for pnet/lib.rs

* Increase library version

* Remove pnet example

There will be a more elaborate and useful example in a different PR

* Return pending on pending...

also make doc text less ambiguous

* Add debug assertions to check invariants of poll_flush_buf

Also, clarify the invariants in the comments of that method
2020-01-28 13:22:09 +01:00
2019-10-22 09:49:38 +00:00
2020-01-28 08:51:06 +01:00
2020-01-24 17:14:56 +01:00
2020-01-24 17:14:56 +01:00
2020-01-28 13:22:09 +01:00
2020-01-28 08:51:06 +01:00
2020-01-24 17:14:56 +01:00
2020-01-28 13:22:09 +01:00
2020-01-24 17:14:56 +01:00
2017-11-08 13:03:59 +01:00
2019-09-24 18:55:31 +02:00

Central repository for work on libp2p

dependency status

This repository is the central place for Rust development of the libp2p spec.

Warning: While we are trying our best to be compatible with other libp2p implementations, we cannot guarantee that this is the case considering the lack of a precise libp2p specifications.

Documentation

How to use the library?

Where to ask questions?

  • In the Rust section of https://discuss.libp2p.io.
  • In the #libp2p IRC channel on freenode.
  • By opening an issue in this repository.

Notable users

(open a pull request if you want your project to be added here)

Description
No description provided
Readme MIT 23 MiB
Languages
Rust 99.8%
JavaScript 0.2%