|
|
1.1.1.3 root 1: /* The source code contained in this file has been derived from the source code
2: of Encryption for the Masses 2.02a by Paul Le Roux. Modifications and
1.1.1.5 ! root 3: additions to that source code contained in this file are Copyright (c) 2004-2005
1.1.1.4 root 4: TrueCrypt Foundation and Copyright (c) 2004 TrueCrypt Team. Unmodified
1.1.1.3 root 5: parts are Copyright (c) 1998-99 Paul Le Roux. This is a TrueCrypt Foundation
6: release. Please see the file license.txt for full license details. */
1.1 root 7:
1.1.1.4 root 8:
9:
10: /* Macros to read and write 16, 32, and 64-bit quantities in a portable manner.
11: These functions are implemented as macros rather than true functions as
12: the need to adjust the memory pointers makes them somewhat painful to call
13: in user code */
14:
15: #define mputInt64(memPtr,data) \
16: *memPtr++ = ( unsigned char ) ( ( ( data ) >> 56 ) & 0xFF ), \
17: *memPtr++ = ( unsigned char ) ( ( ( data ) >> 48 ) & 0xFF ), \
18: *memPtr++ = ( unsigned char ) ( ( ( data ) >> 40 ) & 0xFF ), \
19: *memPtr++ = ( unsigned char ) ( ( ( data ) >> 32 ) & 0xFF ), \
20: *memPtr++ = ( unsigned char ) ( ( ( data ) >> 24 ) & 0xFF ), \
21: *memPtr++ = ( unsigned char ) ( ( ( data ) >> 16 ) & 0xFF ), \
22: *memPtr++ = ( unsigned char ) ( ( ( data ) >> 8 ) & 0xFF ), \
23: *memPtr++ = ( unsigned char ) ( ( data ) & 0xFF )
24:
1.1 root 25: #define mputLong(memPtr,data) \
26: *memPtr++ = ( unsigned char ) ( ( ( data ) >> 24 ) & 0xFF ), \
27: *memPtr++ = ( unsigned char ) ( ( ( data ) >> 16 ) & 0xFF ), \
28: *memPtr++ = ( unsigned char ) ( ( ( data ) >> 8 ) & 0xFF ), \
29: *memPtr++ = ( unsigned char ) ( ( data ) & 0xFF )
30:
31: #define mputWord(memPtr,data) \
32: *memPtr++ = ( unsigned char ) ( ( ( data ) >> 8 ) & 0xFF ), \
33: *memPtr++ = ( unsigned char ) ( ( data ) & 0xFF )
34:
35: #define mputByte(memPtr,data) \
36: *memPtr++ = ( unsigned char ) data
37:
38: #define mputBytes(memPtr,data,len) \
39: memcpy (memPtr,data,len); \
40: memPtr += len;
41:
1.1.1.4 root 42:
43: #define mgetInt64(memPtr) \
44: ( memPtr += 8, ( ( unsigned __int64 ) memPtr[ -8 ] << 56 ) | ( ( unsigned __int64 ) memPtr[ -7 ] << 48 ) | \
45: ( ( unsigned __int64 ) memPtr[ -6 ] << 40 ) | ( ( unsigned __int64 ) memPtr[ -5 ] << 32 ) | \
46: ( ( unsigned __int64 ) memPtr[ -4 ] << 24 ) | ( ( unsigned __int64 ) memPtr[ -3 ] << 16 ) | \
47: ( ( unsigned __int64 ) memPtr[ -2 ] << 8 ) | ( unsigned __int64 ) memPtr[ -1 ] )
48:
1.1 root 49:
50: #define mgetLong(memPtr) \
51: ( memPtr += 4, ( ( unsigned long ) memPtr[ -4 ] << 24 ) | ( ( unsigned long ) memPtr[ -3 ] << 16 ) | \
52: ( ( unsigned long ) memPtr[ -2 ] << 8 ) | ( unsigned long ) memPtr[ -1 ] )
53:
54: #define mgetWord(memPtr) \
55: ( memPtr += 2, ( unsigned short ) memPtr[ -2 ] << 8 ) | ( ( unsigned short ) memPtr[ -1 ] )
56:
57: #define mgetByte(memPtr) \
58: ( ( unsigned char ) *memPtr++ )
59:
60:
61: #define LITTLE_ENDIAN 1
62:
63: /* Everything below this line is automatically updated by the -mkproto-tool- */
64:
65: void LongReverse ( unsigned long *buffer , unsigned byteCount );
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.