aboutsummaryrefslogtreecommitdiff
path: root/include/olm/megolm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/olm/megolm.h')
-rw-r--r--include/olm/megolm.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/olm/megolm.h b/include/olm/megolm.h
index 5cae353..831c6fb 100644
--- a/include/olm/megolm.h
+++ b/include/olm/megolm.h
@@ -61,6 +61,21 @@ const struct _olm_cipher *megolm_cipher();
*/
void megolm_init(Megolm *megolm, uint8_t const *random_data, uint32_t counter);
+/** Returns the number of bytes needed to store a megolm */
+size_t megolm_pickle_length(const Megolm *megolm);
+
+/**
+ * Pickle the megolm. Returns a pointer to the next free space in the buffer.
+ */
+uint8_t * megolm_pickle(const Megolm *megolm, uint8_t *pos);
+
+/**
+ * Unpickle the megolm. Returns a pointer to the next item in the buffer.
+ */
+const uint8_t * megolm_unpickle(Megolm *megolm, const uint8_t *pos,
+ const uint8_t *end);
+
+
/** advance the ratchet by one step */
void megolm_advance(Megolm *megolm);