Expand description
Profile-safe protocol types and constants shared by software and RHDL models.
HashSigsRS implements a custom WOTS+ construction with n = 32 and
w = 16. It is a one-time signature: a private key must sign at most one
message. Reusing a key can reveal enough hash-chain material to forge a
signature.
This crate deliberately gives the legacy Keccak and generic SHA-256 profiles different Rust types. Their serialized keys and signatures do not contain a profile tag, so applications must also bind a profile identifier in their protocol or persistent metadata.
Structs§
- Hash
Sigs Sha256 Generic V1 - Performance profile using
HashSigsRS’s generic construction with SHA-256. - Legacy
Keccak - Legacy Keccak-256 profile, byte-compatible with pinned
HashSigsRS. - Length
Error - Error returned when a serialized protocol value has the wrong length.
- Message
Digest - An already-hashed 32-byte message consumed by the WOTS construction.
- Parse
Profile IdError - Error returned when text is not an exact canonical
ProfileIdencoding. - Private
Key - A one-time WOTS private key bound to cryptographic profile
P. - Private
Seed - A caller-supplied 32-byte seed used to derive one WOTS private key.
- Public
Key - A
HashSigsRSpublic key bound to cryptographic profileP. - Signature
- A 67-segment WOTS signature bound to cryptographic profile
P.
Enums§
- Profile
Id - Stable identifier for a cryptographic profile.
Constants§
- CHAIN_
COUNT - Number of WOTS signature chains (
len = len_1 + len_2). - CHAIN_
STEPS - Number of hash transitions from a secret segment to a chain endpoint.
- CHECKSUM_
DIGITS - Number of base-16 digits representing the WOTS checksum (
len_2). - FUSED_
OUTPUT_ BYTES - Number of bytes in a fused signature and public-key result.
- HASH_
BYTES - Hash output and WOTS security-parameter (
n) size in bytes. - LEGACY_
FUSED_ PRIVATE_ KEY_ KECCAK_ PERMUTATIONS Keccak-f[1600]permutations used by constant-work fused signing from a key.- LEGACY_
FUSED_ PRIVATE_ SEED_ KECCAK_ PERMUTATIONS Keccak-f[1600]permutations used by constant-work fused signing from a seed.- MASK_
COUNT - Number of randomization masks that can affect a
HashSigsRSresult. - MESSAGE_
BYTES - Length of an already-hashed message accepted by WOTS, in bytes.
- MESSAGE_
DIGITS - Number of base-16 digits representing the 256-bit message (
len_1). - PRF_
INPUT_ BYTES - Number of bytes hashed by the domain-separated pseudorandom function.
- PUBLIC_
KEY_ BYTES - Number of bytes in a serialized
HashSigsRSpublic key. - SHA256_
FUSED_ PRIVATE_ KEY_ COMPRESSION_ BLOCKS - SHA-256 compression blocks used by constant-work fused signing from a key.
- SHA256_
FUSED_ PRIVATE_ SEED_ COMPRESSION_ BLOCKS - SHA-256 compression blocks used by constant-work fused signing from a seed.
- SIGNATURE_
BYTES - Number of bytes in a serialized WOTS signature.
- WINTERNITZ_
W - Winternitz parameter (
w) and number of positions in each hash chain.
Traits§
- Profile
- Marker implemented by supported, compile-time-separated hash profiles.