diff options
author | Mark Haines <mark.haines@matrix.org> | 2015-06-11 18:03:22 +0100 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2015-06-11 18:03:22 +0100 |
commit | 793b9b910a8f3c010a55433188e4b63414cbb314 (patch) | |
tree | ca5f8621273bc4b55f7e584a39529954a84da14c /src | |
parent | bcb05d1a9982c0a22e41ecfa6f9aba212587c782 (diff) |
Start writing the interfaces for session and the account objects
Diffstat (limited to 'src')
-rw-r--r-- | src/ratchet.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ratchet.cpp b/src/ratchet.cpp index bdd0ba3..5097643 100644 --- a/src/ratchet.cpp +++ b/src/ratchet.cpp @@ -215,11 +215,11 @@ void axolotl::Ratchet::initialise_as_alice( } -std::size_t axolotl::Ratchet::pickle_max_output_length() { +std::size_t axolotl::Ratchet::pickle_length() { std::size_t counter_length = 4; std::size_t send_chain_length = counter_length + 64 + 32; std::size_t recv_chain_length = counter_length + 32 + 32; - std::size_t skip_key_length = counter_length + 32 + 32 + 32 + 16; + std::size_t skip_key_length = counter_length + 32 + 32; std::size_t pickle_length = 3 * counter_length + 32; pickle_length += sender_chain.size() * send_chain_length; pickle_length += receiver_chains.size() * recv_chain_length; @@ -265,10 +265,10 @@ std::uint8_t * unpickle_bytes( std::size_t axolotl::Ratchet::pickle( - std::uint8_t * output, std::size_t max_output_length + std::uint8_t * output, std::size_t output_length ) { std::uint8_t * pos = output; - if (max_output_length < pickle_max_output_length()) { + if (output_length < pickle_length()) { last_error = axolotl::ErrorCode::OUTPUT_BUFFER_TOO_SMALL; return std::size_t(-1); } |