|
ASCON Suite
|
System utilities of use to applications that use ASCON. More...
#include <stddef.h>#include <vector>#include <string.h>#include <string>Go to the source code of this file.
Namespaces | |
| ascon | |
Typedefs | |
| typedef std::vector< unsigned char > | ascon::byte_array |
| C++ type for an array of bytes. More... | |
Functions | |
| void | ascon_clean (void *buf, unsigned size) |
| Cleans a buffer that contains sensitive material. More... | |
| 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... | |
System utilities of use to applications that use ASCON.
Definition in file utility.h.
| 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.
| void ascon_clean | ( | void * | buf, |
| unsigned | size | ||
| ) |
Cleans a buffer that contains sensitive material.
| buf | Points to the buffer to clear. |
| size | Size of the buffer to clear in bytes. |
Definition at line 38 of file ascon-clean.c.