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

DHState implementation. More...

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

Go to the source code of this file.

Functions

int noise_dhstate_calculate (const NoiseDHState *private_key_state, const NoiseDHState *public_key_state, uint8_t *shared_key, size_t shared_key_len)
 Performs a Diffie-Hellman calculation. More...
 
int noise_dhstate_clear_key (NoiseDHState *state)
 Clears the key in a DHState object. More...
 
int noise_dhstate_copy (NoiseDHState *state, const NoiseDHState *from)
 Copies the keys from one DHState object to another. More...
 
int noise_dhstate_format_fingerprint (const NoiseDHState *state, int fingerprint_type, char *buffer, size_t len)
 Formats the public key fingerprint for the key within a DHState. More...
 
int noise_dhstate_free (NoiseDHState *state)
 Frees a DHState object after destroying all sensitive material. More...
 
int noise_dhstate_generate_dependent_keypair (NoiseDHState *state, const NoiseDHState *other)
 Generates a new key pair within a DHState object that may depend upon the parameters from another DHState object. More...
 
int noise_dhstate_generate_keypair (NoiseDHState *state)
 Generates a new key pair within a DHState object. More...
 
int noise_dhstate_get_dh_id (const NoiseDHState *state)
 Gets the algorithm identifier for a DHState object. More...
 
int noise_dhstate_get_keypair (const NoiseDHState *state, uint8_t *private_key, size_t private_key_len, uint8_t *public_key, size_t public_key_len)
 Gets the keypair from within a DHState object. More...
 
size_t noise_dhstate_get_private_key_length (const NoiseDHState *state)
 Gets the length of the private key for a DHState object. More...
 
int noise_dhstate_get_public_key (const NoiseDHState *state, uint8_t *public_key, size_t public_key_len)
 Gets the public key value from a DHState object. More...
 
size_t noise_dhstate_get_public_key_length (const NoiseDHState *state)
 Gets the length of the public key for a DHState object. More...
 
int noise_dhstate_get_role (const NoiseDHState *state)
 Gets the role that a DHState object will play in a handshake. More...
 
size_t noise_dhstate_get_shared_key_length (const NoiseDHState *state)
 Gets the length of the shared key for a DHState object. More...
 
int noise_dhstate_has_keypair (const NoiseDHState *state)
 Determine if a DHState object contains a keypair. More...
 
int noise_dhstate_has_public_key (const NoiseDHState *state)
 Determine if a DHState object contains a public key. More...
 
int noise_dhstate_is_ephemeral_only (const NoiseDHState *state)
 Determine if a DHState object only supports ephemeral keys. More...
 
int noise_dhstate_is_null_public_key (const NoiseDHState *state)
 Determine if the public key in a DHState object has the special null value. More...
 
int noise_dhstate_new_by_id (NoiseDHState **state, int id)
 Creates a new DHState object by its algorithm identifier. More...
 
int noise_dhstate_new_by_name (NoiseDHState **state, const char *name)
 Creates a new DHState object by its algorithm name. More...
 
int noise_dhstate_set_keypair (NoiseDHState *state, const uint8_t *private_key, size_t private_key_len, const uint8_t *public_key, size_t public_key_len)
 Sets the keypair within a DHState object. More...
 
int noise_dhstate_set_keypair_private (NoiseDHState *state, const uint8_t *private_key, size_t private_key_len)
 Sets the keypair within a DHState object based on a private key only. More...
 
int noise_dhstate_set_null_public_key (NoiseDHState *state)
 Sets the public key in a DHState object to the special null value. More...
 
int noise_dhstate_set_public_key (NoiseDHState *state, const uint8_t *public_key, size_t public_key_len)
 Sets the public key in a DHState object. More...
 
int noise_dhstate_set_role (NoiseDHState *state, int role)
 Sets the role that a DHState object will play in a handshake. More...
 

Detailed Description

DHState implementation.

Definition in file dhstate.c.