123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- #ifndef MBEDTLS_CMAC_H
- #define MBEDTLS_CMAC_H
- #include "mbedtls/cipher.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
- #define MBEDTLS_AES_BLOCK_SIZE 16
- #define MBEDTLS_DES3_BLOCK_SIZE 8
- #if defined(MBEDTLS_AES_C)
- #define MBEDTLS_CIPHER_BLKSIZE_MAX 16
- #else
- #define MBEDTLS_CIPHER_BLKSIZE_MAX 8
- #endif
- struct mbedtls_cmac_context_t
- {
-
- unsigned char state[MBEDTLS_CIPHER_BLKSIZE_MAX];
-
- unsigned char unprocessed_block[MBEDTLS_CIPHER_BLKSIZE_MAX];
-
- size_t unprocessed_len;
- };
- int mbedtls_cipher_cmac_starts( mbedtls_cipher_context_t *ctx,
- const unsigned char *key, size_t keybits );
- int mbedtls_cipher_cmac_update( mbedtls_cipher_context_t *ctx,
- const unsigned char *input, size_t ilen );
- int mbedtls_cipher_cmac_finish( mbedtls_cipher_context_t *ctx,
- unsigned char *output );
- int mbedtls_cipher_cmac_reset( mbedtls_cipher_context_t *ctx );
- 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 );
- #if defined(MBEDTLS_AES_C)
- int mbedtls_aes_cmac_prf_128( const unsigned char *key, size_t key_len,
- const unsigned char *input, size_t in_len,
- unsigned char output[16] );
- #endif
- #if defined(MBEDTLS_SELF_TEST) && ( defined(MBEDTLS_AES_C) || defined(MBEDTLS_DES_C) )
- int mbedtls_cmac_self_test( int verbose );
- #endif
- #ifdef __cplusplus
- }
- #endif
- #endif
|