wickr-crypto-c
|
Data Structures | |
struct | wickr_cipher |
Represents a cipher that can be used in the crypto_engine. This meta object holds parameters for the cipher algorithms and maintains an identifier that can be used to look up the desired parameters for an algorithm. More... | |
struct | wickr_cipher_result |
struct | wickr_cipher_key |
const wickr_cipher_t* wickr_cipher_find | ( | uint8_t | cipher_id | ) |
Find a supported cipher by identifier. When cipher results are serialized they contain the identifier of the cipher that was used to create them as the first byte
cipher_id | the identifier of the cipher |
wickr_cipher_key_t* wickr_cipher_key_copy | ( | const wickr_cipher_key_t * | key | ) |
Copy a cipher key
key | the key to copy |
wickr_cipher_key_t* wickr_cipher_key_create | ( | wickr_cipher_t | cipher, |
wickr_buffer_t * | key_data | ||
) |
Create a key from components
cipher | the cipher this key is to be used by |
key_data | a buffer representing the raw bytes of the key |
void wickr_cipher_key_destroy | ( | wickr_cipher_key_t ** | key | ) |
Destroy a cipher key
key | a pointer to the key to destroy. All properties of '*key' will also be destroyed |
wickr_cipher_key_t* wickr_cipher_key_from_buffer | ( | const wickr_buffer_t * | buffer | ) |
Create a cipher key from serialized bytes
buffer | a buffer created by 'wickr_cipher_key_serialize' |
wickr_buffer_t* wickr_cipher_key_serialize | ( | const wickr_cipher_key_t * | key | ) |
Serialize a cipher key
key | the key to serialize to a buffer |
wickr_cipher_result_t* wickr_cipher_result_copy | ( | const wickr_cipher_result_t * | result | ) |
Copy a cipher result
result | the source of the copy |
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 | ||
) |
Construct a cipher result from individual components.
cipher | the cipher used in the cipher operation |
iv | the initialization vector used in the cipher operation |
cipher_text | the output bytes of a cipher function using 'cipher' and 'iv' |
auth_tag | the authentication tag associated with 'cipher_text'. If 'cipher' is authenticated this property is required, otherwise it should be NULL |
void wickr_cipher_result_destroy | ( | wickr_cipher_result_t ** | result | ) |
Destroy a cipher result
result | a pointer to the cipher result to destroy. Destruction will also destroy the individual properties of 'result' |
wickr_cipher_result_t* wickr_cipher_result_from_buffer | ( | const wickr_buffer_t * | buffer | ) |
Create a cipher result from a serialized cipher result buffer
buffer | a buffer created by 'wickr_cipher_result_serialize' |
bool wickr_cipher_result_is_valid | ( | const wickr_cipher_result_t * | result | ) |
Determine if a cipher result is formed correctly
result | the cipher result to validate |
wickr_buffer_t* wickr_cipher_result_serialize | ( | const wickr_cipher_result_t * | result | ) |
Serialize a cipher result
result | the cipher result to serialize |