Internal structure of the NoiseCipherState type. More...
#include <internal.h>
Data Fields | |
int | cipher_id |
Algorithm identifier for the cipher. More... | |
NoiseCipherState *(* | create )(void) |
Creates a new CipherState of the same type as this one. More... | |
int(* | decrypt )(NoiseCipherState *state, const uint8_t *ad, size_t ad_len, uint8_t *data, size_t len) |
Decrypts data with this CipherState. More... | |
void(* | destroy )(NoiseCipherState *state) |
Destroys this CipherState prior to the memory being freed. More... | |
int(* | encrypt )(NoiseCipherState *state, const uint8_t *ad, size_t ad_len, uint8_t *data, size_t len) |
Encrypts data with this CipherState. More... | |
uint8_t | has_key |
Non-zero if the key has been set on this cipher. More... | |
void(* | init_key )(NoiseCipherState *state, const uint8_t *key) |
Sets the key for this CipherState. More... | |
uint8_t | key_len |
Length of the key for this cipher in bytes. More... | |
uint8_t | mac_len |
Length of the MAC for this cipher in bytes. More... | |
uint64_t | n |
The nonce value for the next packet. More... | |
size_t | size |
Total size of the structure including subclass state. More... | |
Internal structure of the NoiseCipherState type.
Definition at line 58 of file internal.h.
int NoiseCipherState_s::cipher_id |
Algorithm identifier for the cipher.
Definition at line 64 of file internal.h.
NoiseCipherState*(* NoiseCipherState_s::create)(void) |
Creates a new CipherState of the same type as this one.
Definition at line 84 of file internal.h.
int(* NoiseCipherState_s::decrypt)(NoiseCipherState *state, const uint8_t *ad, size_t ad_len, uint8_t *data, size_t len) |
Decrypts data with this CipherState.
state | Points to the CipherState. |
ad | Points to the associated data to include in the MAC computation. |
ad_len | The length of the associated data; may be zero. |
data | Points to the ciphertext plus MAC on entry, and to the plaintext on exit. |
len | The length of the ciphertext, excluding the MAC. |
Definition at line 130 of file internal.h.
void(* NoiseCipherState_s::destroy)(NoiseCipherState *state) |
Destroys this CipherState prior to the memory being freed.
state | Points to the CipherState. |
This function is called just before the memory for the CipherState 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 145 of file internal.h.
int(* NoiseCipherState_s::encrypt)(NoiseCipherState *state, const uint8_t *ad, size_t ad_len, uint8_t *data, size_t len) |
Encrypts data with this CipherState.
state | Points to the CipherState. |
ad | Points to the associated data to include in the MAC computation. |
ad_len | The length of the associated data; may be zero. |
data | Points to the plaintext on entry, and to the ciphertext plus MAC on exit. |
len | The length of the plaintext. |
The data buffer must have enough room to append mac_len extra bytes for the MAC value.
Definition at line 113 of file internal.h.
uint8_t NoiseCipherState_s::has_key |
Non-zero if the key has been set on this cipher.
Definition at line 67 of file internal.h.
void(* NoiseCipherState_s::init_key)(NoiseCipherState *state, const uint8_t *key) |
Sets the key for this CipherState.
state | Points to the CipherState. |
key | Points to the key, which must be key_len bytes in size. |
If the key has already been set before, then calling this function again will set a new key.
Definition at line 95 of file internal.h.
uint8_t NoiseCipherState_s::key_len |
Length of the key for this cipher in bytes.
Definition at line 70 of file internal.h.
uint8_t NoiseCipherState_s::mac_len |
Length of the MAC for this cipher in bytes.
Definition at line 73 of file internal.h.
uint64_t NoiseCipherState_s::n |
The nonce value for the next packet.
Definition at line 76 of file internal.h.
size_t NoiseCipherState_s::size |
Total size of the structure including subclass state.
Definition at line 61 of file internal.h.