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
Dmitry Baryshkov
nettle
Commits
4cef4bd0
Commit
4cef4bd0
authored
Oct 06, 2002
by
Niels Möller
Browse files
(base64_encode_group): New function, used by openpgp
armoring code. Rev: src/nettle/base64.c:1.5 Rev: src/nettle/base64.h:1.7
parent
3dd1a881
Changes
2
Hide whitespace changes
Inline
Side-by-side
base64.c
View file @
4cef4bd0
...
...
@@ -59,6 +59,15 @@ static const signed char decode_table[256] =
#define ENCODE(x) (encode_table[0x3F & (x)])
void
base64_encode_group
(
uint8_t
*
dst
,
uint32_t
group
)
{
*
dst
++
=
ENCODE
(
group
>>
18
);
*
dst
++
=
ENCODE
(
group
>>
12
);
*
dst
++
=
ENCODE
(
group
>>
6
);
*
dst
++
=
ENCODE
(
group
);
}
unsigned
base64_encode
(
uint8_t
*
dst
,
unsigned
src_length
,
...
...
base64.h
View file @
4cef4bd0
...
...
@@ -46,6 +46,10 @@ base64_encode(uint8_t *dst,
((BASE64_BINARY_BLOCK_SIZE - 1 + (src_length)) \
/ BASE64_BINARY_BLOCK_SIZE * BASE64_TEXT_BLOCK_SIZE)
/* Encode a single group */
void
base64_encode_group
(
uint8_t
*
dst
,
uint32_t
group
);
/* FIXME: Perhaps rename to base64_decode_ctx? */
struct
base64_ctx
/* Internal, do not modify */
{
...
...
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