ASCON Suite
|
ASCON-XOF with a specific output length. More...
#include <xof.h>
Public Member Functions | |
xof_with_output_length () | |
Constucts a new ASCON-XOF object. More... | |
xof_with_output_length (const ascon::xof_with_output_length< outlen > &other) | |
Constructs a copy of another ASCON-XOF object. More... | |
xof_with_output_length (const char *function_name, const unsigned char *custom=0, size_t customlen=0) | |
Constructs a new ASCON-XOF object with a named function and customization string. More... | |
xof_with_output_length (const char *function_name, const ascon::byte_array &custom) | |
Constructs a new ASCON-XOF object with a named function and customization string. More... | |
~xof_with_output_length () | |
Destroys this ASCON-XOF object. More... | |
xof_with_output_length< outlen > & | operator= (const ascon::xof_with_output_length< outlen > &other) |
Copies the state of another ASCON-XOF object into this one. More... | |
void | reset () |
Resets this ASCON-XOF object back to the initial state. More... | |
void | absorb (const unsigned char *data, size_t len) |
Absorbs more input data into this ASCON-XOF object. More... | |
void | absorb (const char *str) |
Absorbs the contents of a NUL-terminated C string into this ASCON-XOF object. More... | |
void | absorb (const ascon::byte_array &data) |
Absorbs the contents of a byte array into this ASCON-XOF object. More... | |
void | squeeze (unsigned char *data, size_t len) |
Squeezes output data from this ASCON-XOF object. More... | |
ascon::byte_array | squeeze (size_t len) |
Squeezes data out of this ASCON-XOF object as a byte array. More... | |
void | pad () |
Absorbs enough zeroes into this ASCON-XOF object to pad the input to the next multiple of the block rate. More... | |
inline ::ascon_xof_state_t * | state () |
Gets a reference to the C version of the ASCON-XOF state. More... | |
const ::ascon_xof_state_t * | state () const |
Gets a constant reference to the C version of the ASCON-XOF state. More... | |
void | absorb (const std::string &str) |
Absorbs the contents of a standard C++ string into this ASCON-XOF object. More... | |
ASCON-XOF with a specific output length.
This template takes the desired output length in bytes as a parameter. For example, the following produces a result identical to the ascon::hash class:
The output length should be set to zero for arbitrary-length output. The ascon::xof type provides a convenient alias for this use case:
|
inline |
|
inline |
|
inlineexplicit |
Constructs a new ASCON-XOF object with a named function and customization string.
function_name | Name of the function; e.g. "KMAC". May be NULL or empty for no function name. |
custom | Points to the customization string. |
customlen | Number of bytes in the customization string. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Absorbs enough zeroes into this ASCON-XOF object to pad the input to the next multiple of the block rate.
Does nothing if the state is already aligned on a multiple of the block rate.
This function can avoid unnecessary XOR-with-zero operations to save some time when padding is required.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |