|
wickr-crypto-c
|
Data Structures | |
| struct | wickr_stream_ctx |
| A context that is used for encrypting or decrypting a sequenced stream of data packets The stream context manages the state of stream operations including key evolution management based on the sequence number of the being encrypted / decrypted. The stream context is assigned a direction, and can only be used for encoding OR decoding of packets, and not both. More... | |
Functions | |
| wickr_stream_ctx_t * | wickr_stream_ctx_create (const wickr_crypto_engine_t engine, wickr_stream_key_t *stream_key, wickr_stream_direction direction) |
| wickr_stream_ctx_t * | wickr_stream_ctx_copy (const wickr_stream_ctx_t *ctx) |
| wickr_cipher_result_t * | wickr_stream_ctx_encode (wickr_stream_ctx_t *ctx, const wickr_buffer_t *data, const wickr_buffer_t *aad, uint64_t seq_num) |
| wickr_buffer_t * | wickr_stream_ctx_decode (wickr_stream_ctx_t *ctx, const wickr_cipher_result_t *data, const wickr_buffer_t *aad, uint64_t seq_num) |
| void | wickr_stream_ctx_destroy (wickr_stream_ctx_t **ctx) |
| bool | wickr_stream_ctx_ref_up (wickr_stream_ctx_t *ctx) |
| wickr_stream_ctx_t* wickr_stream_ctx_copy | ( | const wickr_stream_ctx_t * | ctx | ) |
Copy a stream context
| ctx | the stream context to copy |
| wickr_stream_ctx_t* wickr_stream_ctx_create | ( | const wickr_crypto_engine_t | engine, |
| wickr_stream_key_t * | stream_key, | ||
| wickr_stream_direction | direction | ||
| ) |
Create a stream context
| engine | see wickr_stream_ctx documentation |
| stream_key | see wickr_stream_ctx documentation |
| direction | see wickr_stream_ctx documentation |
| wickr_buffer_t* wickr_stream_ctx_decode | ( | wickr_stream_ctx_t * | ctx, |
| const wickr_cipher_result_t * | data, | ||
| const wickr_buffer_t * | aad, | ||
| uint64_t | seq_num | ||
| ) |
Encode a packet
| ctx | context to use for decoding |
| data | the data to decode using the context's key |
| aad | additional data to authenticate with the ciphertext |
| seq_num | the sequence number assoiciated with 'data' |
| void wickr_stream_ctx_destroy | ( | wickr_stream_ctx_t ** | ctx | ) |
Destroy a stream context
| ctx | a pointer to the stream context to destroy. All properties of '*ctx' will also be destroyed |
| wickr_cipher_result_t* wickr_stream_ctx_encode | ( | wickr_stream_ctx_t * | ctx, |
| const wickr_buffer_t * | data, | ||
| const wickr_buffer_t * | aad, | ||
| uint64_t | seq_num | ||
| ) |
Encode a packet
| ctx | context to use for encoding |
| data | the data to encode using the context's key |
| aad | additional data to authenticate with the ciphertext |
| seq_num | the sequence number assoiciated with 'data' |
| bool wickr_stream_ctx_ref_up | ( | wickr_stream_ctx_t * | ctx | ) |
Increment the reference count of a stream
| ctx | the context to bump the reference count of |