35 typedef enum { CIPHER_ID_AES256_GCM = 0, CIPHER_ID_AES256_CTR = 1 } wickr_cipher_id;
66 static const wickr_cipher_t CIPHER_AES256_GCM = { CIPHER_ID_AES256_GCM, 32, 12, 16,
true };
67 static const wickr_cipher_t CIPHER_AES256_CTR = { CIPHER_ID_AES256_CTR, 32, 16, 0,
false };
wickr_cipher_result_t * wickr_cipher_result_from_buffer(const wickr_buffer_t *buffer)
wickr_buffer_t * iv
Definition: cipher.h:99
uint8_t auth_tag_len
Definition: cipher.h:60
wickr_buffer_t * wickr_cipher_result_serialize(const wickr_cipher_result_t *result)
wickr_buffer_t * auth_tag
Definition: cipher.h:101
Represents an array of bytes and the length of the allocation associated with those bytes.
Definition: buffer.h:51
wickr_cipher_result_t * wickr_cipher_result_copy(const wickr_cipher_result_t *result)
Represents a cipher that can be used in the crypto_engine. This meta object holds parameters for the ...
Definition: cipher.h:56
wickr_cipher_t cipher
Definition: cipher.h:190
uint8_t key_len
Definition: cipher.h:58
wickr_cipher_key_t * wickr_cipher_key_create(wickr_cipher_t cipher, wickr_buffer_t *key_data)
bool is_authenticated
Definition: cipher.h:61
wickr_buffer_t * key_data
Definition: cipher.h:191
wickr_cipher_key_t * wickr_cipher_key_copy(const wickr_cipher_key_t *key)
wickr_cipher_id cipher_id
Definition: cipher.h:57
void wickr_cipher_key_destroy(wickr_cipher_key_t **key)
wickr_buffer_t * cipher_text
Definition: cipher.h:100
wickr_cipher_t cipher
Definition: cipher.h:98
wickr_cipher_result_t * wickr_cipher_result_create(wickr_cipher_t cipher, wickr_buffer_t *iv, wickr_buffer_t *cipher_text, wickr_buffer_t *auth_tag)
const wickr_cipher_t * wickr_cipher_find(uint8_t cipher_id)
wickr_buffer_t * wickr_cipher_key_serialize(const wickr_cipher_key_t *key)
bool wickr_cipher_result_is_valid(const wickr_cipher_result_t *result)
uint8_t iv_len
Definition: cipher.h:59
wickr_cipher_key_t * wickr_cipher_key_from_buffer(const wickr_buffer_t *buffer)
void wickr_cipher_result_destroy(wickr_cipher_result_t **result)