aboutsummaryrefslogtreecommitdiff
path: root/include/olm/base64.hh
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-07-08 15:30:34 +0100
committerMark Haines <mark.haines@matrix.org>2015-07-08 15:30:34 +0100
commit532dc0d4e79192a0c7fd1758322f6cae06959859 (patch)
treed8c553a7601c2688e04c74aed36979478d9f9f71 /include/olm/base64.hh
parentdceae043b30efb672acf41b21fbb335a6710b3c1 (diff)
Change the JSON format for one time keys to include what algorithm they are for
Diffstat (limited to 'include/olm/base64.hh')
-rw-r--r--include/olm/base64.hh10
1 files changed, 6 insertions, 4 deletions
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
);