VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Crypto
AgeCommit message (Collapse)AuthorFilesLines
2018-08-06crypto: cleaner code for Streebog carry bit handling and add comment about ↵Mounir IDRASSI1-5/+24
missing handling of overflow caused by carry bit.
2017-11-27SIMD speed optimization for Kuznyechik cipher implementation (up to 2x ↵Mounir IDRASSI6-166/+9755
speedup). Based on https://github.com/aprelev/libgost15.
2017-07-19Windows MBR bootloader: reduce required stack size for cascade bootloader by ↵Mounir IDRASSI1-0.highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 Derived from source code of TrueCrypt 7.1a, which is
 Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
 by the TrueCrypt License 3.0.

 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 TC_HEADER_Platform_Finally
#define TC_HEADER_Platform_Finally

#include "PlatformBase.h"

// Execute code when leaving scope
#define finally_do(code) \
struct TC_JOIN(Finally,__LINE__) \
{ \
	TC_JOIN(~Finally,__LINE__) () { try { code } catch (...) { } } \
} \
TC_UNUSED_VAR \
TC_JOIN(finally,__LINE__)

// Execute code with argument 'finally_arg' when leaving scope
#define finally_do_arg(argType, arg, code) \
struct TC_JOIN(Finally,__LINE__) \
{ \
	TC_JOIN(Finally,__LINE__) (argType a) : finally_arg (a) { } \
	TC_JOIN(~Finally,__LINE__) () { try { code } catch (...) { } } \
	argType finally_arg; \
} \
TC_UNUSED_VAR \
TC_JOIN(finally,__LINE__) (arg)

#define finally_do_arg2(argType, arg, argType2, arg2, code) \
struct TC_JOIN(Finally,__LINE__) \
{ \
	TC_JOIN(Finally,__LINE__) (argType a, argType2 a2) : finally_arg (a), finally_arg2 (a2) { } \
	TC_JOIN(~Finally,__LINE__) () { try { code } catch (...) { } } \
	argType finally_arg; \
	argType2 finally_arg2; \
} \
TC_UNUSED_VAR \
TC_JOIN(finally,__LINE__) (arg, arg2)


#endif // TC_HEADER_Platform_Finally
t/src/Crypto?h=VeraCrypt_1.24-Update2&id=79cb3af526e0c1c26f24e0199239e4a1e06d5415'>Windows: use yasm define __YASM__ for compatibility with the assembly ↵
Mounir IDRASSI2-25/+25
changes done in MacOSX.
2017-06-27MacOSX: various changes for assembly files build. Don't use 32-bit assembly ↵Mounir IDRASSI11-25/+19
code of SHA-512 since it is not compatible with PIE configuration of OSX compiler (absolute addressing used)
2017-06-24Linux/MacOSX: properly declare 64-bit constant integer values to avoid being ↵Mounir IDRASSI1-28/+28
truncated by compiler.
2017-06-23Update IDRIX copyright yearMounir IDRASSI2-2/+2
2017-06-23Modify Aes_hw_cpu.asm to use nasm syntax that is compatible with yasm.Mounir IDRASSI1-16/+16
2017-06-23Crypto: Add optimized SHA-512 and SHA-256 assembly implementations for ↵Mounir IDRASSI22-785/+5190
x86_64 and x86. This improves speed by 30%.
2017-06-21Windows: don't use AVX optimized Camellia in EFI bootloader until ↵Mounir IDRASSI1-1/+4
compatibility issues are investigated
2017-06-21Crypto: Add optimized Camellia assembly implementation for x86_64 based on ↵Mounir IDRASSI12-12/+2395
work by Jussi Kivilinna (https://github.com/jkivilin/supercop-blockciphers). This improve speed by a factor of 2.5 when AES-NI supported by CPU and by 30% if AES-NI not supported.
2017-06-21Windows: fix compilation error of assembly files after latest changes on Linux.Mounir IDRASSI2-2/+4
2017-06-13Linux: fix executable stack in resulting binary which was caused by crypto ↵Mounir IDRASSI5-0/+48
assembly files missing the GNU-stack note.
2017-06-05cland static code analyzer fixeskavsrf1-3/+3
2017-05-22Windows Driver: fix "__chkstk" link error in debug build caused by some ↵Mounir IDRASSI3-4/+14
crypto functions using too much stack space for local variables.
2017-01-12Fix build error in Crypto/Whirpool.c when using LLVM Clang compiler by ↵Mounir IDRASSI3-33/+45
disabling inline assembly in this case (caused by http://llvm.org/bugs/show_bug.cgi?id=24232)
2016-12-26Windows: Enable Twofish optimized 64-bit assembly for UEFI bootloader since ↵Mounir IDRASSI2-6/+6
a pre-compiled object file was included to its build system.
2016-12-07Windows: Don't use Twofish x64 assembly implementation for UEFI bootloader ↵Mounir IDRASSI2-7/+7
(for now, yasm is not integrated in EDKII framework).
2016-12-07Windows Bootloader: fix compilation error following Twofish code changes.Mounir IDRASSI1-3/+1
2016-12-07Crypto: remove unnecessary alignment adjusting code in Serpent since the ↵Mounir IDRASSI1-46/+2
SIMD implementation works with unaligned data and gain negligible compared to memcpy overhead.
2016-12-07Crypto: Add optimized Twofish assembly implementation for x86_64.Mounir IDRASSI8-421/+993
2016-10-17Implement detection of new CPU features: AVX2 and BMI2Mounir IDRASSI2-1/+7
2016-10-17Optimize performance of Twofish C implementation.Mounir IDRASSI2-95/+463
2016-10-17Add missing fast Serpent implementation sources.Mounir IDRASSI4-0/+1121
2016-10-17Crypto: Use SIMD optimized Serpent implementation from Botan. 2.5x speed ↵Mounir IDRASSI5-9/+64
gain factor. Update credits and copyrights notice.
2016-10-17Use properly aligned memory in code using Streebog hash implementation that ↵Mounir IDRASSI2-2/+3
uses SSE.
2016-10-17Add test vectors for Kuznyechik and GOST89 (the later is deprecated)Mounir IDRASSI2-24/+20
2016-10-17Crypto: remove specific PBKDF2 optimization for block index encoding (except ↵Mounir IDRASSI1-0/+1
in 16-bit bootloader) in order to make code clearer and avoid bad usage in the future if this implementation is used to generate more bytes than today.
2016-10-17GOST89 parameters swap (6.3)kavsrf2-87/+90
Cached boot password added
2016-08-17MacOSX: fix compiler warning about ALIGN macro being already definedMounir IDRASSI2-16/+16
2016-08-17Linux: fix compilation error on Streebog.c if SSE4.1 not enabled in compilerMounir IDRASSI2-2/+10
2016-08-17Linux: fix various compilation issues under Linux.Mounir IDRASSI10-2321/+2349
2016-08-16Fix compilation error in Streebog code caused by latest changes.Mounir IDRASSI2-2/+2
2016-08-16Windows: Fix various issues detected by static analysis.Mounir IDRASSI4-19/+19
2016-08-15Windows: Add new crypto files to legacy VC++ 2008 project.Mounir IDRASSI1-0/+62
2016-08-15Windows EFI Bootloader: modifications to prepare EFI system encryption ↵Alex7-33/+53
support (common files with DcsBoot)
2016-08-15Windows: Add support for Streebog (hash) and kuznyechik (encryption)Mounir IDRASSI7-0/+4923