Serialize ratchet state for persistence.
StaticinitInitialize a Double Ratchet as the initiator (Alice).
Initial shared secret from PQXDH (hex, 32 bytes).
Bob's initial ratchet public key (hex).
StaticinitInitialize a Double Ratchet as the responder (Bob).
Initial shared secret from PQXDH (hex, 32 bytes).
Bob's initial ratchet key pair {privateKey, publicKey} (hex).
StaticfromRestore a Double Ratchet from a previously serialized state.
Encrypt a plaintext message.
Advances the sending symmetric chain and encrypts with XChaCha20-Poly1305 using the derived message key.
Decrypt an incoming message.
If the message header contains a new ratchet public key, performs a DH ratchet step first to derive the receiving chain key.
Double Ratchet providing forward secrecy and break-in recovery.
Combines: