Skip to main content

Crate hashsigs_types

Crate hashsigs_types 

Source
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§

HashSigsSha256GenericV1
Performance profile using HashSigsRS’s generic construction with SHA-256.
LegacyKeccak
Legacy Keccak-256 profile, byte-compatible with pinned HashSigsRS.
LengthError
Error returned when a serialized protocol value has the wrong length.
MessageDigest
An already-hashed 32-byte message consumed by the WOTS construction.
ParseProfileIdError
Error returned when text is not an exact canonical ProfileId encoding.
PrivateKey
A one-time WOTS private key bound to cryptographic profile P.
PrivateSeed
A caller-supplied 32-byte seed used to derive one WOTS private key.
PublicKey
A HashSigsRS public key bound to cryptographic profile P.
Signature
A 67-segment WOTS signature bound to cryptographic profile P.

Enums§

ProfileId
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 HashSigsRS result.
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 HashSigsRS public 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.