Skip to main content

Crate hashsigs_reference

Crate hashsigs_reference 

Source
Expand description

Auditable software oracle for the two HashSigs RHDL cryptographic profiles.

The implementation follows pinned HashSigsRS commit 2d315dd4168804b7cbc51c51a1bf7ca27bf74140. It intentionally models only the non-Solana WOTS+ primitive. It is suitable for test-vector generation, differential tests, and checking hardware behavior; it has not been audited as a production cryptographic library.

§Security boundary

  • A private WOTS key may sign one message only. Key reuse can enable forgeries. Signing APIs consume private-key values, but durable one-time use remains the caller’s responsibility.
  • Inputs are already-hashed 32-byte messages. Applications must define their own collision-resistant, domain-separated prehash.
  • HashSigsRS uses shared masks and a simplified address construction. It is not RFC 8391 XMSS, FIPS 205 SLH-DSA, or a many-time signature scheme.
  • LegacyKeccak uses legacy Keccak-256 padding and is byte-compatible with upstream. HashSigsSha256GenericV1 is a distinct, incompatible profile.

Structs§

FusedOutput
Output produced by a constant-work fused sign-and-public-key operation.
HashSigsSha256GenericV1
Performance profile using HashSigsRS’s generic construction with SHA-256.
KeyPair
A generated public/private key pair for one WOTS signing operation.
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.
Wots
Stateless HashSigsRS WOTS+ reference implementation for 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.
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.
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.
ReferenceProfile
Hash behavior associated with one supported reference profile.

Type Aliases§

HashValue
A 32-byte hash value used internally by the WOTS construction.
LegacyKeccakWots
Byte-compatible oracle for the pinned HashSigsRS Keccak construction.
Sha256GenericWots
Oracle for the incompatible SHA-256 generic performance profile.