|
|
1.1 root 1: /* 1.1.1.8 ! root 2: Copyright (c) 2008-2010 TrueCrypt Developers Association. All rights reserved. 1.1 root 3: 1.1.1.8 ! root 4: Governed by the TrueCrypt License 3.0 the full text of which is contained in 1.1.1.7 root 5: the file License.txt included in TrueCrypt binary and source code distribution 6: packages. 1.1 root 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); 1.1.1.8 ! root 70: static void EncryptBufferXTSParallel (unsigned __int8 *buffer, TC_LARGEST_COMPILER_UINT length, const UINT64_STRUCT *startDataUnitNo, unsigned int startCipherBlockNo, unsigned __int8 *ks, unsigned __int8 *ks2, int cipher); ! 71: static void EncryptBufferXTSNonParallel (unsigned __int8 *buffer, TC_LARGEST_COMPILER_UINT length, const UINT64_STRUCT *startDataUnitNo, unsigned int startCipherBlockNo, unsigned __int8 *ks, unsigned __int8 *ks2, int cipher); 1.1 root 72: 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); 1.1.1.8 ! root 73: static void DecryptBufferXTSParallel (unsigned __int8 *buffer, TC_LARGEST_COMPILER_UINT length, const UINT64_STRUCT *startDataUnitNo, unsigned int startCipherBlockNo, unsigned __int8 *ks, unsigned __int8 *ks2, int cipher); ! 74: static void DecryptBufferXTSNonParallel (unsigned __int8 *buffer, TC_LARGEST_COMPILER_UINT length, const UINT64_STRUCT *startDataUnitNo, unsigned int startCipherBlockNo, unsigned __int8 *ks, unsigned __int8 *ks2, int cipher); 1.1 root 75: 1.1.1.2 root 76: #ifdef __cplusplus 77: } 78: #endif 79: 1.1 root 80: #endif // #ifndef XTS_H
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.