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
15 #include <wireshark.h>
17 typedef struct tagMAC_T
22 #define EAX_MODE_CLEARTEXT_AUTH 1
23 #define EAX_MODE_CIPHERTEXT_AUTH 2
25 #define EAX_SIZEOF_KEY 16
28 Decrypts cleartext data using EAX' mode (see ANSI Standard C12.22-2008).
30 @param[in] pN pointer to cleartext (canonified form)
31 @param[in] pK pointer to secret key
32 @param[in,out] pC pointer to ciphertext
33 @param[in] SizeN byte length of cleartext (pN) buffer
34 @param[in] SizeK byte length of secret key (pK)
35 @param[in] SizeC byte length of ciphertext (pC) buffer
36 @param[in] pMac four-byte Message Authentication Code
37 @param[in] Mode EAX_MODE_CLEARTEXT_AUTH or EAX_MODE_CIPHERTEXT_AUTH
38 @return true if message has been authenticated; false if not
39 authenticated, invalid Mode or error
42 bool Eax_Decrypt(uint8_t *pN
, uint8_t *pK
, uint8_t *pC
,
43 uint32_t SizeN
, uint32_t SizeK
, uint32_t SizeC
, MAC_T
*pMac
,