#include "xyssl/base64.h"Go to the source code of this file.
Defines | |
| #define | _CRT_SECURE_NO_DEPRECATE 1 |
Functions | |
| int | base64_encode (unsigned char *dst, int *dlen, unsigned char *src, int slen) |
| Encode a buffer into base64 format. | |
| int | base64_decode (unsigned char *dst, int *dlen, unsigned char *src, int slen) |
| Decode a base64-formatted buffer. | |
| int | base64_self_test (int verbose) |
| Checkup routine. | |
Variables | |
| static const int | base64_enc_map [64] |
| static const int | base64_dec_map [128] |
| static const char | _base64_src [] = "_base64_src" |
Decode a base64-formatted buffer.
| dst | destination buffer | |
| dlen | size of the buffer (updated after call) | |
| src | source buffer | |
| slen | amount of data to be decoded |
Definition at line 121 of file base64.c.
References base64_dec_map, ERR_BASE64_BUFFER_TOO_SMALL, and ERR_BASE64_INVALID_CHARACTER.
Referenced by x509_add_certs(), and x509_parse_key().
Encode a buffer into base64 format.
| dst | destination buffer | |
| dlen | size of the buffer (updated after call) | |
| src | source buffer | |
| slen | amount of data to be encoded |
Definition at line 61 of file base64.c.
References base64_enc_map, and ERR_BASE64_BUFFER_TOO_SMALL.
const char _base64_src[] = "_base64_src" [static] |
const int base64_dec_map[128] [static] |
Initial value:
{
127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
127, 127, 127, 62, 127, 127, 127, 63, 52, 53,
54, 55, 56, 57, 58, 59, 60, 61, 127, 127,
127, 64, 127, 127, 127, 0, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 127, 127, 127, 127, 127, 127, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
49, 50, 51, 127, 127, 127, 127, 127
}
Definition at line 41 of file base64.c.
Referenced by base64_decode().
const int base64_enc_map[64] [static] |
Initial value:
{
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd',
'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', '+', '/'
}
Definition at line 30 of file base64.c.
Referenced by base64_encode().
1.5.4