/** @defgroup CryptoKernel Cryptographic Kernel All of the cryptographic functions are contained in a kernel. */ /** @defgroup CipherImplementations Ciphers @ingroup CryptoKernel @brief A generic cipher type enables cipher agility, that is, the ability to write code that runs with multiple cipher types. Ciphers can be used through the crypto kernel, or can be accessed directly, if need be. @{ */ /** * @brief Allocates a cipher of a particular type. * @warning May be implemented as a macro. */ srtp_err_status_t srtp_cipher_type_alloc(const srtp_cipher_type_t *ct, srtp_cipher_t **c, size_t key_len, size_t tlen); /** * @brief Initialized a cipher to use a particular key. May * be invoked more than once on the same cipher. * @warning May be implemented as a macro. */ srtp_err_status_t srtp_cipher_init(srtp_cipher_t *c, const uint8_t *key); /** * @brief Sets the initialization vector of a given cipher. * @warning May be implemented as a macro. */ srtp_err_status_t srtp_cipher_set_iv(srtp_cipher_t *c, uint8_t *iv, srtp_cipher_direction_t direction); /** * @brief Encrypts a buffer with a given cipher. * @warning May be implemented as a macro. */ srtp_err_status_t srtp_cipher_encrypt(srtp_cipher_t *c, uint8_t *buffer, size_t *num_octets_to_output); /** * @brief Sets a buffer to the keystream generated by the cipher. * @warning May be implemented as a macro. */ srtp_err_status_t srtp_cipher_output(srtp_cipher_t *c, uint8_t *buffer, size_t *num_octets_to_output); /** * @brief Deallocates a cipher. * @warning May be implemented as a macro. */ srtp_err_status_t srtp_cipher_dealloc(srtp_cipher_t *c); /** * @} */ */