Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions wolfcrypt/src/aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ block cipher mechanism that uses n-bit binary string parameter key with 128-bits
#include <wolfssl/wolfcrypt/port/nxp/se050_port.h>
#endif

#if defined(WOLFSSL_AES_SIV) || defined(WOLFSSL_AES_EAX)
#if defined(WOLFSSL_AES_SIV)
#include <wolfssl/wolfcrypt/cmac.h>
#endif /* WOLFSSL_AES_SIV || WOLFSSL_AES_EAX */
#endif /* WOLFSSL_AES_SIV */

#if defined(WOLFSSL_HAVE_PSA) && !defined(WOLFSSL_PSA_NO_AES)
#include <wolfssl/wolfcrypt/port/psa/psa.h>
Expand Down Expand Up @@ -11789,17 +11789,6 @@ int wc_AesSivDecrypt(const byte* key, word32 keySz, const byte* assoc,

#if defined(WOLFSSL_AES_EAX)

struct AesEax {
Aes aes;
Cmac nonceCmac;
Cmac aadCmac;
Cmac ciphertextCmac;
byte nonceCmacFinal[AES_BLOCK_SIZE];
byte aadCmacFinal[AES_BLOCK_SIZE];
byte ciphertextCmacFinal[AES_BLOCK_SIZE];
byte prefixBuf[AES_BLOCK_SIZE];
};

/*
* AES EAX one-shot API
* Encrypts input data and computes an auth tag over the input
Expand Down
12 changes: 12 additions & 0 deletions wolfssl/wolfcrypt/aes.h
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,18 @@ int wc_AesSivDecrypt(const byte* key, word32 keySz, const byte* assoc,
#endif

#ifdef WOLFSSL_AES_EAX
#include <wolfssl/wolfcrypt/cmac.h>

struct AesEax {
Aes aes;
Cmac nonceCmac;
Cmac aadCmac;
Cmac ciphertextCmac;
byte nonceCmacFinal[AES_BLOCK_SIZE];
byte aadCmacFinal[AES_BLOCK_SIZE];
byte ciphertextCmacFinal[AES_BLOCK_SIZE];
byte prefixBuf[AES_BLOCK_SIZE];
};

typedef struct AesEax AesEax;

Expand Down