PolarSSL v1.3.9
ccm.h
Go to the documentation of this file.
1
27#ifndef POLARSSL_CCM_H
28#define POLARSSL_CCM_H
29
30#include "cipher.h"
31
32#define POLARSSL_ERR_CCM_BAD_INPUT -0x000D
33#define POLARSSL_ERR_CCM_AUTH_FAILED -0x000F
35#ifdef __cplusplus
36extern "C" {
37#endif
38
42typedef struct {
44}
46
58 const unsigned char *key, unsigned int keysize );
59
65void ccm_free( ccm_context *ctx );
66
92int ccm_encrypt_and_tag( ccm_context *ctx, size_t length,
93 const unsigned char *iv, size_t iv_len,
94 const unsigned char *add, size_t add_len,
95 const unsigned char *input, unsigned char *output,
96 unsigned char *tag, size_t tag_len );
97
115int ccm_auth_decrypt( ccm_context *ctx, size_t length,
116 const unsigned char *iv, size_t iv_len,
117 const unsigned char *add, size_t add_len,
118 const unsigned char *input, unsigned char *output,
119 const unsigned char *tag, size_t tag_len );
120
121#if defined(POLARSSL_SELF_TEST) && defined(POLARSSL_AES_C)
127int ccm_self_test( int verbose );
128#endif /* POLARSSL_SELF_TEST && POLARSSL_AES_C */
129
130#ifdef __cplusplus
131}
132#endif
133
134#endif /* POLARSSL_CGM_H */
int ccm_auth_decrypt(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 ccm_encrypt_and_tag(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.
void ccm_free(ccm_context *ctx)
Free a CCM context and underlying cipher sub-context.
int ccm_self_test(int verbose)
Checkup routine.
int ccm_init(ccm_context *ctx, cipher_id_t cipher, const unsigned char *key, unsigned int keysize)
CCM initialization (encryption and decryption)
Generic cipher wrapper.
cipher_id_t
Definition: cipher.h:71
CCM context structure.
Definition: ccm.h:42
cipher_context_t cipher_ctx
Definition: ccm.h:43
Generic cipher context.
Definition: cipher.h:258