Mbed TLS v4.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 
15 
16 #include <stddef.h>
17 
19 #define MBEDTLS_ERR_BASE64_INVALID_CHARACTER -0x002C
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
44 int mbedtls_base64_encode(unsigned char *dst, size_t dlen, size_t *olen,
45  const unsigned char *src, size_t slen);
46 
64 int mbedtls_base64_decode(unsigned char *dst, size_t dlen, size_t *olen,
65  const unsigned char *src, size_t slen);
66 
67 #if defined(MBEDTLS_SELF_TEST)
68 
73 int mbedtls_base64_self_test(int verbose);
74 
75 #endif /* MBEDTLS_SELF_TEST */
76 
77 #ifdef __cplusplus
78 }
79 #endif
80 
81 #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.
int mbedtls_base64_self_test(int verbose)
Checkup routine.
Compatibility definitions for MbedTLS 3.x code built with MbedTLS 4.x or TF-PSA-Crypto 1...
Build-time configuration info.