]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
(BASE64_DECODE_LENGTH): Comment fix.
authorNiels Möller <nisse@lysator.liu.se>
Tue, 1 Oct 2002 09:08:02 +0000 (11:08 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Tue, 1 Oct 2002 09:08:02 +0000 (11:08 +0200)
Rev: src/nettle/base64.h:1.6

base64.h

index d69c9ccdb72c2014ed601c412668066b69fe2357..c91c5b33cac61df5301b00ff9e6ab06ed3e81e55 100644 (file)
--- a/base64.h
+++ b/base64.h
@@ -65,8 +65,14 @@ base64_decode_update(struct base64_ctx *ctx,
                      unsigned src_length,
                      const uint8_t *src);
 
-/* FIXME: Does this always round correctly? */
-/* Maximum length of decoded data */
+/* Maximum length of decoded data.
+ *
+ * NOTE: This size should work even for improper base 64 data. For
+ * example, consider an (encoded) input string of two bytes. When
+ * we'll generate one byte of output before noticing that the input is
+ * truncated. And BASE64_DECODE_LENGTH(2) == 2*3/4 == 1, so that is
+ * just fine. */
+
 #define BASE64_DECODE_LENGTH(src_length) \
        ((src_length) * BASE64_BINARY_BLOCK_SIZE / BASE64_TEXT_BLOCK_SIZE)