50#if !defined(MBEDTLS_CONFIG_FILE)
53#include MBEDTLS_CONFIG_FILE
58#define MBEDTLS_ERR_CCM_BAD_INPUT -0x000D
59#define MBEDTLS_ERR_CCM_AUTH_FAILED -0x000F
62#define MBEDTLS_ERR_CCM_HW_ACCEL_FAILED -0x0011
75#if !defined(MBEDTLS_CCM_ALT)
117 const unsigned char *key,
118 unsigned int keybits );
166 const unsigned char *iv,
size_t iv_len,
167 const unsigned char *add,
size_t add_len,
168 const unsigned char *input,
unsigned char *output,
169 unsigned char *tag,
size_t tag_len );
214 const unsigned char *iv,
size_t iv_len,
215 const unsigned char *add,
size_t add_len,
216 const unsigned char *input,
unsigned char *output,
217 unsigned char *tag,
size_t tag_len );
251 const unsigned char *iv,
size_t iv_len,
252 const unsigned char *add,
size_t add_len,
253 const unsigned char *input,
unsigned char *output,
254 const unsigned char *tag,
size_t tag_len );
296 const unsigned char *iv,
size_t iv_len,
297 const unsigned char *add,
size_t add_len,
298 const unsigned char *input,
unsigned char *output,
299 const unsigned char *tag,
size_t tag_len );
301#if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_AES_C)
308int mbedtls_ccm_self_test(
int verbose );
This file contains an abstraction interface for use with the cipher primitives provided by the librar...
Configuration options (set of defines)
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...
mbedtls_cipher_id_t
Supported cipher types.
The CCM context-type definition.
mbedtls_cipher_context_t cipher_ctx