aboutsummaryrefslogtreecommitdiff
path: root/include/olm/ratchet.hh
diff options
context:
space:
mode:
authorRichard van der Hoff <github@rvanderhoff.org.uk>2016-09-05 10:36:43 +0100
committerGitHub <noreply@github.com>2016-09-05 10:36:43 +0100
commit9d16d820890e7b301baa8b69694aaea19f9bfc7f (patch)
tree659be65eb1b131073bf9580292214b3fc24aa982 /include/olm/ratchet.hh
parent0c3f527dfd46d3056d5b3690836c102f0e0adfb4 (diff)
parent39212987bdef8e16794e756e3c78b531be25b70a (diff)
Merge pull request #13 from matrix-org/rav/split_out_key_lengths
Create new constants for key lengths, etc
Diffstat (limited to 'include/olm/ratchet.hh')
-rw-r--r--include/olm/ratchet.hh7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/olm/ratchet.hh b/include/olm/ratchet.hh
index 13f7097..e91d634 100644
--- a/include/olm/ratchet.hh
+++ b/include/olm/ratchet.hh
@@ -21,8 +21,13 @@ struct _olm_cipher;
namespace olm {
-typedef std::uint8_t SharedKey[olm::KEY_LENGTH];
+/** length of a shared key: the root key R(i), chain key C(i,j), and message key
+ * M(i,j)). They are all only used to stuff into HMACs, so could be any length
+ * for that. The chain key and message key are both derived from SHA256
+ * operations, so their length is determined by that. */
+const std::size_t OLM_SHARED_KEY_LENGTH = SHA256_OUTPUT_LENGTH;
+typedef std::uint8_t SharedKey[OLM_SHARED_KEY_LENGTH];
struct ChainKey {
std::uint32_t index;