Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Marcus Hoffmann
nettle
Commits
434b2682
Commit
434b2682
authored
Oct 19, 2002
by
Niels Möller
Browse files
* base64.h (BASE64_ENCODE_LENGTH, BASE64_DECODE_LENGTH): Fixed and
documented macros. Rev: src/nettle/base64.h:1.9
parent
c0042966
Changes
1
Hide whitespace changes
Inline
Side-by-side
base64.h
View file @
434b2682
...
...
@@ -35,9 +35,9 @@
/* Base64 encoding */
/* Maximum length of output for base64_encode_update. NOTE: Doesn't
* include any padding that base64_encode_final may add. */
/*
FIXME: Rewrite to only evaluate LENGTH once
. */
#define BASE64_ENCODE_LENGTH(length) ((length)
+ ((length)
+
2
)/
3
)
* include any padding that base64_encode_final may add. */
/*
We have at most 4 buffered bits, and a total of (4 + length * 8) bits
. */
#define BASE64_ENCODE_LENGTH(length) ((
(
length)
* 8
+
4
)/
6
)
/* Maximum lengbth of output generated by base64_encode_final. */
#define BASE64_ENCODE_FINAL_LENGTH 3
...
...
@@ -89,9 +89,9 @@ base64_encode_group(uint8_t *dst, uint32_t group);
/* Base64 decoding */
/*
FIXME: Think more about this definition
. */
#define BASE64_DECODE_LENGTH(length) \
((length) * BASE64_BINARY_BLOCK_SIZE / BASE64_TEXT_BLOCK_SIZE
)
/*
Maximum length of output for base64_decode_update
. */
/* We have at most 6 buffered bits, and a total of (length + 1) * 6 bits. */
#define BASE64_DECODE_LENGTH(length) ((((length) + 1) * 6) / 8
)
struct
base64_decode_ctx
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment