1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef __INCLUDE_B64_DECODE_H__
4 #define __INCLUDE_B64_DECODE_H__
10 * A function to convert a buffer of base64 format data into its source.
12 * The user provides output buffer of the size guaranteed to fit the result.
14 * Returns the size of the decoded data or zero if invalid characters were
15 * encountered in the input buffer.
17 size_t b64_decode(const uint8_t *input_data
,
19 uint8_t *output_data
);
21 /* A macro to derive decoded size of a base64 encoded blob. */
22 #define B64_DECODED_SIZE(encoded_size) (((encoded_size) * 3)/4)