23 #ifndef NOISE_DHSTATE_H
24 #define NOISE_DHSTATE_H
69 (
const NoiseDHState *state,
int fingerprint_type,
char *buffer,
size_t len);
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.
int noise_dhstate_clear_key(NoiseDHState *state)
Clears the key in a DHState object.
size_t noise_dhstate_get_public_key_length(const NoiseDHState *state)
Gets the length of the public key for a DHState object.
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.
uint8_t * public_key
Points to the public key in the subclass state.
size_t noise_dhstate_get_shared_key_length(const NoiseDHState *state)
Gets the length of the shared key for a DHState object.
int noise_dhstate_get_dh_id(const NoiseDHState *state)
Gets the algorithm identifier for a DHState object.
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.
int noise_dhstate_get_role(const NoiseDHState *state)
Gets the role that a DHState object will play in a handshake.
int noise_dhstate_new_by_id(NoiseDHState **state, int id)
Creates a new DHState object by its algorithm identifier.
uint16_t shared_key_len
Length of the shared key for this algorithm in bytes.
Internal structure of the NoiseDHState type.
int noise_dhstate_is_ephemeral_only(const NoiseDHState *state)
Determine if a DHState object only supports ephemeral keys.
int noise_dhstate_has_keypair(const NoiseDHState *state)
Determine if a DHState object contains a keypair.
int noise_dhstate_set_null_public_key(NoiseDHState *state)
Sets the public key in a DHState object to the special null value.
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.
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.
int noise_dhstate_free(NoiseDHState *state)
Frees a DHState object after destroying all sensitive material.
int noise_dhstate_generate_keypair(NoiseDHState *state)
Generates a new key pair within a DHState object.
int noise_dhstate_has_public_key(const NoiseDHState *state)
Determine if a DHState object contains a public key.
int noise_dhstate_is_null_public_key(const NoiseDHState *state)
Determine if the public key in a DHState object has the special null value.
int noise_dhstate_new_by_name(NoiseDHState **state, const char *name)
Creates a new DHState object by its algorithm name.
uint16_t private_key_len
Length of the private key for this algorithm in bytes.
int noise_dhstate_copy(NoiseDHState *state, const NoiseDHState *from)
Copies the keys from one DHState object to another.
size_t noise_dhstate_get_private_key_length(const NoiseDHState *state)
Gets the length of the private key for a DHState object.
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.
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.
int noise_dhstate_set_role(NoiseDHState *state, int role)
Sets the role that a DHState object will play in a handshake.
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 DHS...
uint8_t * private_key
Points to the private key in the subclass state.
short role
The role; either initiator or responder or zero.
uint16_t public_key_len
Length of the public key for this algorithm in bytes.