pub struct WinternitzPubkey<const N: usize> { /* private fields */ }Expand description
Public Winternitz key: N message scalars followed by 2 checksum scalars,
each 32 bytes. Total size is (N + 2) * 32 bytes.
Each pubkey scalar equals SHA256 applied 255 times to the corresponding
privkey scalar. N must be even and in 16..=32 (compile-time enforced).
Implementations§
Source§impl<const N: usize> WinternitzPubkey<N>
impl<const N: usize> WinternitzPubkey<N>
Sourcepub fn as_bytes(&self) -> &[u8]
pub fn as_bytes(&self) -> &[u8]
Return the pubkey’s (N + 2) * 32 raw bytes (message scalars then
checksum scalars), with no copy.
Sourcepub fn merklize(&self) -> WinternitzRoot
pub fn merklize(&self) -> WinternitzRoot
Compute the Merkle root over all N + 2 scalars. Leaves are
SHA256(0x00 || scalar); internal nodes are SHA256(0x01 || L || R)
(domain-separated). The tree shape is “rightmost-duplication on odd
levels” — equivalently, an online stack-collapse where leaves are
streamed left-to-right, adjacent same-level entries combine on push,
and any orphan top-of-stack at drain is lifted to its left
neighbour’s level by repeated self-duplication.