Base64 module header file. More...
#include "string_type.h"
Go to the source code of this file.
Functions | |
E_MCL_ERROR_CODE | base64_decode (const string_t *encoded_data, mcl_uint8_t **decoded_data, mcl_size_t *decoded_data_size) |
E_MCL_ERROR_CODE | base64_url_decode (const string_t *encoded_data, mcl_uint8_t **decoded_data, mcl_size_t *decoded_data_size) |
E_MCL_ERROR_CODE | base64_encode (const mcl_uint8_t *data, mcl_size_t data_size, string_t **encoded_data) |
E_MCL_ERROR_CODE | base64_url_encode (const mcl_uint8_t *data, mcl_size_t data_size, string_t **encoded_data) |
Base64 module header file.
Definition in file base64.h.
E_MCL_ERROR_CODE base64_decode | ( | const string_t * | encoded_data, |
mcl_uint8_t ** | decoded_data, | ||
mcl_size_t * | decoded_data_size | ||
) |
Given a base64 zero-terminated string at encoded_data
, decode it and return a pointer in decoded_data
to a newly allocated memory area holding decoded data. Size of decoded data is returned in variable pointed by decoded_data_size
.
When decoded data length is 0, returns MCL_NULL in decoded_data
.
encoded_data | [in] Zero-terminated string which is base64 encoded and has to be decoded. |
decoded_data | [out] Newly allocated memory holding decoded data. |
decoded_data_size | [out] Size of decoded data. |
encoded_data
has invalid length (0 or not multiples of 4) or if the given encoded_data
is invalidly encoded. Definition at line 82 of file base64.c.
References _decode_with_table(), base64_decode_table, DEBUG_ENTRY, and DEBUG_LEAVE.
Referenced by security_handler_base64_decode().
E_MCL_ERROR_CODE base64_encode | ( | const mcl_uint8_t * | data, |
mcl_size_t | data_size, | ||
string_t ** | encoded_data | ||
) |
Given a pointer to an input data and an input size, encode it with base64 and return a pointer in encoded_data
to a newly allocated string area holding encoded data. Length of encoded data is also returned.
When encoded data length is 0, returns MCL_NULL in encoded_data
.
data | [in] Input data that has to be base64 encoded. |
data_size | [in] Size of given input data . |
encoded_data | [out] Newly allocated string holding encoded data and its length. |
Definition at line 102 of file base64.c.
References _encode_with_table(), base64_encode_table, DEBUG_ENTRY, and DEBUG_LEAVE.
Referenced by security_handler_base64_encode().
E_MCL_ERROR_CODE base64_url_decode | ( | const string_t * | encoded_data, |
mcl_uint8_t ** | decoded_data, | ||
mcl_size_t * | decoded_data_size | ||
) |
Given a base64 URL zero-terminated string at encoded_data
, decode it and return a pointer in decoded_data
to a newly allocated memory area holding decoded data. Size of decoded data is returned in variable pointed by decoded_data_size
.
When decoded data length is 0, returns MCL_NULL in decoded_data
.
encoded_data | [in] Zero-terminated string which is base64 URL encoded and has to be decoded. |
decoded_data | [out] Newly allocated memory holding decoded data. |
decoded_data_size | [out] Size of decoded_data . |
encoded_data
has invalid length (0 or not multiples of 4) or if the given encoded_data
is invalidly encoded. Definition at line 92 of file base64.c.
References _decode_with_table(), base64_url_decode_table, DEBUG_ENTRY, and DEBUG_LEAVE.
E_MCL_ERROR_CODE base64_url_encode | ( | const mcl_uint8_t * | data, |
mcl_size_t | data_size, | ||
string_t ** | encoded_data | ||
) |
Given a pointer to an input data and an input size, encode it with base64 URL and return a pointer in encoded_data
to a newly allocated string area holding encoded data. Length of encoded data is also returned.
When encoded data length is 0, returns MCL_NULL in encoded_data
.
data | [in] Input data that has to be base64 URL encoded. |
data_size | [in] Size of given input data . |
encoded_data | [out] Newly allocated string holding encoded data and its length. |
Definition at line 112 of file base64.c.
References _encode_with_table(), base64_url_encode_table, DEBUG_ENTRY, and DEBUG_LEAVE.
Referenced by _base64_encode_big_number(), and security_handler_base64_url_encode().