/* Legal Notice: Some portions of the source code contained in this file were derived from the source code of TrueCrypt 7.1a, which is Copyright (c) 2003-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0, also from the source code of Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux and which is governed by the 'License Agreement for Encryption for the Masses' Modifications and additions to the original source code (contained in this file) and all other portions of this file are Copyright (c) 2013-2017 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source code distribution packages. */ #ifndef TCDEFS_H #define TCDEFS_H #if defined(_UEFI) #undef _WIN32 #undef _WIN64 #undef _DEBUG #include #include #include void* VeraCryptMemAlloc(IN UINTN size); void VeraCryptMemFree(IN VOID* ptr); #define BOOL int #ifndef FALSE #define FALSE 0 #define TRUE 1 #endif #define max(a,b) ((a)>(b))?(a):(b) #define min(a,b) ((a)<(b))?(a):(b) #ifdef __cplusplus extern "C" { #endif extern unsigned __int64 __cdecl _rotl64(unsigned __int64,int); extern unsigned __int64 __cdecl _rotr64(unsigned __int64,int); extern unsigned int __cdecl _rotl(unsigned int,int); extern unsigned int __cdecl _rotr(unsigned int,int); extern unsigned char _rotr8(unsigned char value, unsigned char shift); extern unsigned short _rotr16(unsigned short value, unsigned char shift); extern unsigned char _rotl8(unsigned char value, unsigned char shift); extern unsigned short _rotl16(unsigned short value, unsigned char shift); #ifdef __cplusplus } #endif #endif // defined(_UEFI) #define TC_APP_NAME "VeraCrypt" // Version displayed to user #define VERSION_STRING "1.22" // Version number to compare against driver #define VERSION_NUM 0x0122 // Release date #define TC_STR_RELEASE_DATE L"March 30, 2018" #define TC_RELEASE_DATE_YEAR 2018 #define TC_RELEASE_DATE_MONTH 03 #define BYTES_PER_KB 1024LL #define BYTES_PER_MB 1048576LL #define BYTES_PER_GB 1073741824LL #define BYTES_PER_TB 1099511627776LL #define BYTES_PER_PB 1125899906842624LL /* GUI/driver errors */ #define WIDE(x) (LPWSTR)L##x #define VC_MAX(a,b) ((a)>(b))?(a):(b) #define VC_MIN(a,b) ((a)<(b))?(a):(b) #ifdef _MSC_VER typedef __int8 int8; typedef __int16 int16; typedef __int32 int32; typedef unsigned __int8 byte; typedef unsigned __int16 uint16; typedef unsigned __int32 uint32; #ifdef TC_NO_COMPILER_INT64 typedef unsigned __int32 TC_LARGEST_COMPILER_UINT; #else typedef unsigned __int64 TC_LARGEST_COMPILER_UINT; typedef __int64 int64; typedef unsigned __int64 uint64; #define LL(x) x##ui64 #endif #pragma warning( disable : 4201 ) // disable: 4201 nonstandard extension used : nameless struct/union #pragma warning( disable : 4324 ) // disable: 4324 structure was padded due to __declspec(align()) #else // !_MSC_VER #include #include #include typedef int8_t int8; typedef int16_t int16; typedef int32_t int32; typedef int64_t int64; typedef uint8_t byte; typedef uint16_t uint16; typedef uint32_t uint32; typedef uint64_t uint64; #define LL(x) x##ULL #if UCHAR_MAX != 0xffU #error UCHAR_MAX != 0xff #endif #define __int8 char #if USHRT_MAX != 0xffffU #error USHRT_MAX != 0xffff #endif #define __int16 short #if UINT_MAX != 0xffffffffU #error UINT_MAX != 0xffffffff #endif #define __int32 int typedef uint64 TC_LARGEST_COMPILER_UINT; #define BOOL int #ifndef FALSE #define FALSE 0 #define TRUE 1 #endif #endif // !_MSC_VER #define TC_INT_TYPES_DEFINED // Integer types required by Cryptolib typedef unsigned __int8 uint_8t; typedef unsigned __int16 uint_16t; typedef unsigned __int32 uint_32t; #ifndef TC_NO_COMPILER_INT64 typedef uint64 uint_64t; #endif typedef union { struct { unsigned __int32 LowPart; unsigned __int32 HighPart; }; #ifndef TC_NO_COMPILER_INT64 uint64 Value; #endif } UINT64_STRUCT; #ifndef __has_builtin // Optional of course #define __has_builtin(x) 0 // Compatibility with non-clang compilers #endif #if defined(_UEFI) typedef UINTN size_t; typedef uint64 uint_64t; typedef CHAR16 wchar_t; typedef int LONG; #define wcscpy StrCpy #define wcslen StrLen #define wcscmp StrCmp #define wcscat StrCat #define memcpy(dest,source,count) CopyMem(dest,source,(UINTN)(count)) #define memset(dest,ch,count) SetMem(dest,(UINTN)(count),(UINT8)(ch)) #define memchr(buf,ch,count) ScanMem8(buf,(UINTN)(count),(UINT8)ch) #define memcmp(buf1,buf2,count) (int)(CompareMem(buf1,buf2,(UINTN)(count))) #define MAX_STRING_SIZE 0x1000 #define strcat(strDest,strSource) AsciiStrCatS(strDest,MAX_STRING_SIZE,strSource) #define strchr(str,ch) ScanMem8((VOID *)(str),AsciiStrSize(str),(UINT8)ch) #define strcmp
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>VeraCrypt - Free Open source disk encryption with strong security for the Paranoid</title>
<meta name="description" content="VeraCrypt is free open-source disk encryption software for Windows, Mac OS X and Linux. In case an attacker forces you to reveal the password, VeraCrypt provides plausible deniability. In contrast to file encryption, data encryption performed by VeraCrypt is real-time (on-the-fly), automatic, transparent, needs very little memory, and does not involve temporary unencrypted files."/>
<meta name="keywords" content="encryption, security"/>
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<body>

<div>
<a href="Documentation.html"><img src="VeraCrypt128x128.png" alt="VeraCrypt"/></a>
</div>

<div id="menu">
	<ul>
	  <li><a href="Home.html">Home</a></li>
	  <li><a href="/code/">Source Code</a></li>
	  <li><a href="Downloads.html">Downloads</a></li>
	  <li><a class="active" href="Documentation.html">Documentation</a></li>
	  <li><a href="Donation.html">Donate</a></li>
	  <li><a href="https://sourceforge.net/p/veracrypt/discussion/" target="_blank">Forums</a></li>
	</ul>
</div>

<div>
<p>
<a href="Documentation.html">Documentation</a>
<img src="arrow_right.gif" alt=">>" style="margin-top: 5px">
<a href="Technical%20Details.html">Technical Details</a>
<img src="arrow_right.gif" alt=">>" style="margin-top: 5px">
<a href="CompilingGuidelines.html">Building VeraCrypt From Source</a>
</p></div>

<div class="wikidoc">
<h1>Building VeraCrypt From Source</h1>
<p>In order to build VeraCrypt from the source code, you can follow these step-by-step guidelines:
<ul style="text-align:left; margin-top:18px; margin-bottom:19px; padding-top:0px; padding-bottom:0px">
<li style="text-align:left; margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px">
<a href="CompilingGuidelineWin.html" style="text-align:left; color:#0080c0; text-decoration:none.html">Windows Build Guide</a>
</li><li style="text-align:left; margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px">
<a href="CompilingGuidelineLinux.html" style="text-align:left; color:#0080c0; text-decoration:none.html">Linux Build Guide</a>
</li></ul>
</p>
</div><div class="ClearBoth"></div></body></html>