|
ASCON Suite
|
#include <ascon/utility.h>Go to the source code of this file.
Functions | |
| int | ascon_bytes_to_hex (char *out, size_t outlen, const unsigned char *in, size_t inlen, int upper_case) |
| Converts an array of bytes into a hexadecimal string. More... | |
| int | ascon_bytes_from_hex (unsigned char *out, size_t outlen, const char *in, size_t inlen) |
| Converts a hexadecimal string into an array of bytes. More... | |
| int ascon_bytes_from_hex | ( | unsigned char * | out, |
| size_t | outlen, | ||
| const char * | in, | ||
| size_t | inlen | ||
| ) |
Converts a hexadecimal string into an array of bytes.
| out | Points to the buffer to receive the output bytes. |
| outlen | Maximum number of bytes in the output buffer. |
| in | Points to the input hexadecimal string to convert. |
| inlen | Number of characters in the input string to convert. |
Both uppercase and lowercase hexadecimal characters are recognized. Whitespace characters are ignored. All other characters are invalid.
Definition at line 48 of file ascon-hex.c.
| int ascon_bytes_to_hex | ( | char * | out, |
| size_t | outlen, | ||
| const unsigned char * | in, | ||
| size_t | inlen, | ||
| int | upper_case | ||
| ) |
Converts an array of bytes into a hexadecimal string.
| out | Points to the buffer to receive the output string. |
| outlen | Maximum number of characters in the out buffer, which should be at least inlen * 2 + 1 in length. |
| in | Points to the input byte array to convert into hexadecimal. |
| inlen | Number of bytes to be converted. |
| upper_case | Use uppercase hexadecimal letters if non-zero; or use lowercase hexadecimal letters if zero. |
The result out buffer will be NUL-terminated except when the function returns -1.
Definition at line 25 of file ascon-hex.c.