Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Wim Lewis
nettle
Commits
cff9e510
Commit
cff9e510
authored
Sep 30, 2002
by
Niels Möller
Browse files
(base64_encode): Broke out some common code from the switch..
Rev: src/nettle/base64.c:1.4
parent
0384fc6f
Changes
1
Show whitespace changes
Inline
Side-by-side
base64.c
View file @
cff9e510
...
...
@@ -71,27 +71,24 @@ base64_encode(uint8_t *dst,
if
(
left_over
)
{
in
-=
left_over
;
*--
out
=
'='
;
switch
(
left_over
)
{
case
1
:
in
--
;
*--
out
=
'='
;
*--
out
=
'='
;
*--
out
=
ENCODE
(
in
[
0
]
<<
4
);
*--
out
=
ENCODE
(
in
[
0
]
>>
2
);
break
;
case
2
:
in
-=
2
;
*--
out
=
'='
;
*--
out
=
ENCODE
(
in
[
1
]
<<
2
);
*--
out
=
ENCODE
((
in
[
0
]
<<
4
)
|
(
in
[
1
]
>>
4
));
*--
out
=
ENCODE
(
in
[
0
]
>>
2
);
break
;
default:
abort
();
}
*--
out
=
ENCODE
(
in
[
0
]
>>
2
);
}
while
(
in
>
src
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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