ccm.h
Go to the documentation of this file.
#ifndef MBEDTLS_CCM_H
#define MBEDTLS_CCM_H
#include "cipher.h"
#define MBEDTLS_ERR_CCM_BAD_INPUT -0x000D
#define MBEDTLS_ERR_CCM_AUTH_FAILED -0x000F
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
mbedtls_cipher_context_t cipher_ctx;
}
mbedtls_ccm_context;
void mbedtls_ccm_init( mbedtls_ccm_context *ctx );
int mbedtls_ccm_setkey( mbedtls_ccm_context *ctx,
mbedtls_cipher_id_t cipher,
const unsigned char *key,
unsigned int keybits );
void mbedtls_ccm_free( mbedtls_ccm_context *ctx );
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 );
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 );
#if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_AES_C)
int mbedtls_ccm_self_test( int verbose );
#endif /* MBEDTLS_SELF_TEST && MBEDTLS_AES_C */
#ifdef __cplusplus
}
#endif
#endif /* MBEDTLS_CCM_H */
mbedtls_ccm_free
void mbedtls_ccm_free(mbedtls_ccm_context *ctx)
Free a CCM context and underlying cipher sub-context.
mbedtls_ccm_context
CCM context structure.
Definition: ccm.h:38
mbedtls_cipher_context_t
Generic cipher context.
Definition: cipher.h:213
mbedtls_cipher_id_t
mbedtls_cipher_id_t
Definition: cipher.h:68
mbedtls_ccm_encrypt_and_tag
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.
cipher.h
Generic cipher wrapper.
mbedtls_ccm_setkey
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)
mbedtls_ccm_auth_decrypt
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_ccm_self_test
int mbedtls_ccm_self_test(int verbose)
Checkup routine.
mbedtls_ccm_context::cipher_ctx
mbedtls_cipher_context_t cipher_ctx
Definition: ccm.h:39
mbedtls_ccm_init
void mbedtls_ccm_init(mbedtls_ccm_context *ctx)
Initialize CCM context (just makes references valid) Makes the context ready for mbedtls_ccm_setkey()...