Loading...
Searching...
No Matches
23#ifndef WOLF_CRYPT_CMAC_H
24#define WOLF_CRYPT_CMAC_H
29#if !defined(NO_AES) && defined(WOLFSSL_CMAC)
31#if defined(HAVE_FIPS) && \
32 defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2)
33 #include <wolfssl/wolfcrypt/fips.h>
41#if !defined(HAVE_FIPS) || \
42 (defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2))
44#ifndef WC_CMAC_TYPE_DEFINED
46 #define WC_CMAC_TYPE_DEFINED
50 byte buffer[AES_BLOCK_SIZE];
51 byte digest[AES_BLOCK_SIZE];
52 byte k1[AES_BLOCK_SIZE];
53 byte k2[AES_BLOCK_SIZE];
60typedef enum CmacType {
64#define WC_CMAC_TAG_MAX_SZ AES_BLOCK_SIZE
65#define WC_CMAC_TAG_MIN_SZ (AES_BLOCK_SIZE/4)
70int wc_InitCmac(
Cmac* cmac,
71 const byte* key, word32 keySz,
72 int type,
void* unused);
74int wc_CmacUpdate(
Cmac* cmac,
75 const byte* in, word32 inSz);
77int wc_CmacFinal(
Cmac* cmac,
78 byte* out, word32* outSz);
81int wc_AesCmacGenerate(
byte* out, word32* outSz,
82 const byte* in, word32 inSz,
83 const byte* key, word32 keySz);
86int wc_AesCmacVerify(
const byte* check, word32 checkSz,
87 const byte* in, word32 inSz,
88 const byte* key, word32 keySz);