Noise-C
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
Functions
hashstate.c File Reference

HashState implementation. More...

#include "internal.h"
#include <string.h>

Go to the source code of this file.

Functions

int noise_hashstate_finalize (NoiseHashState *state, uint8_t *hash, size_t hash_len)
 Finalizes the hash state and returns the hash value. More...
 
int noise_hashstate_free (NoiseHashState *state)
 Frees a HashState object after destroying all sensitive material. More...
 
size_t noise_hashstate_get_block_length (const NoiseHashState *state)
 Gets the length of the block for a HashState object. More...
 
int noise_hashstate_get_hash_id (const NoiseHashState *state)
 Gets the algorithm identifier for a HashState object. More...
 
size_t noise_hashstate_get_hash_length (const NoiseHashState *state)
 Gets the length of the hash output for a HashState object. More...
 
int noise_hashstate_get_max_block_length (void)
 Gets the maximum block length for the supported algorithms. More...
 
int noise_hashstate_get_max_hash_length (void)
 Gets the maximum hash length for the supported algorithms. More...
 
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. More...
 
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. More...
 
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. More...
 
int noise_hashstate_new_by_id (NoiseHashState **state, int id)
 Creates a new HashState object by its algorithm identifier. More...
 
int noise_hashstate_new_by_name (NoiseHashState **state, const char *name)
 Creates a new HashState object by its algorithm name. More...
 
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. More...
 
int noise_hashstate_reset (NoiseHashState *state)
 Resets the hash state. More...
 
int noise_hashstate_update (NoiseHashState *state, const uint8_t *data, size_t data_len)
 Updates the hash state with more data. More...
 

Detailed Description

HashState implementation.

Definition in file hashstate.c.