2 * Encryption and decryption routines implementing the EAX' encryption mode
3 * Copyright 2010, Edward J. Beroset, edward.j.beroset@us.elster.com
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
16 #include "ws_symbol_export.h"
18 typedef struct tagMAC_T
23 #define EAX_MODE_CLEARTEXT_AUTH 1
24 #define EAX_MODE_CIPHERTEXT_AUTH 2
26 #define EAX_SIZEOF_KEY 16
29 Decrypts cleartext data using EAX' mode (see ANSI Standard C12.22-2008).
31 @param[in] pN pointer to cleartext (canonified form)
32 @param[in] pK pointer to secret key
33 @param[in,out] pC pointer to ciphertext
34 @param[in] SizeN byte length of cleartext (pN) buffer
35 @param[in] SizeK byte length of secret key (pK)
36 @param[in] SizeC byte length of ciphertext (pC) buffer
37 @param[in] pMac four-byte Message Authentication Code
38 @param[in] Mode EAX_MODE_CLEARTEXT_AUTH or EAX_MODE_CIPHERTEXT_AUTH
39 @return TRUE if message has been authenticated; FALSE if not
40 authenticated, invalid Mode or error
43 gboolean Eax_Decrypt(guint8 *pN, guint8 *pK, guint8 *pC,
44 guint32 SizeN, guint32 SizeK, guint32 SizeC, MAC_T *pMac,