From 79f2c82a3e53dcaa481d2790c2a8ab7117f6e858 Mon Sep 17 00:00:00 2001 From: miha-q <> Date: Wed, 31 Jan 2024 21:00:17 -0500 Subject: [PATCH] Wed Jan 31 09:00:17 PM EST 2024 --- bin/CryptoFoleo.h | 8 ++++---- src/encodings.c | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/bin/CryptoFoleo.h b/bin/CryptoFoleo.h index 5aee984..e906681 100644 --- a/bin/CryptoFoleo.h +++ b/bin/CryptoFoleo.h @@ -54,9 +54,9 @@ uint8_t foleo_hash_size(uint8_t); void foleo_rand_mode(uint8_t, uint8_t*); -uint8_t* foleo_base64_decode(uint8_t*, size_t*); -uint8_t* foleo_hex_decode(uint8_t*); -uint8_t* foleo_hex_encode(uint8_t*, size_t); -uint8_t* foleo_base64_encode(uint8_t*, size_t); +uint8_t* foleo_decode_base64(uint8_t*, size_t*); +uint8_t* foleo_decode_hex(uint8_t*); +uint8_t* foleo_encode_hex(uint8_t*, size_t); +uint8_t* foleo_encode_base64(uint8_t*, size_t); #endif diff --git a/src/encodings.c b/src/encodings.c index 47bb330..96a8255 100644 --- a/src/encodings.c +++ b/src/encodings.c @@ -201,6 +201,13 @@ uint8_t* foleo_encode_base64(uint8_t* data, size_t dataS) buffer >>= 16 - bufferS; ret = realloc(ret, retS + 1); ret[retS++] = c; + if (bufferS == 6) + { + ret = realloc(ret, retS + 1); + ret[retS++] = foleo_base64_encode1(buffer); + buffer = 0; + bufferS = 0; + } } switch (bufferS) { -- 2.39.5