Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
nettle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dmitry Baryshkov
nettle
Commits
434b2682
Commit
434b2682
authored
22 years ago
by
Niels Möller
Browse files
Options
Downloads
Patches
Plain Diff
* base64.h (BASE64_ENCODE_LENGTH, BASE64_DECODE_LENGTH): Fixed and
documented macros. Rev: src/nettle/base64.h:1.9
parent
c0042966
No related branches found
Branches containing commit
Tags
v8.0.1436
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
base64.h
+6
-6
6 additions, 6 deletions
base64.h
with
6 additions
and
6 deletions
base64.h
+
6
−
6
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
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment