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

Romulus-H hash algorithm. More...

#include <stddef.h>

Go to the source code of this file.

Data Structures

union  romulus_hash_state_t
 State information for Romulus-H incremental modes. More...
 

Macros

#define ROMULUS_HASH_SIZE   32
 Size of the fixed-length hash value for Romulus-H.
 
#define ROMULUS_HASH_RATE   32
 Number of bytes in a rate block for Romulus-H.
 

Functions

int romulus_hash (unsigned char *out, const unsigned char *in, size_t inlen)
 Hashes a block of input data with Romulus-H. More...
 
void romulus_hash_init (romulus_hash_state_t *state)
 Initializes the state for a Romulus-H hashing operation. More...
 
void romulus_hash_update (romulus_hash_state_t *state, const unsigned char *in, size_t inlen)
 Updates a Romulus-H hash state with more input data. More...
 
void romulus_hash_finalize (romulus_hash_state_t *state, unsigned char *out)
 Returns the final hash value from a Romulus-H hashing operation. More...
 

Detailed Description

Romulus-H hash algorithm.

Romulus-H is a hash algorithm based on the block cipher SKINNY-128-384+, using the MDPH construction. The algorithm produces a 256-bit fixed length output.

References: https://romulusae.github.io/romulus/

Function Documentation

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

Hashes a block of input data with Romulus-H.

Parameters
outBuffer to receive the hash output which must be at least ROMULUS_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
romulus_hash_init(), romulus_hash_absorb(), romulus_hash_squeeze()
void romulus_hash_finalize ( romulus_hash_state_t state,
unsigned char *  out 
)

Returns the final hash value from a Romulus-H hashing operation.

Parameters
stateHash state to be finalized.
outBuffer to receive the hash output which must be at least ROMULUS_HASH_SIZE bytes in length.
See Also
romulus_hash_init(), romulus_hash_update()
void romulus_hash_init ( romulus_hash_state_t state)

Initializes the state for a Romulus-H hashing operation.

Parameters
stateHash state to be initialized.
See Also
romulus_hash_update(), romulus_hash_finalize(), romulus_hash()
void romulus_hash_update ( romulus_hash_state_t state,
const unsigned char *  in,
size_t  inlen 
)

Updates a Romulus-H hash state with more input data.

Parameters
stateHash state to be updated.
inPoints to the input data to be absorbed into the state.
inlenLength of the input data to be absorbed into the state.
See Also
romulus_hash_init(), romulus_hash_finalize()