23 #ifndef NOISE_CIPHERSTATE_H
24 #define NOISE_CIPHERSTATE_H
int noise_cipherstate_decrypt(NoiseCipherState *state, NoiseBuffer *buffer)
Decrypts a block of data with this CipherState object.
int noise_cipherstate_init_key(NoiseCipherState *state, const uint8_t *key, size_t key_len)
Initializes the key on a CipherState object.
int noise_cipherstate_get_cipher_id(const NoiseCipherState *state)
Gets the algorithm identifier for a CipherState object.
int noise_cipherstate_set_nonce(NoiseCipherState *state, uint64_t nonce)
Sets the nonce value for this cipherstate object.
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.
int noise_cipherstate_free(NoiseCipherState *state)
Frees a CipherState object after destroying all sensitive material.
int noise_cipherstate_get_max_mac_length(void)
Gets the maximum MAC length for the supported algorithms.
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.
size_t noise_cipherstate_get_mac_length(const NoiseCipherState *state)
Gets the length of packet MAC values for a CipherState object.
uint8_t key_len
Length of the key for this cipher in bytes.
Internal structure of the NoiseCipherState type.
int noise_cipherstate_get_max_key_length(void)
Gets the maximum key length for the supported algorithms.
int noise_cipherstate_new_by_name(NoiseCipherState **state, const char *name)
Creates a new CipherState object by its algorithm name.
int noise_cipherstate_new_by_id(NoiseCipherState **state, int id)
Creates a new CipherState object by its algorithm identifier.
int noise_cipherstate_encrypt(NoiseCipherState *state, NoiseBuffer *buffer)
Encrypts a block of data with this CipherState object.
int noise_cipherstate_has_key(const NoiseCipherState *state)
Determine if the key has been set on a CipherState object.
size_t noise_cipherstate_get_key_length(const NoiseCipherState *state)
Gets the length of the encryption key for a CipherState object.
Type that defines a region of memory for a data buffer.