Skip to content

Commit

Permalink
ConnID: With quadruple_size, support the maximum easy lengths
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysn committed Nov 4, 2024
1 parent 7238db0 commit 2867756
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion shared/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ pub const MAX_EAD_SIZE_LEN: usize = SCALE_FACTOR * 64;
/// Maximum length of a [`ConnId`] (`C_x`).
///
/// This length includes the leading CBOR encoding byte(s).
const MAX_CONNID_ENCODED_LEN: usize = 8;
// If ints had a const `.clamp()` feature, this could be (8 * SCALE_FACTOR).clamp(1, 23).
const MAX_CONNID_ENCODED_LEN: usize = if cfg!(feature = "quadruple_sizes") {
24
} else {
8
};

pub type BytesSuites = [u8; SUITES_LEN];
pub type BytesSupportedSuites = [u8; SUPPORTED_SUITES_LEN];
Expand Down

0 comments on commit 2867756

Please sign in to comment.