aboutsummaryrefslogtreecommitdiff
path: root/include/axolotl/ratchet.hh
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-06-12 16:15:37 +0100
committerMark Haines <mark.haines@matrix.org>2015-06-12 16:15:37 +0100
commit6fe3b7eb73fb11e1cba27b28add5b14430b66259 (patch)
treee2e526e4f5593cb8d978f1b8955b80c9c2d88b4e /include/axolotl/ratchet.hh
parent28541dd82a9e4a99661ba32905b8488d35e70fe3 (diff)
Move utils for pickling into a separate file
Diffstat (limited to 'include/axolotl/ratchet.hh')
-rw-r--r--include/axolotl/ratchet.hh32
1 files changed, 17 insertions, 15 deletions
diff --git a/include/axolotl/ratchet.hh b/include/axolotl/ratchet.hh
index eaf1352..0874cf0 100644
--- a/include/axolotl/ratchet.hh
+++ b/include/axolotl/ratchet.hh
@@ -114,21 +114,6 @@ struct Ratchet {
Curve25519KeyPair const & our_ratchet_key
);
- /** The number of bytes needed to persist the current session. */
- std::size_t pickle_length();
-
- /** Persists a session as a sequence of bytes
- * Returns the number of output bytes used. */
- std::size_t pickle(
- std::uint8_t * output, std::size_t output_length
- );
-
- /** Loads a session from a sequence of bytes.
- * Returns 0 on success, or std::size_t(-1) on failure. */
- std::size_t unpickle(
- std::uint8_t * input, std::size_t input_length
- );
-
/** The number of bytes of output the encrypt method will write for
* a given message length. */
std::size_t encrypt_output_length(
@@ -172,4 +157,21 @@ struct Ratchet {
};
+std::size_t pickle_length(
+ Ratchet const & value
+);
+
+
+std::uint8_t * pickle(
+ std::uint8_t * pos,
+ Ratchet const & value
+);
+
+
+std::uint8_t const * unpickle(
+ std::uint8_t const * pos, std::uint8_t const * end,
+ Ratchet & value
+);
+
+
} // namespace axolotl