From 08a7e44a966047a10d7e959d4a8cdeaaf4139ce0 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Fri, 12 Jun 2015 09:08:15 +0100 Subject: Pass the message body to decrypt_max_plaintext_length so we can get a more accurate estimate, rename encrypt_max_output_length to encrypt_output_length and change the api to return the exact number of bytes needed to hold the message --- include/axolotl/ratchet.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/axolotl/ratchet.hh') diff --git a/include/axolotl/ratchet.hh b/include/axolotl/ratchet.hh index f7d30d0..eaf1352 100644 --- a/include/axolotl/ratchet.hh +++ b/include/axolotl/ratchet.hh @@ -129,9 +129,9 @@ struct Ratchet { std::uint8_t * input, std::size_t input_length ); - /** The maximum number of bytes of output the encrypt method will write for + /** The number of bytes of output the encrypt method will write for * a given message length. */ - std::size_t encrypt_max_output_length( + std::size_t encrypt_output_length( std::size_t plaintext_length ); @@ -154,7 +154,7 @@ struct Ratchet { /** An upper bound on the number of bytes of plain-text the decrypt method * will write for a given input message length. */ std::size_t decrypt_max_plaintext_length( - std::size_t input_length + std::uint8_t const * input, std::size_t input_length ); /** Decrypt a message. Returns the length of the decrypted plain-text or -- cgit v1.2.3