123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- #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
- #ifdef __cplusplus
- }
- #endif
- #endif
|