aboutsummaryrefslogtreecommitdiff
path: root/include/olm/ratchet.hh
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2016-04-26 11:44:32 +0100
committerRichard van der Hoff <richard@matrix.org>2016-04-26 17:55:26 +0100
commit9848f8445292ad3f7ff92bd4abfeb8f2d08ec32d (patch)
tree36f1f030f71bd16b85e0fe1aa77c42f457a3b168 /include/olm/ratchet.hh
parente7a2af1ede768589e612bad1c61b10186a1bb686 (diff)
Add some logging to help understand what's going on
Diffstat (limited to 'include/olm/ratchet.hh')
-rw-r--r--include/olm/ratchet.hh13
1 files changed, 11 insertions, 2 deletions
diff --git a/include/olm/ratchet.hh b/include/olm/ratchet.hh
index 2393e5b..071e349 100644
--- a/include/olm/ratchet.hh
+++ b/include/olm/ratchet.hh
@@ -29,7 +29,6 @@ struct ChainKey {
SharedKey key;
};
-
struct MessageKey {
std::uint32_t index;
SharedKey key;
@@ -82,8 +81,18 @@ struct Ratchet {
/** The last error that happened encrypting or decrypting a message. */
ErrorCode last_error;
+ /**
+ * A count of the number of times the root key has been advanced; this is
+ * maintained purely for diagnostics.
+ *
+ * If sender_chain is empty, this will be the index of the current receiver
+ * chain (odd for Alice, even for Bob); otherwise, the index of the current
+ * sender chain (even for Alice, odd for Bob).
+ */
+ std::uint32_t chain_index;
+
/** The root key is used to generate chain keys from the ephemeral keys.
- * A new root_key derived each time a chain key is derived. */
+ * A new root_key derived each time a new chain is started. */
SharedKey root_key;
/** The sender chain is used to send messages. Each time a new ephemeral