23 #ifndef NOISE_HANDSHAKESTATE_H
24 #define NOISE_HANDSHAKESTATE_H
Noise protocol name broken out into separate identifier fields.
int noise_handshakestate_has_pre_shared_key(const NoiseHandshakeState *state)
Determine if a HandshakeState object has already been configured with a pre shared key...
int noise_handshakestate_get_role(const NoiseHandshakeState *state)
Gets the role that a HandshakeState object is playing.
int noise_handshakestate_get_protocol_id(const NoiseHandshakeState *state, NoiseProtocolId *id)
Gets the protocol identifier associated with a HandshakeState object.
size_t prologue_len
Length of the prologue value in bytes.
int noise_handshakestate_read_message(NoiseHandshakeState *state, NoiseBuffer *message, NoiseBuffer *payload)
Reads a message payload using a HandshakeState.
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.
int noise_handshakestate_fallback(NoiseHandshakeState *state)
Falls back to the "XXfallback" handshake pattern.
int noise_handshakestate_free(NoiseHandshakeState *state)
Frees a HandshakeState object after destroying all sensitive material.
int noise_handshakestate_new_by_id(NoiseHandshakeState **state, const NoiseProtocolId *protocol_id, int role)
Creates a new HandshakeState object by protocol identifier.
int noise_handshakestate_needs_pre_shared_key(const NoiseHandshakeState *state)
Determine if a HandshakeState object requires a pre shared key.
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.
int noise_handshakestate_write_message(NoiseHandshakeState *state, NoiseBuffer *message, const NoiseBuffer *payload)
Writes a message payload using a HandshakeState.
Internal structure of the NoiseDHState type.
NoiseDHState * noise_handshakestate_get_fixed_ephemeral_dh(NoiseHandshakeState *state)
Gets the DHState object that contains the local ephemeral keypair.
NoiseDHState * noise_handshakestate_get_local_keypair_dh(const NoiseHandshakeState *state)
Gets the DHState object that contains the local static keypair.
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 protoc...
int noise_handshakestate_set_prologue(NoiseHandshakeState *state, const void *prologue, size_t prologue_len)
Sets the prologue for a HandshakeState.
int noise_handshakestate_get_action(const NoiseHandshakeState *state)
Gets the next action the application should perform for the handshake phase of the protocol...
int noise_handshakestate_split(NoiseHandshakeState *state, NoiseCipherState **send, NoiseCipherState **receive)
Splits the transport encryption CipherState objects out of this HandshakeState object.
int role
The role of this object, initiator or responder.
NoiseDHState * noise_handshakestate_get_remote_public_key_dh(const NoiseHandshakeState *state)
Gets the DHState object that contains the remote static public key.
uint8_t * prologue
Points to the prologue value.
SymmetricState interface.
int noise_handshakestate_needs_local_keypair(const NoiseHandshakeState *state)
Determine if a HandshakeState still needs to be configured with a local keypair.
Internal structure of the NoiseCipherState type.
int noise_handshakestate_fallback_to(NoiseHandshakeState *state, int pattern_id)
Falls back to another handshake pattern.
NoiseDHState * noise_handshakestate_get_fixed_hybrid_dh(NoiseHandshakeState *state)
Gets the DHState object that contains the local additional hybrid secrecy keypair.
int noise_handshakestate_has_remote_public_key(const NoiseHandshakeState *state)
Determine if a HandshakeState has a remote public key.
int noise_handshakestate_new_by_name(NoiseHandshakeState **state, const char *protocol_name, int role)
Creates a new HandshakeState object by protocol name.
int noise_handshakestate_start(NoiseHandshakeState *state)
Starts the handshake on a HandshakeState object.
Internal structure of the NoiseHandshakeState type.
Type that defines a region of memory for a data buffer.
int noise_handshakestate_has_local_keypair(const NoiseHandshakeState *state)
Determine if a HandshakeState has been configured with a local keypair.