update epan/dissectors/pidl/drsuapi/drsuapi.idl from samba
[wireshark-sm.git] / wsutil / eax.h
blobccf4dc621542e2a439f4519b3fc9033b404b2be4
1 /** @file
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
12 #ifndef _EAX_H
13 #define _EAX_H
15 #include <wireshark.h>
17 typedef struct tagMAC_T
19 uint8_t Mac[4];
20 } MAC_T;
22 #define EAX_MODE_CLEARTEXT_AUTH 1
23 #define EAX_MODE_CIPHERTEXT_AUTH 2
25 #define EAX_SIZEOF_KEY 16
27 /*!
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
41 WS_DLL_PUBLIC
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,
44 uint8_t Mode);
46 #endif