mbed TLS v2.3.0
ccm.h
Go to the documentation of this file.
1 
25 #ifndef MBEDTLS_CCM_H
26 #define MBEDTLS_CCM_H
27 
28 #include "cipher.h"
29 
30 #define MBEDTLS_ERR_CCM_BAD_INPUT -0x000D
31 #define MBEDTLS_ERR_CCM_AUTH_FAILED -0x000F
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
40 typedef struct {
42 }
44 
53 
65  mbedtls_cipher_id_t cipher,
66  const unsigned char *key,
67  unsigned int keybits );
68 
75 
101 int mbedtls_ccm_encrypt_and_tag( mbedtls_ccm_context *ctx, size_t length,
102  const unsigned char *iv, size_t iv_len,
103  const unsigned char *add, size_t add_len,
104  const unsigned char *input, unsigned char *output,
105  unsigned char *tag, size_t tag_len );
106 
124 int mbedtls_ccm_auth_decrypt( mbedtls_ccm_context *ctx, size_t length,
125  const unsigned char *iv, size_t iv_len,
126  const unsigned char *add, size_t add_len,
127  const unsigned char *input, unsigned char *output,
128  const unsigned char *tag, size_t tag_len );
129 
130 #if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_AES_C)
131 
136 int mbedtls_ccm_self_test( int verbose );
137 #endif /* MBEDTLS_SELF_TEST && MBEDTLS_AES_C */
138 
139 #ifdef __cplusplus
140 }
141 #endif
142 
143 #endif /* MBEDTLS_CCM_H */
void mbedtls_ccm_free(mbedtls_ccm_context *ctx)
Free a CCM context and underlying cipher sub-context.
CCM context structure.
Definition: ccm.h:40
Generic cipher context.
Definition: cipher.h:216
mbedtls_cipher_id_t
Definition: cipher.h:71
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.
Generic cipher wrapper.
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.
int mbedtls_ccm_self_test(int verbose)
Checkup routine.
mbedtls_cipher_context_t cipher_ctx
Definition: ccm.h:41
void mbedtls_ccm_init(mbedtls_ccm_context *ctx)
Initialize CCM context (just makes references valid) Makes the context ready for mbedtls_ccm_setkey()...