base64.h File Reference

Base64 module header file. More...

Include dependency graph for base64.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

MCL_LOCAL mcl_error_t base64_decode (const char *encoded_data, mcl_uint8_t **decoded_data, mcl_size_t *decoded_data_size)
 
MCL_LOCAL mcl_error_t base64_url_decode (const char *encoded_data, mcl_uint8_t **decoded_data, mcl_size_t *decoded_data_size)
 
MCL_LOCAL mcl_error_t base64_encode (const mcl_uint8_t *data, mcl_size_t data_size, char **encoded_data)
 
MCL_LOCAL mcl_error_t base64_url_encode (const mcl_uint8_t *data, mcl_size_t data_size, char **encoded_data)
 

Detailed Description

Base64 module header file.

This module defines methods for base64 and base64url encoding/decoding.

Definition in file base64.h.

Function Documentation

MCL_LOCAL mcl_error_t base64_decode ( const char *  encoded_data,
mcl_uint8_t **  decoded_data,
mcl_size_t decoded_data_size 
)

This function is used for decoding a base64 encoded, zero-terminated string in encoded_data and return decoded data in decoded_data with size decoded_data_size.

When decoded data length is 0, returns MCL_NULL in decoded_data.

Parameters
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.
Returns

Definition at line 93 of file base64.c.

References _decode_with_table(), base64_decode_table, MCL_DEBUG_ENTRY, and MCL_DEBUG_LEAVE.

Referenced by security_handler_base64_decode().

Here is the call graph for this function:

Here is the caller graph for this function:

MCL_LOCAL mcl_error_t base64_encode ( const mcl_uint8_t data,
mcl_size_t  data_size,
char **  encoded_data 
)

This function is used for base64 encoding of data in data and return encoded data in encoded_data.

When encoded data length is 0, returns MCL_NULL in encoded_data.

Parameters
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.
Returns

Definition at line 119 of file base64.c.

References _encode_with_table(), base64_encode_table, MCL_DEBUG_ENTRY, and MCL_DEBUG_LEAVE.

Referenced by security_handler_base64_encode().

Here is the call graph for this function:

Here is the caller graph for this function:

MCL_LOCAL mcl_error_t base64_url_decode ( const char *  encoded_data,
mcl_uint8_t **  decoded_data,
mcl_size_t decoded_data_size 
)

This function is used for decoding a base64 URL encoded, zero-terminated string in encoded_data and return decoded data in decoded_data with size decoded_data_size.

When decoded data length is 0, returns MCL_NULL in decoded_data.

Parameters
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.
Returns

Definition at line 106 of file base64.c.

References _decode_with_table(), base64_url_decode_table, MCL_DEBUG_ENTRY, and MCL_DEBUG_LEAVE.

Here is the call graph for this function:

MCL_LOCAL mcl_error_t base64_url_encode ( const mcl_uint8_t data,
mcl_size_t  data_size,
char **  encoded_data 
)

This function is used for base64 URL encoding of data in data and return encoded data in encoded_data.

When encoded data length is 0, returns MCL_NULL in encoded_data.

Parameters
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.
Returns

Definition at line 131 of file base64.c.

References _encode_with_table(), base64_url_encode_table, MCL_DEBUG_ENTRY, and MCL_DEBUG_LEAVE.

Referenced by _base64_encode_big_number(), and security_handler_base64_url_encode().

Here is the call graph for this function:

Here is the caller graph for this function: