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

CipherState interface. More...

#include <noise/protocol/buffer.h>

Go to the source code of this file.

Typedefs

typedef struct NoiseCipherState_s NoiseCipherState
 Opaque object that represents a CipherState. More...
 

Functions

int noise_cipherstate_decrypt (NoiseCipherState *state, NoiseBuffer *buffer)
 Decrypts a block of data with this CipherState object. More...
 
int noise_cipherstate_decrypt_with_ad (NoiseCipherState *state, const uint8_t *ad, size_t ad_len, NoiseBuffer *buffer)
 Decrypts a block of data with this CipherState object. More...
 
int noise_cipherstate_encrypt (NoiseCipherState *state, NoiseBuffer *buffer)
 Encrypts a block of data with this CipherState object. More...
 
int noise_cipherstate_encrypt_with_ad (NoiseCipherState *state, const uint8_t *ad, size_t ad_len, NoiseBuffer *buffer)
 Encrypts a block of data with this CipherState object. More...
 
int noise_cipherstate_free (NoiseCipherState *state)
 Frees a CipherState object after destroying all sensitive material. More...
 
int noise_cipherstate_get_cipher_id (const NoiseCipherState *state)
 Gets the algorithm identifier for a CipherState object. More...
 
size_t noise_cipherstate_get_key_length (const NoiseCipherState *state)
 Gets the length of the encryption key for a CipherState object. More...
 
size_t noise_cipherstate_get_mac_length (const NoiseCipherState *state)
 Gets the length of packet MAC values for a CipherState object. More...
 
int noise_cipherstate_get_max_key_length (void)
 Gets the maximum key length for the supported algorithms. More...
 
int noise_cipherstate_get_max_mac_length (void)
 Gets the maximum MAC length for the supported algorithms. More...
 
int noise_cipherstate_has_key (const NoiseCipherState *state)
 Determine if the key has been set on a CipherState object. More...
 
int noise_cipherstate_init_key (NoiseCipherState *state, const uint8_t *key, size_t key_len)
 Initializes the key on a CipherState object. More...
 
int noise_cipherstate_new_by_id (NoiseCipherState **state, int id)
 Creates a new CipherState object by its algorithm identifier. More...
 
int noise_cipherstate_new_by_name (NoiseCipherState **state, const char *name)
 Creates a new CipherState object by its algorithm name. More...
 
int noise_cipherstate_set_nonce (NoiseCipherState *state, uint64_t nonce)
 Sets the nonce value for this cipherstate object. More...
 

Detailed Description

CipherState interface.

Definition in file cipherstate.h.