RetroArch
ccm.h
Go to the documentation of this file.
1 
23 #ifndef MBEDTLS_CCM_H
24 #define MBEDTLS_CCM_H
25 
26 #include "cipher.h"
27 
28 #define MBEDTLS_ERR_CCM_BAD_INPUT -0x000D
29 #define MBEDTLS_ERR_CCM_AUTH_FAILED -0x000F
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
38 typedef struct {
40 }
42 
51 
63  mbedtls_cipher_id_t cipher,
64  const unsigned char *key,
65  unsigned int keybits );
66 
73 
100  const unsigned char *iv, size_t iv_len,
101  const unsigned char *add, size_t add_len,
102  const unsigned char *input, unsigned char *output,
103  unsigned char *tag, size_t tag_len );
104 
123  const unsigned char *iv, size_t iv_len,
124  const unsigned char *add, size_t add_len,
125  const unsigned char *input, unsigned char *output,
126  const unsigned char *tag, size_t tag_len );
127 
128 #if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_AES_C)
129 
134 int mbedtls_ccm_self_test( int verbose );
135 #endif /* MBEDTLS_SELF_TEST && MBEDTLS_AES_C */
136 
137 #ifdef __cplusplus
138 }
139 #endif
140 
141 #endif /* MBEDTLS_CCM_H */
static const unsigned char tag[MAX_TESTS *3][16]
Definition: gcm.c:696
static const size_t add_len[NB_TESTS]
Definition: ccm.c:382
GLenum GLenum GLenum input
Definition: glext.h:9938
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)
Definition: ccm.c:65
AVFormatContext * ctx
Definition: record_ffmpeg.c:247
static const unsigned char iv[]
Definition: ccm.c:364
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.
Definition: ccm.c:317
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.
Definition: ccm.c:304
Generic cipher wrapper.
void mbedtls_ccm_free(mbedtls_ccm_context *ctx)
Free a CCM context and underlying cipher sub-context.
Definition: ccm.c:97
mbedtls_cipher_context_t cipher_ctx
Definition: ccm.h:39
int mbedtls_ccm_self_test(int verbose)
Checkup routine.
Definition: ccm.c:397
CCM context structure.
Definition: ccm.h:38
void mbedtls_ccm_init(mbedtls_ccm_context *ctx)
Initialize CCM context (just makes references valid) Makes the context ready for mbedtls_ccm_setkey()...
Definition: ccm.c:60
std::string output
Definition: Config.FromFile.cpp:44
Definition: cipher.h:216
static const size_t iv_len[NB_TESTS]
Definition: ccm.c:381
static const size_t tag_len[NB_TESTS]
Definition: ccm.c:384
GLenum GLuint GLenum GLsizei length
Definition: glext.h:6233
mbedtls_cipher_id_t
Definition: cipher.h:66