matrix.megolm

Undocumented in source.

Members

Functions

megolm_advance
void megolm_advance(Megolm* megolm)

advance the ratchet by one step

megolm_advance_to
void megolm_advance_to(Megolm* megolm, uint advance_to)

advance the ratchet to a given count

megolm_get_data
const(ubyte)* megolm_get_data(Megolm* megolm)

get the key data in the ratchet. The returned data is MEGOLM_RATCHET_LENGTH bytes long.

megolm_init
void megolm_init(Megolm* megolm, const(ubyte)* random_data, uint counter)

initialize the megolm ratchet. random_data should be at least MEGOLM_RATCHET_LENGTH bytes of randomness.

megolm_pickle
ubyte* megolm_pickle(Megolm* megolm, ubyte* pos)

Pickle the megolm. Returns a pointer to the next free space in the buffer.

megolm_pickle_length
size_t megolm_pickle_length(Megolm* megolm)

Returns the number of bytes needed to store a megolm

megolm_unpickle
const(ubyte)* megolm_unpickle(Megolm* megolm, const(ubyte)* pos, const(ubyte)* end)

Unpickle the megolm. Returns a pointer to the next item in the buffer.

Manifest constants

MEGOLM_RATCHET_LENGTH
enum MEGOLM_RATCHET_LENGTH;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
MEGOLM_RATCHET_PARTS
enum MEGOLM_RATCHET_PARTS;

number of parts in the ratchet; the advance() implementations rely on this being 4.

MEGOLM_RATCHET_PART_LENGTH
enum MEGOLM_RATCHET_PART_LENGTH;

number of bytes in each part of the ratchet; this should be the same as the length of the hash function used in the HMAC (32 bytes for us, as we use HMAC-SHA-256)

Structs

Megolm
struct Megolm
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
_olm_cipher
struct _olm_cipher
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.

Variables

megolm_cipher
_olm_cipher* megolm_cipher;

The cipher used in megolm-backed conversations

Meta