54 #define MBEDTLS_ERR_CCM_BAD_INPUT -0x000D 55 #define MBEDTLS_ERR_CCM_AUTH_FAILED -0x000F 58 #define MBEDTLS_ERR_CCM_HW_ACCEL_FAILED -0x0011 64 #if !defined(MBEDTLS_CCM_ALT) 106 const unsigned char *key,
107 unsigned int keybits );
155 const unsigned char *iv,
size_t iv_len,
156 const unsigned char *add,
size_t add_len,
157 const unsigned char *input,
unsigned char *output,
158 unsigned char *tag,
size_t tag_len );
203 const unsigned char *iv,
size_t iv_len,
204 const unsigned char *add,
size_t add_len,
205 const unsigned char *input,
unsigned char *output,
206 unsigned char *tag,
size_t tag_len );
240 const unsigned char *iv,
size_t iv_len,
241 const unsigned char *add,
size_t add_len,
242 const unsigned char *input,
unsigned char *output,
243 const unsigned char *tag,
size_t tag_len );
285 const unsigned char *iv,
size_t iv_len,
286 const unsigned char *add,
size_t add_len,
287 const unsigned char *input,
unsigned char *output,
288 const unsigned char *tag,
size_t tag_len );
290 #if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_AES_C) 297 int 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.
Definition: ccm.c:107
The CCM context-type definition. The CCM context is passed to the APIs called.
Definition: ccm.h:72
struct mbedtls_ccm_context mbedtls_ccm_context
The CCM context-type definition. The CCM context is passed to the APIs called.
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*.
Definition: ccm.c:318
mbedtls_cipher_id_t
Supported cipher types.
Definition: cipher.h:84
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.
Definition: ccm.c:334
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.
Definition: ccm.c:356
This file contains an abstraction interface for use with the cipher primitives provided by the librar...
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.
Definition: ccm.c:72
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.
Definition: ccm.c:394
mbedtls_cipher_context_t cipher_ctx
Definition: ccm.h:74
void mbedtls_ccm_init(mbedtls_ccm_context *ctx)
This function initializes the specified CCM context, to make references valid, and prepare the contex...
Definition: ccm.c:66