PSoC64 Secure Boot Utilities Middleware Library 1.0
Functions

General Description

This library implements Base64 encoding and decoding routines and their associated helper functions.

For more information on Base64 encoding, see RFC4648.

Functions

int cy_p64_base64_encode (unsigned char const *src, int32_t src_length, unsigned char *target, uint32_t target_size, cy_p64_base64_options_t options)
 This function encodes data into Base-64 coding which can be sent safely as text. More...
 
int cy_p64_base64_decode (unsigned char const *src, int32_t src_length, unsigned char *target, uint32_t target_size, cy_p64_base64_options_t options)
 This function decodes data from Base-64 coding which can be sent safely as text. More...
 

Function Documentation

◆ cy_p64_base64_encode()

int cy_p64_base64_encode ( unsigned char const *  src,
int32_t  src_length,
unsigned char *  target,
uint32_t  target_size,
cy_p64_base64_options_t  options 
)

This function encodes data into Base-64 coding which can be sent safely as text.

Terminating null is appended.

Parameters
[in]src: The pointer to the source data to be converted
[in]src_length: The length of data to be converted, or -1 if the data is a null terminated string
[out]target: The buffer that will receive the encoded data. NOTE: src and target can't be pointing to the same buffer.
[in]target_size: The size of the output buffer in bytes. Use CY_P64_GET_B64_ENCODE_LEN(src_length) macro for the calculation of this size.
[in]options: Specifies which Base64 encoding standard to use - see cy_p64_base64_options_t
Returns
number of Base64 characters output (not including terminating null), otherwise negative indicates an error

◆ cy_p64_base64_decode()

int cy_p64_base64_decode ( unsigned char const *  src,
int32_t  src_length,
unsigned char *  target,
uint32_t  target_size,
cy_p64_base64_options_t  options 
)

This function decodes data from Base-64 coding which can be sent safely as text.

Terminating null is appended.

Parameters
[in]src: The pointer to the source Base64 coded data to be decoded
[in]src_length: The length of data to be converted, or -1 if the data is a null terminated string
[out]target: The buffer that will receive the decoded data.
[in]target_size: The size of the output buffer in bytes. Use CY_P64_GET_B64_DECODE_LEN(src_length) macro for the calculation of this size.
[in]options: Specifies which Base64 encoding standard to use - see cy_p64_base64_options_t
Returns
number of decoded characters output (not including terminating null), otherwise negative indicates an error