aboutsummaryrefslogtreecommitdiff
path: root/include/olm/base64.hh
diff options
context:
space:
mode:
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
);