Internal structure of the NoiseDHState type. More...
#include <internal.h>
Data Fields | |
int(* | calculate )(const NoiseDHState *private_key_state, const NoiseDHState *public_key_state, uint8_t *shared_key) |
Performs a Diffie-Hellman calculation. More... | |
void(* | change_role )(NoiseDHState *state) |
Changes the role for this object. More... | |
int(* | copy )(NoiseDHState *state, const NoiseDHState *from, const NoiseDHState *other) |
Copies another key into this object. More... | |
void(* | destroy )(NoiseDHState *state) |
Destroys this DHState prior to the memory being freed. More... | |
short | dh_id |
Algorithm identifier for the Diffie-Hellman operation. More... | |
uint8_t | ephemeral_only: 1 |
Non-zero if this algorithm only supports ephemeral keys. More... | |
int(* | generate_keypair )(NoiseDHState *state, const NoiseDHState *other) |
Generates a new key pair for this Diffie-Hellman algorithm. More... | |
uint8_t | key_type |
The type of key stored within this DHState object. More... | |
uint8_t | nulls_allowed: 1 |
Non-zero if null public keys are allowed with this algorithm. More... | |
uint8_t * | private_key |
Points to the private key in the subclass state. More... | |
uint16_t | private_key_len |
Length of the private key for this algorithm in bytes. More... | |
uint8_t * | public_key |
Points to the public key in the subclass state. More... | |
uint16_t | public_key_len |
Length of the public key for this algorithm in bytes. More... | |
short | role |
The role; either initiator or responder or zero. More... | |
int(* | set_keypair )(NoiseDHState *state, const uint8_t *private_key, const uint8_t *public_key) |
Sets a keypair. More... | |
int(* | set_keypair_private )(NoiseDHState *state, const uint8_t *private_key) |
Sets a keypair using only the private key. More... | |
uint16_t | shared_key_len |
Length of the shared key for this algorithm in bytes. More... | |
size_t | size |
Total size of the structure including subclass state. More... | |
int(* | validate_public_key )(const NoiseDHState *state, const uint8_t *public_key) |
Validates a public key. More... | |
Internal structure of the NoiseDHState type.
Definition at line 213 of file internal.h.
int(* NoiseDHState_s::calculate)(const NoiseDHState *private_key_state, const NoiseDHState *public_key_state, uint8_t *shared_key) |
Performs a Diffie-Hellman calculation.
private_key_state | Points to the DHState for the private key. |
public_key_state | Points to the DHState for the public key. |
shared_key | Points to the shared key on exit. |
This function must always operate in the same amount of time, even if the private or public key is invalid.
Definition at line 330 of file internal.h.
void(* NoiseDHState_s::change_role)(NoiseDHState *state) |
Changes the role for this object.
state | Points to the DHState. |
This pointer can be NULL if the back end does not need any special logic to change the role.
Definition at line 342 of file internal.h.
int(* NoiseDHState_s::copy)(NoiseDHState *state, const NoiseDHState *from, const NoiseDHState *other) |
Copies another key into this object.
state | Points to the DHState to copy into. |
from | Points to the DHState to copy from. |
other | Points to another DHState for obtaining dependent parameters. May be NULL. |
Definition at line 310 of file internal.h.
void(* NoiseDHState_s::destroy)(NoiseDHState *state) |
Destroys this DHState prior to the memory being freed.
state | Points to the DHState. |
This function is called just before the memory for the DHState is deallocated. It gives the back end an opportunity to clean up linked objects.
This pointer can be NULL if the back end does not need any special clean up logic.
Definition at line 356 of file internal.h.
short NoiseDHState_s::dh_id |
Algorithm identifier for the Diffie-Hellman operation.
Definition at line 219 of file internal.h.
uint8_t NoiseDHState_s::ephemeral_only |
Non-zero if this algorithm only supports ephemeral keys.
Definition at line 228 of file internal.h.
int(* NoiseDHState_s::generate_keypair)(NoiseDHState *state, const NoiseDHState *other) |
Generates a new key pair for this Diffie-Hellman algorithm.
state | Points to the DHState. |
other | Points to the other DHState for obtaining dependent parameters. May be NULL. |
Definition at line 257 of file internal.h.
uint8_t NoiseDHState_s::key_type |
The type of key stored within this DHState object.
Definition at line 225 of file internal.h.
uint8_t NoiseDHState_s::nulls_allowed |
Non-zero if null public keys are allowed with this algorithm.
Definition at line 231 of file internal.h.
uint8_t* NoiseDHState_s::private_key |
Points to the private key in the subclass state.
Definition at line 243 of file internal.h.
uint16_t NoiseDHState_s::private_key_len |
Length of the private key for this algorithm in bytes.
Definition at line 234 of file internal.h.
uint8_t* NoiseDHState_s::public_key |
Points to the public key in the subclass state.
Definition at line 246 of file internal.h.
uint16_t NoiseDHState_s::public_key_len |
Length of the public key for this algorithm in bytes.
Definition at line 237 of file internal.h.
short NoiseDHState_s::role |
The role; either initiator or responder or zero.
Definition at line 222 of file internal.h.
int(* NoiseDHState_s::set_keypair)(NoiseDHState *state, const uint8_t *private_key, const uint8_t *public_key) |
Sets a keypair.
state | Points to the DHState. |
private_key | Points to the private key for the keypair. |
public_key | Points to the public key for the keypair. |
Definition at line 273 of file internal.h.
int(* NoiseDHState_s::set_keypair_private)(NoiseDHState *state, const uint8_t *private_key) |
Sets a keypair using only the private key.
state | Points to the DHState. |
private_key | Points to the private key for the keypair. |
Definition at line 287 of file internal.h.
uint16_t NoiseDHState_s::shared_key_len |
Length of the shared key for this algorithm in bytes.
Definition at line 240 of file internal.h.
size_t NoiseDHState_s::size |
Total size of the structure including subclass state.
Definition at line 216 of file internal.h.
int(* NoiseDHState_s::validate_public_key)(const NoiseDHState *state, const uint8_t *public_key) |
Validates a public key.
state | Points to the DHState. |
public_key | Points to the public key. |
Definition at line 300 of file internal.h.