pub struct Hbss {
pub scheme: Scheme,
pub w: u32,
pub batch: u32,
}Expand description
The hash-based one-time signature scheme (HBSS) and its batching.
DSig signs with W-OTS+: a message digest is cut into base-w digits, one
hash chain per digit plus a few checksum chains. Each chain is hashed
w − 1 times at key generation. Larger w means fewer, longer chains:
shorter signatures, more hashing. The built hardware is w = 4, 128-bit
digests (64 digits + 4 checksum digits = 68 chains of 3 steps) and
K = 128 keys per batch; every other combination is a model.
Fields§
§scheme: SchemeThe scheme; only W-OTS+ has hardware and a cost model.
w: u32Winternitz parameter: digits are base w, chains have w − 1 steps.
batch: u32Keys per batch, certified by one Ed25519 signature (K).
Implementations§
Source§impl Hbss
impl Hbss
Sourcepub const DIGEST_BITS: u32 = 128
pub const DIGEST_BITS: u32 = 128
Bits of the message digest that the digits encode.
Sourcepub fn message_digits(self) -> u32
pub fn message_digits(self) -> u32
Message digits: 128 / log2 w.
Sourcepub fn checksum_digits(self) -> u32
pub fn checksum_digits(self) -> u32
Checksum digits: the fewest base-w digits that can hold the largest
checksum, message_digits × (w − 1).
Sourcepub fn steps_per_key(self) -> f64
pub fn steps_per_key(self) -> f64
Chain steps to make one key: every chain hashed w − 1 times (204).
Sourcepub fn blake3_per_key(self) -> f64
pub fn blake3_per_key(self) -> f64
BLAKE3 compressions to make one key: 3 for seeds and nonces, the XOF that makes 18 secret bytes per chain, the commitment over 18 endpoint bytes per chain (plus a 16-byte prefix), and 2 for the Merkle leaf.
Sourcepub fn key_period(self) -> f64
pub fn key_period(self) -> f64
Cycles one slice needs per key: its three chain lanes do three steps per clock, its BLAKE3 lane one compression per clock, and the chain engine takes one chain per clock. The busiest of the three sets the period. For the built scheme every term but BLAKE3 is 68.
Sourcepub fn merkle_height(self) -> u32
pub fn merkle_height(self) -> u32
Merkle levels from a key to its batch root: log2 K.
Sourcepub fn signature_bytes(self) -> u32
pub fn signature_bytes(self) -> u32
Signature bytes: one 18-byte node per chain, one 32-byte sibling per Merkle level, and 194 bytes of fixed fields (nonces, indices, root, certificate). 1,642 for the built scheme.
Sourcepub fn verify_steps(self) -> f64
pub fn verify_steps(self) -> f64
Expected chain steps to finish one verification. The built scheme
uses VERIFY_CHAIN_STEPS; for other w each chain needs on average
half its length.
Sourcepub fn verify_blake3(self) -> f64
pub fn verify_blake3(self) -> f64
BLAKE3 compressions per verification: the endpoint commitment (its blocks plus one parent per extra 1 KiB chunk), the message digest and one per Merkle level. 21 + 1 + 7 = 29 for the built scheme, as the hardware counts (native simulation: 29.00 per record).
Trait Implementations§
impl Copy for Hbss
impl Eq for Hbss
impl StructuralPartialEq for Hbss
Auto Trait Implementations§
impl Freeze for Hbss
impl RefUnwindSafe for Hbss
impl Send for Hbss
impl Sync for Hbss
impl Unpin for Hbss
impl UnsafeUnpin for Hbss
impl UnwindSafe for Hbss
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more