Noise-C
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
Typedefs | Functions
handshakestate.h File Reference

HandshakeState interface. More...

#include <noise/protocol/symmetricstate.h>
#include <noise/protocol/dhstate.h>

Go to the source code of this file.

Typedefs

typedef struct
NoiseHandshakeState_s 
NoiseHandshakeState
 Opaque object that represents a HandshakeState. More...
 

Functions

int noise_handshakestate_fallback (NoiseHandshakeState *state)
 Falls back to the "XXfallback" handshake pattern. More...
 
int noise_handshakestate_fallback_to (NoiseHandshakeState *state, int pattern_id)
 Falls back to another handshake pattern. More...
 
int noise_handshakestate_free (NoiseHandshakeState *state)
 Frees a HandshakeState object after destroying all sensitive material. More...
 
int noise_handshakestate_get_action (const NoiseHandshakeState *state)
 Gets the next action the application should perform for the handshake phase of the protocol. More...
 
NoiseDHStatenoise_handshakestate_get_fixed_ephemeral_dh (NoiseHandshakeState *state)
 Gets the DHState object that contains the local ephemeral keypair. More...
 
NoiseDHStatenoise_handshakestate_get_fixed_hybrid_dh (NoiseHandshakeState *state)
 Gets the DHState object that contains the local additional hybrid secrecy keypair. More...
 
int noise_handshakestate_get_handshake_hash (const NoiseHandshakeState *state, uint8_t *hash, size_t max_len)
 Gets the handshake hash value once the handshake ends. More...
 
NoiseDHStatenoise_handshakestate_get_local_keypair_dh (const NoiseHandshakeState *state)
 Gets the DHState object that contains the local static keypair. More...
 
int noise_handshakestate_get_protocol_id (const NoiseHandshakeState *state, NoiseProtocolId *id)
 Gets the protocol identifier associated with a HandshakeState object. More...
 
NoiseDHStatenoise_handshakestate_get_remote_public_key_dh (const NoiseHandshakeState *state)
 Gets the DHState object that contains the remote static public key. More...
 
int noise_handshakestate_get_role (const NoiseHandshakeState *state)
 Gets the role that a HandshakeState object is playing. More...
 
int noise_handshakestate_has_local_keypair (const NoiseHandshakeState *state)
 Determine if a HandshakeState has been configured with a local keypair. More...
 
int noise_handshakestate_has_pre_shared_key (const NoiseHandshakeState *state)
 Determine if a HandshakeState object has already been configured with a pre shared key. More...
 
int noise_handshakestate_has_remote_public_key (const NoiseHandshakeState *state)
 Determine if a HandshakeState has a remote public key. More...
 
int noise_handshakestate_needs_local_keypair (const NoiseHandshakeState *state)
 Determine if a HandshakeState still needs to be configured with a local keypair. More...
 
int noise_handshakestate_needs_pre_shared_key (const NoiseHandshakeState *state)
 Determine if a HandshakeState object requires a pre shared key. More...
 
int noise_handshakestate_needs_remote_public_key (const NoiseHandshakeState *state)
 Determine if a HandshakeState still needs to be configured with a remote public key before the protocol can start. More...
 
int noise_handshakestate_new_by_id (NoiseHandshakeState **state, const NoiseProtocolId *protocol_id, int role)
 Creates a new HandshakeState object by protocol identifier. More...
 
int noise_handshakestate_new_by_name (NoiseHandshakeState **state, const char *protocol_name, int role)
 Creates a new HandshakeState object by protocol name. More...
 
int noise_handshakestate_read_message (NoiseHandshakeState *state, NoiseBuffer *message, NoiseBuffer *payload)
 Reads a message payload using a HandshakeState. More...
 
int noise_handshakestate_set_pre_shared_key (NoiseHandshakeState *state, const uint8_t *key, size_t key_len)
 Sets the pre shared key for a HandshakeState. More...
 
int noise_handshakestate_set_prologue (NoiseHandshakeState *state, const void *prologue, size_t prologue_len)
 Sets the prologue for a HandshakeState. More...
 
int noise_handshakestate_split (NoiseHandshakeState *state, NoiseCipherState **send, NoiseCipherState **receive)
 Splits the transport encryption CipherState objects out of this HandshakeState object. More...
 
int noise_handshakestate_start (NoiseHandshakeState *state)
 Starts the handshake on a HandshakeState object. More...
 
int noise_handshakestate_write_message (NoiseHandshakeState *state, NoiseBuffer *message, const NoiseBuffer *payload)
 Writes a message payload using a HandshakeState. More...
 

Detailed Description

HandshakeState interface.

Definition in file handshakestate.h.