summaryrefslogtreecommitdiff
path: root/epan/crypt/airpdcap_ccmp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2007-02-25 23:25:23 +0000
committerGuy Harris <guy@alum.mit.edu>2007-02-25 23:25:23 +0000
commit2b75ac83af8e23f8b9d284c143537d7ab5b82487 (patch)
tree7b5c3f50bc2d9ca7e8cd4f19f5b1dab72867c944 /epan/crypt/airpdcap_ccmp.c
parent3496de0ff1cd23c991e86861d01e29d3317fcfcb (diff)
downloadwireshark-2b75ac83af8e23f8b9d284c143537d7ab5b82487.tar.gz
Eliminate __inline - not all compilers support it.
svn path=/trunk/; revision=20932
Diffstat (limited to 'epan/crypt/airpdcap_ccmp.c')
-rw-r--r--epan/crypt/airpdcap_ccmp.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/epan/crypt/airpdcap_ccmp.c b/epan/crypt/airpdcap_ccmp.c
index 742b8185c0..eeb9b0019b 100644
--- a/epan/crypt/airpdcap_ccmp.c
+++ b/epan/crypt/airpdcap_ccmp.c
@@ -73,12 +73,16 @@
_b0[14] = (UINT8)((_i >> 8) & 0xff); \
_b0[15] = (UINT8)(_i & 0xff); \
rijndael_encrypt(&key, _b0, _b); \
- xor_block(_pos, _b, _len); \
+ XOR_BLOCK(_pos, _b, _len); \
/* Authentication */ \
- xor_block(_a, _pos, _len); \
+ XOR_BLOCK(_a, _pos, _len); \
rijndael_encrypt(&key, _a, _a); \
}
+#define READ_6(b0, b1, b2, b3, b4, b5) \
+ ((((UINT64)((UINT16)((b4 << 0) | (b5 << 8)))) << 32) | \
+ ((UINT32)((b0 << 0) | (b1 << 8) | (b2 << 16) | (b3 << 24))))
+
#define AIRPDCAP_ADDR_COPY(dst,src) memcpy(dst,src,AIRPDCAP_MAC_LEN)
/****************************************************************************/
@@ -98,19 +102,6 @@ static void ccmp_init_blocks(
/****************************************************************************/
/* Function definitions */
-static __inline UINT64 READ_6(
- UINT8 b0,
- UINT8 b1,
- UINT8 b2,
- UINT8 b3,
- UINT8 b4,
- UINT8 b5)
-{
- UINT32 iv32 = (b0 << 0) | (b1 << 8) | (b2 << 16) | (b3 << 24);
- UINT16 iv16 = (UINT16)((b4 << 0) | (b5 << 8));
- return (((UINT64)iv16) << 32) | iv32;
-}
-
static void ccmp_init_blocks(
rijndael_ctx *ctx,
PAIRPDCAP_MAC_FRAME wh,
@@ -203,9 +194,9 @@ static void ccmp_init_blocks(
/* Start with the first block and AAD */
rijndael_encrypt(ctx, b0, a);
- xor_block(a, aad, AES_BLOCK_LEN);
+ XOR_BLOCK(a, aad, AES_BLOCK_LEN);
rijndael_encrypt(ctx, a, a);
- xor_block(a, &aad[AES_BLOCK_LEN], AES_BLOCK_LEN);
+ XOR_BLOCK(a, &aad[AES_BLOCK_LEN], AES_BLOCK_LEN);
rijndael_encrypt(ctx, a, a);
b0[0] &= 0x07;
b0[14] = b0[15] = 0;
@@ -246,7 +237,7 @@ INT AirPDcapCcmpDecrypt(
return 0;
ccmp_init_blocks(&key, wh, *(UINT64 *)PN, data_len, b0, aad, a, b);
memcpy(mic, m+len-AIRPDCAP_CCMP_TRAILER, AIRPDCAP_CCMP_TRAILER);
- xor_block(mic, b, AIRPDCAP_CCMP_TRAILER);
+ XOR_BLOCK(mic, b, AIRPDCAP_CCMP_TRAILER);
i = 1;
pos = (UINT8 *)m + z + AIRPDCAP_CCMP_HEADER;