RetroArch
cmac.h
Go to the documentation of this file.
1 
24 #ifndef MBEDTLS_CMAC_H
25 #define MBEDTLS_CMAC_H
26 
27 #include "mbedtls/cipher.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #define MBEDTLS_AES_BLOCK_SIZE 16
34 #define MBEDTLS_DES3_BLOCK_SIZE 8
35 
36 #if defined(MBEDTLS_AES_C)
37 #define MBEDTLS_CIPHER_BLKSIZE_MAX 16 /* longest used by CMAC is AES */
38 #else
39 #define MBEDTLS_CIPHER_BLKSIZE_MAX 8 /* longest used by CMAC is 3DES */
40 #endif
41 
46 {
49 
53 
56 };
57 
75  const unsigned char *key, size_t keybits );
76 
92  const unsigned char *input, size_t ilen );
93 
107  unsigned char *output );
108 
120 
134 int mbedtls_cipher_cmac( const mbedtls_cipher_info_t *cipher_info,
135  const unsigned char *key, size_t keylen,
136  const unsigned char *input, size_t ilen,
137  unsigned char *output );
138 
139 #if defined(MBEDTLS_AES_C)
140 
152 int mbedtls_aes_cmac_prf_128( const unsigned char *key, size_t key_len,
153  const unsigned char *input, size_t in_len,
154  unsigned char output[16] );
155 #endif /* MBEDTLS_AES_C */
156 
157 #if defined(MBEDTLS_SELF_TEST) && ( defined(MBEDTLS_AES_C) || defined(MBEDTLS_DES_C) )
158 
163 int mbedtls_cmac_self_test( int verbose );
164 #endif /* MBEDTLS_SELF_TEST && ( MBEDTLS_AES_C || MBEDTLS_DES_C ) */
165 
166 #ifdef __cplusplus
167 }
168 #endif
169 
170 #endif /* MBEDTLS_CMAC_H */
int mbedtls_cipher_cmac_update(mbedtls_cipher_context_t *ctx, const unsigned char *input, size_t ilen)
Generic CMAC process buffer. Called between mbedtls_cipher_cmac_starts() or mbedtls_cipher_cmac_reset...
unsigned char unprocessed_block[MBEDTLS_CIPHER_BLKSIZE_MAX]
Definition: cmac.h:52
unsigned char state[MBEDTLS_CIPHER_BLKSIZE_MAX]
Definition: cmac.h:48
int mbedtls_cipher_cmac_starts(mbedtls_cipher_context_t *ctx, const unsigned char *key, size_t keybits)
Set the CMAC key and prepare to authenticate the input data. Should be called with an initialized cip...
#define MBEDTLS_CIPHER_BLKSIZE_MAX
Definition: cmac.h:39
int mbedtls_cipher_cmac(const mbedtls_cipher_info_t *cipher_info, const unsigned char *key, size_t keylen, const unsigned char *input, size_t ilen, unsigned char *output)
Output = Generic_CMAC( cmac key, input buffer )
GLenum GLenum GLenum input
Definition: glext.h:9938
int mbedtls_cipher_cmac_reset(mbedtls_cipher_context_t *ctx)
Prepare to authenticate a new message with the same key. Called after mbedtls_cipher_cmac_finish() an...
AVFormatContext * ctx
Definition: record_ffmpeg.c:247
Generic cipher wrapper.
size_t unprocessed_len
Definition: cmac.h:55
std::string output
Definition: Config.FromFile.cpp:44
int mbedtls_cipher_cmac_finish(mbedtls_cipher_context_t *ctx, unsigned char *output)
Output CMAC. Called after mbedtls_cipher_cmac_update(). Usually followed by mbedtls_cipher_cmac_reset...
Definition: cmac.h:45
Definition: cipher.h:216
Definition: cipher.h:184
static const uint32_t key_len[MAX_TESTS]
Definition: pkcs5.c:329