Module: types

class doubleratchet.types.EncryptedMessage(header, ciphertext)[source]

Bases: NamedTuple

A Double Ratchet-encrypted message, consisting of the header and ciphertext.

Parameters:
header: Header

Alias for field number 0

ciphertext: bytes

Alias for field number 1

class doubleratchet.types.Header(ratchet_pub, previous_sending_chain_length, sending_chain_length)[source]

Bases: NamedTuple

The header structure sent with each Double Ratchet-encrypted message, containing the metadata to keep the ratchets synchronized.

Parameters:
  • ratchet_pub (bytes)

  • previous_sending_chain_length (int)

  • sending_chain_length (int)

ratchet_pub: bytes

Alias for field number 0

previous_sending_chain_length: int

Alias for field number 1

sending_chain_length: int

Alias for field number 2

Type Aliases

doubleratchet.types.JSONType

alias of Mapping[str, JSONType] | List[JSONType] | str | int | float | bool | None

doubleratchet.types.JSONObject

alias of Mapping[str, JSONType]

doubleratchet.types.SkippedMessageKeys

alias of OrderedDict[Tuple[bytes, int], bytes]