64 #if !defined(MBEDTLS_CONFIG_FILE)
67 #include MBEDTLS_CONFIG_FILE
72 #define MBEDTLS_ERR_CCM_BAD_INPUT -0x000D
73 #define MBEDTLS_ERR_CCM_AUTH_FAILED -0x000F
74 #define MBEDTLS_ERR_CCM_HW_ACCEL_FAILED -0x0011
76 #if !defined(MBEDTLS_CCM_ALT)
115 const unsigned char *key,
116 unsigned int keybits );
152 const unsigned char *iv,
size_t iv_len,
153 const unsigned char *add,
size_t add_len,
154 const unsigned char *input,
unsigned char *output,
155 unsigned char *tag,
size_t tag_len );
179 const unsigned char *iv,
size_t iv_len,
180 const unsigned char *add,
size_t add_len,
181 const unsigned char *input,
unsigned char *output,
182 const unsigned char *tag,
size_t tag_len );
196 #if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_AES_C)
void mbedtls_ccm_free(mbedtls_ccm_context *ctx)
This function releases and clears the specified CCM context and underlying cipher sub-context...
The CCM context-type definition. The CCM context is passed to the APIs called.
Configuration options (set of defines)
mbedtls_cipher_id_t
An enumeration of supported ciphers.
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.
The generic cipher wrapper.
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_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_self_test(int verbose)
The CCM checkup routine.
mbedtls_cipher_context_t cipher_ctx
void mbedtls_ccm_init(mbedtls_ccm_context *ctx)
This function initializes the specified CCM context, to make references valid, and prepare the contex...