Skip to content

Commit ee09eb7

Browse files
committed
fix: old packet handler refs missed in refactor
1 parent 954543f commit ee09eb7

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ _default:
7373

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

7878
# Run fuzz test: handshake.
7979
@fuzz target="handshake" time="60":

protocol/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The library is designed with a bare `no_std` and "Sans I/O" interface to keep it
66

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

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

1111
## Feature Flags
1212

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extern crate test;
55
use bip324::{CipherSession, Handshake, InboundCipher, Network, OutboundCipher, PacketType, Role};
66
use test::{black_box, Bencher};
77

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

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

106106
b.iter(|| {
107107
// Encrypt the packet.

protocol/tests/round_trips.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ fn regtest_handshake() {
147147
.authenticate_garbage_and_version(response, &mut packet_buffer)
148148
.unwrap();
149149
println!("Finalizing the handshake");
150-
let packet_handler = handshake.finalize().unwrap();
151-
let (mut decrypter, mut encrypter) = packet_handler.into_split();
150+
let cipher_session = handshake.finalize().unwrap();
151+
let (mut decrypter, mut encrypter) = cipher_session.into_split();
152152
let now = SystemTime::now()
153153
.duration_since(UNIX_EPOCH)
154154
.expect("time went backwards")

0 commit comments

Comments
 (0)