28 #define MBEDTLS_ERR_CCM_BAD_INPUT -0x000D
29 #define MBEDTLS_ERR_CCM_AUTH_FAILED -0x000F
31 #if defined( MBEDTLS_CCM_ALT )
72 const unsigned char *key,
73 unsigned int keybits );
108 const unsigned char *iv,
size_t iv_len,
109 const unsigned char *add,
size_t add_len,
110 const unsigned char *input,
unsigned char *output,
111 unsigned char *tag,
size_t tag_len );
131 const unsigned char *iv,
size_t iv_len,
132 const unsigned char *add,
size_t add_len,
133 const unsigned char *input,
unsigned char *output,
134 const unsigned char *tag,
size_t tag_len );
136 #if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_AES_C)
142 int mbedtls_ccm_self_test(
int verbose );
void mbedtls_ccm_free(mbedtls_ccm_context *ctx)
Free a CCM context and underlying cipher sub-context.
Counter with CBC-MAC (CCM) for 128-bit block 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)
CCM buffer encryption.
int mbedtls_ccm_setkey(mbedtls_ccm_context *ctx, mbedtls_cipher_id_t cipher, const unsigned char *key, unsigned int keybits)
CCM initialization (encryption and decryption)
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)
CCM buffer authenticated decryption.
mbedtls_cipher_context_t cipher_ctx
void mbedtls_ccm_init(mbedtls_ccm_context *ctx)
Initialize CCM context (just makes references valid) Makes the context ready for mbedtls_ccm_setkey()...