Mbed TLS v2.28.9
base64.h
Go to the documentation of this file.
1 
6 /*
7  * Copyright The Mbed TLS Contributors
8  * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
9  */
10 #ifndef MBEDTLS_BASE64_H
11 #define MBEDTLS_BASE64_H
12 
13 #if !defined(MBEDTLS_CONFIG_FILE)
14 #include "mbedtls/config.h"
15 #else
16 #include MBEDTLS_CONFIG_FILE
17 #endif
18 
19 #include <stddef.h>
20 
22 #define MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL -0x002A
23 
24 #define MBEDTLS_ERR_BASE64_INVALID_CHARACTER -0x002C
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
49 int mbedtls_base64_encode(unsigned char *dst, size_t dlen, size_t *olen,
50  const unsigned char *src, size_t slen);
51 
69 int mbedtls_base64_decode(unsigned char *dst, size_t dlen, size_t *olen,
70  const unsigned char *src, size_t slen);
71 
72 #if defined(MBEDTLS_SELF_TEST)
73 
78 int mbedtls_base64_self_test(int verbose);
79 
80 #endif /* MBEDTLS_SELF_TEST */
81 
82 #ifdef __cplusplus
83 }
84 #endif
85 
86 #endif /* base64.h */
int mbedtls_base64_encode(unsigned char *dst, size_t dlen, size_t *olen, const unsigned char *src, size_t slen)
Encode a buffer into base64 format.
int mbedtls_base64_decode(unsigned char *dst, size_t dlen, size_t *olen, const unsigned char *src, size_t slen)
Decode a base64-formatted buffer.
Configuration options (set of defines)
int mbedtls_base64_self_test(int verbose)
Checkup routine.