67 void ascon_hash(
unsigned char *out,
const unsigned char *in,
size_t inlen);
142 void ascon_hasha(
unsigned char *out,
const unsigned char *in,
size_t inlen);
254 if (
this != &other) {
293 (&m_state,
reinterpret_cast<const unsigned char *
>(str),
340 const unsigned char *
data,
size_t len)
350 inline ::ascon_hash_state_t *
state() {
return &m_state; }
358 inline const ::ascon_hash_state_t *
state()
const {
return &m_state; }
360 #if !defined(ARDUINO) && !defined(ASCON_NO_STL)
368 inline void update(
const std::string& str)
371 (&m_state,
reinterpret_cast<const unsigned char *
>(str.data()),
375 #elif defined(ARDUINO)
383 inline void update(
const String& str)
386 (&m_state,
reinterpret_cast<const unsigned char *
>(str.c_str()),
437 if (
this != &other) {
476 (&m_state,
reinterpret_cast<const unsigned char *
>(str),
523 const unsigned char *
data,
size_t len)
533 inline ::ascon_hasha_state_t *
state() {
return &m_state; }
541 inline const ::ascon_hasha_state_t *
state()
const {
return &m_state; }
543 #if !defined(ARDUINO) && !defined(ASCON_NO_STL)
551 inline void update(
const std::string& str)
554 (&m_state,
reinterpret_cast<const unsigned char *
>(str.data()),
558 #elif defined(ARDUINO)
566 inline void update(
const String& str)
569 (&m_state,
reinterpret_cast<const unsigned char *
>(str.c_str()),
ASCON-HASH digest algorithm.
ascon::byte_array finalize()
Finalizes this ASCON-HASH object and returns the digest as a byte array.
void update(const std::string &str)
Updates this ASCON-HASH object with the contents of a standard C++ string.
hash()
Constructs a new ASCON-HASH object.
void finalize(unsigned char digest[ASCON_HASH_SIZE])
Finalizes this ASCON-HASH object and returns the digest.
void update(const unsigned char *data, size_t len)
Updates this ASCON-HASH object with new input data.
inline ::ascon_hash_state_t * state()
Gets a reference to the C version of the ASCON-HASH state.
void update(const char *str)
Updates this ASCON-HASH object with the contents of a NUL-terminated C string.
~hash()
Destroys this ASCON-HASH object.
hash & operator=(const ascon::hash &other)
Copies the state of another ASCON-HASH object into this one.
static void digest(unsigned char result[ASCON_HASH_SIZE], const unsigned char *data, size_t len)
Computes the ASCON-HASH digest of a block of input data.
const ::ascon_hash_state_t * state() const
Gets a constant reference to the C version of the ASCON-HASH state.
void reset()
Resets this ASCON-HASH object back to its initial state.
hash(const ascon::hash &other)
Constructs a copy of another ASCON-HASH object.
void update(const ascon::byte_array &data)
Updates this ASCON-HASH object with the contents of a byte array.
ASCON-HASHA digest algorithm.
hasha()
Constructs a new ASCON-HASHA object.
void update(const char *str)
Updates this ASCON-HASHA object with the contents of a NUL-terminated C string.
ascon::byte_array finalize()
Finalizes this ASCON-HASHA object and returns the digest as a byte array.
void reset()
Resets this ASCON-HASHA object back to its initial state.
void update(const std::string &str)
Updates this ASCON-HASHA object with the contents of a standard C++ string.
void update(const unsigned char *data, size_t len)
Updates this ASCON-HASHA object with new input data.
inline ::ascon_hasha_state_t * state()
Gets a reference to the C version of the ASCON-HASHA state.
hasha(const ascon::hasha &other)
Constructs a copy of another ASCON-HASHA object.
~hasha()
Destroys this ASCON-HASHA object.
void update(const ascon::byte_array &data)
Updates this ASCON-HASHA object with the contents of a byte array.
const ::ascon_hasha_state_t * state() const
Gets a constant reference to the C version of the ASCON-HASHA state.
hasha & operator=(const ascon::hasha &other)
Copies the state of another ASCON-HASHA object into this one.
static void digest(unsigned char result[ASCON_HASH_SIZE], const unsigned char *data, size_t len)
Computes the ASCON-HASHA digest of a block of input data.
void finalize(unsigned char digest[ASCON_HASHA_SIZE])
Finalizes this ASCON-HASHA object and returns the digest.
void ascon_hash_init(ascon_hash_state_t *state)
Initializes the state for an ASCON-HASH hashing operation.
void ascon_hasha_finalize(ascon_hasha_state_t *state, unsigned char *out)
Returns the final hash value from an ASCON-HASHA hashing operation.
void ascon_hasha_reinit(ascon_hasha_state_t *state)
Re-initializes the state for an ASCON-HASHA hashing operation.
void ascon_hash_update(ascon_hash_state_t *state, const unsigned char *in, size_t inlen)
Updates an ASCON-HASH state with more input data.
void ascon_hash_finalize(ascon_hash_state_t *state, unsigned char *out)
Returns the final hash value from an ASCON-HASH hashing operation.
void ascon_hasha(unsigned char *out, const unsigned char *in, size_t inlen)
Hashes a block of input data with ASCON-HASHA.
void ascon_hasha_init(ascon_hasha_state_t *state)
Initializes the state for an ASCON-HASHA hashing operation.
void ascon_hasha_free(ascon_hasha_state_t *state)
Frees the ASCON-HASHA state and destroys any sensitive material.
void ascon_hasha_update(ascon_hasha_state_t *state, const unsigned char *in, size_t inlen)
Updates an ASCON-HASHA state with more input data.
void ascon_hash(unsigned char *out, const unsigned char *in, size_t inlen)
Hashes a block of input data with ASCON-HASH.
void ascon_hasha_copy(ascon_hasha_state_t *dest, const ascon_hasha_state_t *src)
Clones a copy of an ASCON-HASHA state.
void ascon_hash_free(ascon_hash_state_t *state)
Frees the ASCON-HASH state and destroys any sensitive material.
void ascon_hash_copy(ascon_hash_state_t *dest, const ascon_hash_state_t *src)
Clones a copy of an ASCON-HASH state.
void ascon_hash_reinit(ascon_hash_state_t *state)
Re-initializes the state for an ASCON-HASH hashing operation.
std::vector< unsigned char > byte_array
C++ type for an array of bytes.
ascon_state_t state
[snippet_key]
unsigned char data[8]
[snippet_key]
State information for the ASCON-HASH incremental mode.
State information for the ASCON-HASHA incremental mode.
State information for ASCON-XOF incremental mode.
State information for ASCON-XOFA incremental mode.
ASCON-XOF and ASCON-XOFA extensible output functions (XOF's).
#define ASCON_HASH_SIZE
Size of the hash output for ASCON-HASH and the default hash output size for ASCON-XOF.
#define ASCON_HASHA_SIZE
Size of the hash output for ASCON-HASHA and the default hash output size for ASCON-XOFA.