Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ _default:

# Run benchmarks.
bench:
cargo +{{NIGHTLY_TOOLCHAIN}} bench --package bip324 --bench packet_handler
cargo +{{NIGHTLY_TOOLCHAIN}} bench --package bip324 --bench cipher_session

# Run fuzz test: handshake.
@fuzz target="handshake" time="60":
Expand Down
2 changes: 1 addition & 1 deletion protocol/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The library is designed with a bare `no_std` and "Sans I/O" interface to keep it

The `futures` feature includes the high-level `AsyncProcotol` type which helps create and manage an encrypted channel.

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. A successful handshake results in a packet handler which performs the encrypt and decrypt operations for the lifetime of the channel.
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.

## Feature Flags

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ extern crate test;
use bip324::{CipherSession, Handshake, InboundCipher, Network, OutboundCipher, PacketType, Role};
use test::{black_box, Bencher};

fn create_packet_handler_pair() -> (CipherSession, CipherSession) {
fn create_cipher_session_pair() -> (CipherSession, CipherSession) {
// Create a proper handshake between Alice and Bob.
let mut alice_init_buffer = vec![0u8; 64];
let mut alice_handshake = Handshake::new(
Expand Down Expand Up @@ -62,7 +62,7 @@ fn create_packet_handler_pair() -> (CipherSession, CipherSession) {
#[bench]
fn bench_round_trip_small_packet(b: &mut Bencher) {
let plaintext = b"Hello, World!"; // ~13 bytes.
let (mut alice, mut bob) = create_packet_handler_pair();
let (mut alice, mut bob) = create_cipher_session_pair();

b.iter(|| {
// Encrypt the packet.
Expand Down Expand Up @@ -101,7 +101,7 @@ fn bench_round_trip_small_packet(b: &mut Bencher) {
#[bench]
fn bench_round_trip_large_packet(b: &mut Bencher) {
let plaintext = vec![0u8; 4096]; // 4KB packet.
let (mut alice, mut bob) = create_packet_handler_pair();
let (mut alice, mut bob) = create_cipher_session_pair();

b.iter(|| {
// Encrypt the packet.
Expand Down
Loading