From: miha-q <> Date: Thu, 1 Feb 2024 02:00:17 +0000 (-0500) Subject: Wed Jan 31 09:00:17 PM EST 2024 X-Git-Url: http://www.foleosoft.com/?a=commitdiff_plain;h=79f2c82a3e53dcaa481d2790c2a8ab7117f6e858;p=CryptoFoleo.git Wed Jan 31 09:00:17 PM EST 2024 --- 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) {