From 532dc0d4e79192a0c7fd1758322f6cae06959859 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Wed, 8 Jul 2015 15:30:34 +0100 Subject: Change the JSON format for one time keys to include what algorithm they are for --- include/olm/base64.hh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'include/olm/base64.hh') diff --git a/include/olm/base64.hh b/include/olm/base64.hh index a68894d..018924a 100644 --- a/include/olm/base64.hh +++ b/include/olm/base64.hh @@ -21,12 +21,14 @@ namespace olm { -std::size_t encode_base64_length( +static std::size_t encode_base64_length( std::size_t input_length -); +) { + return 4 * ((input_length + 2) / 3) + (input_length + 2) % 3 - 2; +} -void encode_base64( +std::uint8_t * encode_base64( std::uint8_t const * input, std::size_t input_length, std::uint8_t * output ); @@ -37,7 +39,7 @@ std::size_t decode_base64_length( ); -void decode_base64( +std::uint8_t const * decode_base64( std::uint8_t const * input, std::size_t input_length, std::uint8_t * output ); -- cgit v1.2.3