77#if !defined(MBEDTLS_CONFIG_FILE)
80#include MBEDTLS_CONFIG_FILE
85#define MBEDTLS_ERR_CCM_BAD_INPUT -0x000D
86#define MBEDTLS_ERR_CCM_AUTH_FAILED -0x000F
89#define MBEDTLS_ERR_CCM_HW_ACCEL_FAILED -0x0011
95#if !defined(MBEDTLS_CCM_ALT)
137 const unsigned char *
key,
138 unsigned int keybits );
186 const unsigned char *iv,
size_t iv_len,
187 const unsigned char *add,
size_t add_len,
188 const unsigned char *
input,
unsigned char *output,
189 unsigned char *
tag,
size_t tag_len );
234 const unsigned char *iv,
size_t iv_len,
235 const unsigned char *add,
size_t add_len,
236 const unsigned char *
input,
unsigned char *output,
237 unsigned char *
tag,
size_t tag_len );
271 const unsigned char *iv,
size_t iv_len,
272 const unsigned char *add,
size_t add_len,
273 const unsigned char *
input,
unsigned char *output,
274 const unsigned char *
tag,
size_t tag_len );
316 const unsigned char *iv,
size_t iv_len,
317 const unsigned char *add,
size_t add_len,
318 const unsigned char *
input,
unsigned char *output,
319 const unsigned char *
tag,
size_t tag_len );
321#if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_AES_C)
328int mbedtls_ccm_self_test(
int verbose );
void mbedtls_ccm_free(mbedtls_ccm_context *ctx)
This function releases and clears the specified CCM context and underlying cipher sub-context.
int mbedtls_ccm_star_auth_decrypt(mbedtls_ccm_context *ctx, size_t length, const unsigned char *iv, size_t iv_len, const unsigned char *add, size_t add_len, const unsigned char *input, unsigned char *output, const unsigned char *tag, size_t tag_len)
This function performs a CCM* authenticated decryption of a buffer.
int mbedtls_ccm_setkey(mbedtls_ccm_context *ctx, mbedtls_cipher_id_t cipher, const unsigned char *key, unsigned int keybits)
This function initializes the CCM context set in the ctx parameter and sets the encryption key.
int mbedtls_ccm_star_encrypt_and_tag(mbedtls_ccm_context *ctx, size_t length, const unsigned char *iv, size_t iv_len, const unsigned char *add, size_t add_len, const unsigned char *input, unsigned char *output, unsigned char *tag, size_t tag_len)
This function encrypts a buffer using CCM*.
int mbedtls_ccm_encrypt_and_tag(mbedtls_ccm_context *ctx, size_t length, const unsigned char *iv, size_t iv_len, const unsigned char *add, size_t add_len, const unsigned char *input, unsigned char *output, unsigned char *tag, size_t tag_len)
This function encrypts a buffer using CCM.
int mbedtls_ccm_auth_decrypt(mbedtls_ccm_context *ctx, size_t length, const unsigned char *iv, size_t iv_len, const unsigned char *add, size_t add_len, const unsigned char *input, unsigned char *output, const unsigned char *tag, size_t tag_len)
This function performs a CCM authenticated decryption of a buffer.
void mbedtls_ccm_init(mbedtls_ccm_context *ctx)
This function initializes the specified CCM context, to make references valid, and prepare the contex...
This file contains an abstraction interface for use with the cipher primitives provided by the librar...
mbedtls_cipher_id_t
Supported cipher types.
GLuint GLsizei GLsizei * length
GLenum GLenum GLenum input
The CCM context-type definition. The CCM context is passed to the APIs called.
mbedtls_cipher_context_t cipher_ctx