Lightweight Cryptography Primitives
|
PHOTON-Beetle hash algorithm. More...
#include <stddef.h>
Go to the source code of this file.
Data Structures | |
union | photon_beetle_hash_state_t |
State information for the PHOTON-Beetle-HASH incremental mode. More... | |
Macros | |
#define | PHOTON_BEETLE_HASH_SIZE 32 |
Size of the hash output for PHOTON-Beetle-HASH. | |
Functions | |
int | photon_beetle_hash (unsigned char *out, const unsigned char *in, size_t inlen) |
Hashes a block of input data with PHOTON-Beetle-HASH to generate a hash value. More... | |
void | photon_beetle_hash_init (photon_beetle_hash_state_t *state) |
Initializes the state for a Photon-Beetle-HASH hashing operation. More... | |
void | photon_beetle_hash_update (photon_beetle_hash_state_t *state, const unsigned char *in, size_t inlen) |
Updates a Photon-Beetle-HASH state with more input data. More... | |
void | photon_beetle_hash_finalize (photon_beetle_hash_state_t *state, unsigned char *out) |
Returns the final hash value from a Photon-Beetle-HASH hashing operation. More... | |
PHOTON-Beetle hash algorithm.
PHOTON-Beetle-Hash has a 256-bit hash output. The initial data is handled as a 16 byte block, and then the remaining bytes are processed in 4 byte blocks.
References: https://www.isical.ac.in/~lightweight/beetle/
int photon_beetle_hash | ( | unsigned char * | out, |
const unsigned char * | in, | ||
size_t | inlen | ||
) |
Hashes a block of input data with PHOTON-Beetle-HASH to generate a hash value.
out | Buffer to receive the hash output which must be at least PHOTON_BEETLE_HASH_SIZE bytes in length. |
in | Points to the input data to be hashed. |
inlen | Length of the input data in bytes. |
void photon_beetle_hash_finalize | ( | photon_beetle_hash_state_t * | state, |
unsigned char * | out | ||
) |
Returns the final hash value from a Photon-Beetle-HASH hashing operation.
state | Hash state to be finalized. |
out | Buffer to receive the hash output which must be at least PHOTON_BEETLE_HASH_SIZE bytes in length. |
void photon_beetle_hash_init | ( | photon_beetle_hash_state_t * | state | ) |
Initializes the state for a Photon-Beetle-HASH hashing operation.
state | Hash state to be initialized. |
void photon_beetle_hash_update | ( | photon_beetle_hash_state_t * | state, |
const unsigned char * | in, | ||
size_t | inlen | ||
) |
Updates a Photon-Beetle-HASH state with more input data.
state | Hash state to be updated. |
in | Points to the input data to be incorporated into the state. |
inlen | Length of the input data to be incorporated into the state. |