Skip to content

Commit 4b2bdbe

Browse files
authored
Merge pull request #126 from nyonson/async-io
Update the async IO interface to match the std version
2 parents f470fb3 + 6453825 commit 4b2bdbe

8 files changed

Lines changed: 757 additions & 435 deletions

File tree

justfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ _default:
4242
# Test feature flag matrix compatability.
4343
@_test-features:
4444
# Build and test with all features, no features, and some combinations if required.
45-
cargo +{{STABLE_TOOLCHAIN}} test --package bip324 --lib --all-features
46-
cargo +{{STABLE_TOOLCHAIN}} test --package bip324 --lib --no-default-features
45+
cargo +{{STABLE_TOOLCHAIN}} test --package bip324 --lib --tests --all-features
46+
cargo +{{STABLE_TOOLCHAIN}} test --package bip324 --lib --tests --no-default-features
4747

4848
# Check code with MSRV compiler.
4949
@_test-msrv:

protocol/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ chacha20-poly1305 = { version = "0.1.1", default-features = false }
3030
# bitcoind version 26.0 includes support for BIP-324's V2 protocol, but it is disabled by default.
3131
bitcoind = { package = "corepc-node", version = "0.7.1", default-features = false, features = ["26_0","download"] }
3232
hex = { package = "hex-conservative", version = "0.2.0" }
33+
tokio = { version = "1", features = ["io-util", "net", "rt-multi-thread", "macros"] }

protocol/README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
# Protocol
1+
# BIP-324 Protocol
22

33
A BIP-324 library to establish and communicate over an encrypted channel.
44

5-
The library is designed with a bare `no_std` and "Sans I/O" interface to keep it as agnostic as possible to application runtimes, but higher level interfaces are exposed for ease of use.
5+
The library is designed with a bare `no_std` and *Sans I/O* interface to keep it as agnostic as possible to application runtimes, but higher level interfaces are exposed for ease of use.
66

7-
The `tokio` feature includes the high-level `AsyncProcotol` type which helps create and manage an encrypted channel.
8-
9-
The lower-level `CipherSession` and `Handshake` types can be directly used by applications which require more control. The handshake performs the one-and-a-half round trip dance between the peers in order to generate secret materials and verify a channel. A successful handshake results in a cipher session which performs the encrypt and decrypt operations for the lifetime of the channel.
7+
* **High-level I/O** - `io::Protocol` (sync) and `futures::Protocol` (async) handle the complete encrypted connection lifecycle including handshake, writes, and reads.
8+
* **Low-level components** - For applications requiring more control, `Handshake` is a type-safe state machine for the handshake protocol and `CipherSession` manages encryption/decryption after the handshake.
109

1110
## Feature Flags
1211

13-
* `std` -- Standard library dependencies for I/O, memory allocation, and random number generators.
14-
* `tokio` -- High level I/O wrappers for asynchronous tokio runtime.
12+
* `std` - Standard library dependencies for I/O, memory allocation, and random number generators.
13+
* `tokio` - High level I/O wrappers for the asynchronous tokio runtime.
1514

1615
## Minimum Supported Rust Version (MSRV)
1716

0 commit comments

Comments
 (0)