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
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Norbert Pócs
nettle
Commits
b175384e
Commit
b175384e
authored
Mar 12, 2015
by
Niels Möller
Browse files
Options
Downloads
Patches
Plain Diff
Micro optimization of base64 and base16 context structs.
parent
f8ef502e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
ChangeLog
+5
-0
5 additions, 0 deletions
ChangeLog
base16.h
+2
-2
2 additions, 2 deletions
base16.h
base64.h
+6
-6
6 additions, 6 deletions
base64.h
with
13 additions
and
8 deletions
ChangeLog
+
5
−
0
View file @
b175384e
2015-03-12 Niels Möller <nisse@diamant.hack.org>
* base64.h (struct base64_encode_ctx): Micro optimization of
struct layout, saving a few bytes.
(struct base64_decode_ctx): Likewise.
* base16.h (struct base16_decode_ctx): Likewise.
* nettle.texinfo (ASCII encoding): Document base64url functions.
2015-03-10 Niels Möller <nisse@diamant.hack.org>
...
...
This diff is collapsed.
Click to expand it.
base16.h
+
2
−
2
View file @
b175384e
...
...
@@ -74,8 +74,8 @@ base16_encode_update(uint8_t *dst,
struct
base16_decode_ctx
{
unsigned
word
;
/* Leftover bits */
unsigned
bits
;
/* Number buffered bits */
unsigned
char
word
;
/* Leftover bits */
unsigned
char
bits
;
/* Number buffered bits */
};
void
...
...
This diff is collapsed.
Click to expand it.
base64.h
+
6
−
6
View file @
b175384e
...
...
@@ -73,9 +73,9 @@ extern "C" {
struct
base64_encode_ctx
{
unsigned
word
;
/* Leftover bits */
unsigned
bits
;
/* Number of bits, always 0, 2, or 4. */
const
uint8_t
*
alphabet
;
/* Alphabet to use for encoding */
unsigned
short
word
;
/* Leftover bits */
unsigned
char
bits
;
/* Number of bits, always 0, 2, or 4. */
};
/* Initialize encoding context for base-64 */
...
...
@@ -126,12 +126,12 @@ base64_encode_group(uint8_t *dst, uint32_t group);
struct
base64_decode_ctx
{
unsigned
word
;
/* Leftover bits */
unsigned
bits
;
/* Number buffered bits */
const
signed
char
*
table
;
/* Decoding table */
unsigned
short
word
;
/* Leftover bits */
unsigned
char
bits
;
/* Number buffered bits */
/* Number of padding characters encountered */
unsigned
padding
;
const
signed
char
*
table
;
/* Decoding table */
unsigned
char
padding
;
};
/* Initialize decoding context for base-64 */
...
...
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