Lightweight Cryptography Primitives
 All Data Structures Files Functions Variables Typedefs Macros Pages
Typedefs | Functions
ascon-hash.h File Reference

ASCON-HASH and ASCON-HASHA hash algorithms. More...

#include "ascon-xof.h"

Go to the source code of this file.

Typedefs

typedef ascon_xof_state_t ascon_hash_state_t
 State information for ASCON-HASH and ASCON-HASHA incremental modes.
 

Functions

int ascon_hash (unsigned char *out, const unsigned char *in, size_t inlen)
 Hashes a block of input data with ASCON-HASH. More...
 
void ascon_hash_init (ascon_hash_state_t *state)
 Initializes the state for an ASCON-HASH hashing operation. More...
 
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. More...
 
void ascon_hash_finalize (ascon_hash_state_t *state, unsigned char *out)
 Returns the final hash value from an ASCON-HASH hashing operation. More...
 
int ascon_hasha (unsigned char *out, const unsigned char *in, size_t inlen)
 Hashes a block of input data with ASCON-HASHA. More...
 
void ascon_hasha_init (ascon_hash_state_t *state)
 Initializes the state for an ASCON-HASHA hashing operation. More...
 
void ascon_hasha_update (ascon_hash_state_t *state, const unsigned char *in, size_t inlen)
 Updates an ASCON-HASHA state with more input data. More...
 
void ascon_hasha_finalize (ascon_hash_state_t *state, unsigned char *out)
 Returns the final hash value from an ASCON-HASHA hashing operation. More...
 

Detailed Description

ASCON-HASH and ASCON-HASHA hash algorithms.

ASCON-XOF and ASCON-XOFA extensible output functions (XOF's).

References: https://ascon.iaik.tugraz.at/

Function Documentation

int ascon_hash ( unsigned char *  out,
const unsigned char *  in,
size_t  inlen 
)

Hashes a block of input data with ASCON-HASH.

Parameters
outBuffer to receive the hash output which must be at least ASCON_HASH_SIZE bytes in length.
inPoints to the input data to be hashed.
inlenLength of the input data in bytes.
Returns
Returns zero on success or -1 if there was an error in the parameters.
See Also
ascon_hash_init(), ascon_hash_absorb(), ascon_hash_squeeze()
void ascon_hash_finalize ( ascon_hash_state_t state,
unsigned char *  out 
)

Returns the final hash value from an ASCON-HASH hashing operation.

Parameters
stateHash state to be finalized.
outPoints to the output buffer to receive the 32-byte hash value.
See Also
ascon_hash_init(), ascon_hash_update()
void ascon_hash_init ( ascon_hash_state_t state)

Initializes the state for an ASCON-HASH hashing operation.

Parameters
stateHash state to be initialized.
See Also
ascon_hash_update(), ascon_hash_finalize(), ascon_hash()
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.

Parameters
stateHash state to be updated.
inPoints to the input data to be incorporated into the state.
inlenLength of the input data to be incorporated into the state.
See Also
ascon_hash_init(), ascon_hash_finalize()
int ascon_hasha ( unsigned char *  out,
const unsigned char *  in,
size_t  inlen 
)

Hashes a block of input data with ASCON-HASHA.

Parameters
outBuffer to receive the hash output which must be at least ASCON_HASH_SIZE bytes in length.
inPoints to the input data to be hashed.
inlenLength of the input data in bytes.
Returns
Returns zero on success or -1 if there was an error in the parameters.
See Also
ascon_hasha_init(), ascon_hasha_absorb(), ascon_hasha_squeeze()
void ascon_hasha_finalize ( ascon_hash_state_t state,
unsigned char *  out 
)

Returns the final hash value from an ASCON-HASHA hashing operation.

Parameters
stateHash state to be finalized.
outPoints to the output buffer to receive the 32-byte hash value.
See Also
ascon_hasha_init(), ascon_hasha_update()
void ascon_hasha_init ( ascon_hash_state_t state)

Initializes the state for an ASCON-HASHA hashing operation.

Parameters
stateHash state to be initialized.
See Also
ascon_hasha_update(), ascon_hasha_finalize(), ascon_hasha()
void ascon_hasha_update ( ascon_hash_state_t state,
const unsigned char *  in,
size_t  inlen 
)

Updates an ASCON-HASHA state with more input data.

Parameters
stateHash state to be updated.
inPoints to the input data to be incorporated into the state.
inlenLength of the input data to be incorporated into the state.
See Also
ascon_hasha_init(), ascon_hasha_finalize()