diff options
author | Richard van der Hoff <richard@matrix.org> | 2016-05-17 18:53:00 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2016-05-24 13:39:34 +0100 |
commit | c058554132a0f97e8e8ae3a402605220f8fdaed4 (patch) | |
tree | a838740b55b86933875c6535b79d436ee6860bd0 /include/olm/megolm.h | |
parent | caaed796ad54de3f8ee1e56123973ae9ace346b9 (diff) |
Implement pickling/unpickling for outbound group sessions
Diffstat (limited to 'include/olm/megolm.h')
-rw-r--r-- | include/olm/megolm.h | 15 |
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); |