From 3ae0618d44fdbb4f0987e3c7a6bd8d12f5a5a036 Mon Sep 17 00:00:00 2001 From: Stephan Bosch Date: Fri, 17 May 2019 10:09:11 +0200 Subject: [PATCH] lib: base64 - Add structural comments. --- src/lib/base64.c | 4 ++++ src/lib/base64.h | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/src/lib/base64.c b/src/lib/base64.c index 4887bbd5b3..a60a6af7ea 100644 --- a/src/lib/base64.c +++ b/src/lib/base64.c @@ -4,6 +4,10 @@ #include "base64.h" #include "buffer.h" +/* + * "base64" encoding (RFC 4648, Section 4) + */ + static const char b64enc[]; static const unsigned char b64dec[256]; diff --git a/src/lib/base64.h b/src/lib/base64.h index 0e0463df46..c52ec4fafe 100644 --- a/src/lib/base64.h +++ b/src/lib/base64.h @@ -1,6 +1,10 @@ #ifndef BASE64_H #define BASE64_H +/* + * Common Base64 + */ + /* max. buffer size required for base64_encode() */ #define MAX_BASE64_ENCODED_SIZE(size) \ ((((size) + 2) / 3) * 4) @@ -8,6 +12,10 @@ #define MAX_BASE64_DECODED_SIZE(size) \ (((size) + 3) / 4 * 3) +/* + * "base64" encoding (RFC 4648, Section 4) + */ + /* Translates binary data into base64. The src must not point to dest buffer. */ void base64_encode(const void *src, size_t src_size, buffer_t *dest); -- 2.47.3