23 #ifndef NOISE_HASHSTATE_H
24 #define NOISE_HASHSTATE_H
51 const uint8_t *data2,
size_t data2_len, uint8_t *hash,
size_t hash_len);
54 const uint8_t *data,
size_t data_len,
55 uint8_t *output1,
size_t output1_len,
56 uint8_t *output2,
size_t output2_len);
58 (
NoiseHashState *state,
const uint8_t *passphrase,
size_t passphrase_len,
59 const uint8_t *salt,
size_t salt_len,
size_t iterations,
60 uint8_t *output,
size_t output_len);
uint16_t hash_len
Length of the output from this hash algorithm.
int noise_hashstate_pbkdf2(NoiseHashState *state, const uint8_t *passphrase, size_t passphrase_len, const uint8_t *salt, size_t salt_len, size_t iterations, uint8_t *output, size_t output_len)
Hashes a passphrase and salt using the PBKDF2 key derivation function.
Internal structure of the NoiseHashState type.
int noise_hashstate_get_max_hash_length(void)
Gets the maximum hash length for the supported algorithms.
int noise_hashstate_reset(NoiseHashState *state)
Resets the hash state.
int noise_hashstate_new_by_id(NoiseHashState **state, int id)
Creates a new HashState object by its algorithm identifier.
int noise_hashstate_new_by_name(NoiseHashState **state, const char *name)
Creates a new HashState object by its algorithm name.
int noise_hashstate_hash_one(NoiseHashState *state, const uint8_t *data, size_t data_len, uint8_t *hash, size_t hash_len)
Hashes a single data buffer and returns the hash value.
size_t noise_hashstate_get_block_length(const NoiseHashState *state)
Gets the length of the block for a HashState object.
int noise_hashstate_get_max_block_length(void)
Gets the maximum block length for the supported algorithms.
int noise_hashstate_hkdf(NoiseHashState *state, const uint8_t *key, size_t key_len, const uint8_t *data, size_t data_len, uint8_t *output1, size_t output1_len, uint8_t *output2, size_t output2_len)
Hashes input data with a key to generate two output values.
int noise_hashstate_finalize(NoiseHashState *state, uint8_t *hash, size_t hash_len)
Finalizes the hash state and returns the hash value.
int noise_hashstate_get_hash_id(const NoiseHashState *state)
Gets the algorithm identifier for a HashState object.
int noise_hashstate_free(NoiseHashState *state)
Frees a HashState object after destroying all sensitive material.
int noise_hashstate_update(NoiseHashState *state, const uint8_t *data, size_t data_len)
Updates the hash state with more data.
size_t noise_hashstate_get_hash_length(const NoiseHashState *state)
Gets the length of the hash output for a HashState object.
int noise_hashstate_hash_two(NoiseHashState *state, const uint8_t *data1, size_t data1_len, const uint8_t *data2, size_t data2_len, uint8_t *hash, size_t hash_len)
Hashes the concatenation of two data buffers and returns the combined hash value. ...