Create a symmetric ratchet from a chain key and optional starting index.
Current chain state for serialization.
Advance the chain, producing a message key and updated chain key.
Uses HMAC-SHA256 with different constants for message key vs chain key derivation (standard Signal approach).
Derived per-message encryption key.
Message index in the chain.
A KDF chain that produces message keys from a chain key.
Each call to
next()advances the chain and returns a message key, providing forward secrecy at the symmetric level.