mirror of
https://github.com/kristoferssolo/tls-pq-bench.git
synced 2026-03-22 00:36:21 +00:00
refactor(common): add prelude module
This commit is contained in:
@@ -1,8 +1,3 @@
|
||||
//! Self-signed certificate generation for local testing.
|
||||
//!
|
||||
//! Generates a CA certificate and server certificate for TLS benchmarking.
|
||||
//! These certificates are NOT suitable for production use.
|
||||
|
||||
use rcgen::{BasicConstraints, CertificateParams, DnType, IsCa, Issuer, KeyPair, SanType};
|
||||
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
pub mod cert;
|
||||
pub mod error;
|
||||
pub mod prelude;
|
||||
pub mod protocol;
|
||||
|
||||
pub use error::Error;
|
||||
|
||||
4
common/src/prelude.rs
Normal file
4
common/src/prelude.rs
Normal file
@@ -0,0 +1,4 @@
|
||||
pub use crate::{
|
||||
BenchRecord, KeyExchangeMode,
|
||||
protocol::{read_payload, read_request, write_payload, write_request},
|
||||
};
|
||||
@@ -1,11 +1,3 @@
|
||||
//! Benchmark protocol implementation.
|
||||
//!
|
||||
//! Protocol specification:
|
||||
//! 1. Client sends 8-byte little-endian u64: requested payload size N
|
||||
//! 2. Server responds with exactly N bytes (deterministic pattern)
|
||||
//!
|
||||
//! The deterministic pattern is a repeating sequence of bytes 0x00..0xFF.
|
||||
|
||||
// Casts are intentional: MAX_PAYLOAD_SIZE (16 MiB) fits in usize on 64-bit,
|
||||
// and byte patterns are explicitly masked to 0xFF before casting.
|
||||
#![allow(clippy::cast_possible_truncation)]
|
||||
|
||||
Reference in New Issue
Block a user