|
|
1.1 root 1: /*
2: Copyright (c) 2008 TrueCrypt Foundation. All rights reserved.
3:
1.1.1.3 ! root 4: Governed by the TrueCrypt License 2.5 the full text of which is contained
1.1 root 5: in the file License.txt included in TrueCrypt binary and source code
6: distribution packages.
7: */
8:
9: #ifndef XTS_H
10: #define XTS_H
11:
12: // Header files (optional)
13:
14: #include "Tcdefs.h"
15: #include "Common/Endian.h"
16: #include "Crypto.h"
17:
1.1.1.2 root 18: #ifdef __cplusplus
19: extern "C" {
20: #endif
21:
1.1 root 22: // Macros
23:
24: #ifndef LITTLE_ENDIAN
25: # define LITTLE_ENDIAN 1
26: #endif
27:
28: #ifndef BIG_ENDIAN
29: # define BIG_ENDIAN 2
30: #endif
31:
32: #ifndef BYTE_ORDER
33: # define BYTE_ORDER LITTLE_ENDIAN
34: #endif
35:
36: #ifndef LE64
37: # if BYTE_ORDER == LITTLE_ENDIAN
38: # define LE64(x) (x)
39: # endif
40: #endif
41:
42: // Custom data types
43:
44: #ifndef TC_LARGEST_COMPILER_UINT
45: # ifdef TC_NO_COMPILER_INT64
46: typedef unsigned __int32 TC_LARGEST_COMPILER_UINT;
47: # else
48: typedef unsigned __int64 TC_LARGEST_COMPILER_UINT;
49: # endif
50: #endif
51:
52: #ifndef TCDEFS_H
53: typedef union
54: {
55: struct
56: {
57: unsigned __int32 LowPart;
58: unsigned __int32 HighPart;
59: };
60: # ifndef TC_NO_COMPILER_INT64
61: unsigned __int64 Value;
62: # endif
63:
64: } UINT64_STRUCT;
65: #endif
66:
67: // Public function prototypes
68:
69: void EncryptBufferXTS (unsigned __int8 *buffer, TC_LARGEST_COMPILER_UINT length, const UINT64_STRUCT *startDataUnitNo, unsigned int startCipherBlockNo, unsigned __int8 *ks, unsigned __int8 *ks2, int cipher);
70: void DecryptBufferXTS (unsigned __int8 *buffer, TC_LARGEST_COMPILER_UINT length, const UINT64_STRUCT *startDataUnitNo, unsigned int startCipherBlockNo, unsigned __int8 *ks, unsigned __int8 *ks2, int cipher);
71:
1.1.1.2 root 72: #ifdef __cplusplus
73: }
74: #endif
75:
1.1 root 76: #endif // #ifndef XTS_H
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.