VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Crypto/cpu.h
AgeCommit message (Collapse)AuthorFilesLines
2023-11-13wolfCrypt as crypto backend for VeraCrypt (#1227)lealem471-1/+1
* wolfCrypt as crypto backend for VeraCrypt * Refactor to use EncryptionModeWolfCryptXTS class
2023-08-04fix warnings and UB (#1164)kovalev01-1/+1
* Crypto: fix warning mismatched bound ../Crypto/cpu.c:67:32: warning: argument 2 of type 'uint32[4]' {aka 'unsigned int[4]'} with mismatched bound [-Warray-parameter=] 67 | int CpuId(uint32 input, uint32 output[4]) | ~~~~~~~^~~~~~~~~ In file included from ../Crypto/cpu.c:3: ../Crypto/cpu.h:236:33: note: previously declared as 'uint32 *' {aka 'unsigned int *'} 236 | int CpuId(uint32 input, uint32 *output); Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org> * Core/Unix: fix warning ignoring return value Unix/CoreUnix.cpp: In member function 'virtual std::shared_ptr<VeraCrypt:\ :VolumeInfo> VeraCrypt::CoreUnix::MountVolume(VeraCrypt::MountOptions&)': Unix/CoreUnix.cpp:682:55: warning: ignoring return value of 'int chown(const char*, __uid_t, __gid_t)' declared with attribute 'warn_unused_result' [-Wunused-result] 682 | chown (mountPoint.c_str(), GetRealUserId(), GetRealGroupId()); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org> * Main/Forms: fix warning cast to pointer from integer of different size Forms/MainFrame.cpp: In member function 'void VeraCrypt::MainFrame:\ :UpdateVolumeList()': Forms/MainFrame.cpp:1718:106: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 1718 | Gui->InsertToListCtrl (SlotListCtrl, ++prevItemIndex, fields, 0, (void *) volume->SlotNumber); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ Forms/MainFrame.cpp:1753:114: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 1753 | Gui->InsertToListCtrl (SlotListCtrl, ++prevItemIndex, fields, 0, (void *) slotNumber); | ^~~~~~~~~~~~~~~~~~~ Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org> * Crypto: fix undefined behavior signed integer overflow In function 'twofish_set_key': cc1: warning: iteration 4 invokes undefined behavior [-Waggressive-loop-optimizations] ../Crypto/Twofish.c:626:23: note: within this loop 626 | for (i = 0; i != 40; i += 2) | ~~^~~~~ Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org> --------- Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org> Co-authored-by: Vasiliy Kovalev <kovalev@altlinux.org>
2023-06-13Crypto: Fix detection of SSSE3 intrinsics in compilerMounir IDRASSI1-1/+1
We use correct define CRYPTOPP_BOOL_SSSE3_INTRINSICS_AVAILABLE
2022-03-08Implement support of Blake2s-256 hash algorithm and remove deprecated ↵Mounir IDRASSI1-3/+8
algorithms RIPEMD-160 and GOST89.
2022-02-13Linux/FreeBSD: Enable building without AESNI support by setting environment ↵Mounir IDRASSI1-0/+2
variable DISABLE_AESNI to 1 during build or passing NOAESNI=1 to make command This comes following Github issue #892 and which should be solved thanks to this.
2021-08-16MacOSX: Make AESNI availability linked to compiler target and not ↵Mounir IDRASSI1-0/+1
compilation host
2021-01-02Windows: Add support for ARM64 platform (e.g. Microsoft Surface Pro X). ↵Mounir IDRASSI1-0/+24
System encryption still not implemented on ARM64
2019-10-04Fix "error "SSSE3 instruction set not enabled" when compiling using GCC ↵El Mostafa Idrassi1-0/+2
version < 4.9 without -mssse3 option (SSSE3=1 when using make). (#507) Compiling with -mxxx defines the corresponding macro of the intrinsics. For example, -mssse3 defines __SSSE3__ macro to 1. In GCC versions < 4.9, it is not possible to use and call x86 intrinsics only at runtime without compiling the entire file with the -mxxx option. For example, if we want to call SSSE3 intrinsics without compiling with -mssse3, the macro __SSSE3__ is not defined. Therefore, when including <tmmintrin.h>, this results in "error "SSSE3 instruction set not enabled"" because of : #ifndef __SSSE3__ # error "SSSE3 instruction set not enabled" Since GCC 4.9, this has been fixed and it is possible to call x86 intrinsics from select functions in a file that are tagged with the corresponding target attribute without having to compile the entire file with the -mxxx option. This can be seen in <tmmintrin.h> which in recent versions (>= 4.9) contains : #ifndef __SSSE3__ #pragma GCC push_options #pragma GCC target("ssse3") #define __DISABLE_SSSE3__ Since SSSE3 is only used under Windows for ChaCha256, this can be fixed by preceding '#include <tmmintrin.h>' with #if defined (_MSC_VER) && !defined (TC_WINDOWS_BOOT). See https://gcc.gnu.org/gcc-4.9/changes.html
2019-08-26Windows: fix compilation error of legacy MBR bootloader caused by missing ↵Mounir IDRASSI1-1/+1
intrin.h header
2019-03-21Linux: Fix compilation error caused by wrong include of "intrin.h"Mounir IDRASSI1-3/+1
2019-02-12Windows: Use Hardware RNG based on CPU timing jitter "Jitterentropy" by ↵Mounir IDRASSI1-0/+17
Stephan Mueller as a good alternative to RDRAND (http://www.chronox.de/jent.html, smueller@chronox.de)
2019-02-08Windows: Add implementation of ChaCha20 based random generator. Use it for ↵Mounir IDRASSI1-3/+7
driver need of random bytes (currently only wipe bytes but more to come later).
2019-02-01Fix detection of CPU features AVX2 & BMI2. Add detection of RDRAND & RDSEED ↵Mounir IDRASSI1-0/+4
CPU features. Detect Hygon CPU as AMD one.
2019-01-30Help compiler optimize some crypto code on 64-bit build since x64 capable ↵Mounir IDRASSI1-0/+5
CPUs always support SSE and SSE2
2017-07-04Windows: correctly handle SEH exceptions during self-tests in order to ↵Mounir IDRASSI1-26/+19
disable CPU extended features in such case.
2017-06-21Crypto: Add optimized Camellia assembly implementation for x86_64 based on ↵Mounir IDRASSI1-0/+4
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-01-12Fix build error in Crypto/Whirpool.c when using LLVM Clang compiler by ↵Mounir IDRASSI1-29/+24
disabling inline assembly in this case (caused by http://llvm.org/bugs/show_bug.cgi?id=24232)
2016-10-17Implement detection of new CPU features: AVX2 and BMI2Mounir IDRASSI1-0/+4
2016-10-17Crypto: Use SIMD optimized Serpent implementation from Botan. 2.5x speed ↵Mounir IDRASSI1-0/+38
gain factor. Update credits and copyrights notice.
2016-08-15Windows EFI Bootloader: modifications to prepare EFI system encryption ↵Alex1-4/+4
support (common files with DcsBoot)
2016-06-20Windows:solve compilation error under VC++ 2008 by using extern "C" only ↵Mounir IDRASSI1-8/+32
when needed.
2016-06-18Windows Driver: add declaration of missing intrinsic _mm_setr_epi32 (to be ↵Mounir IDRASSI1-0/+1
used by upcoming implementation)
2016-06-17Update intrinsic support and cpu detection.Mounir IDRASSI1-14/+80
2016-05-10Remove trailing whitespaceDavid Foerster1-1/+1
2016-05-10Normalize all line terminatorsDavid Foerster1-308/+308
2016-05-01Reset bogus executable permissionsDavid Foerster1-0/+0
2016-02-21Crypto: update Whirlpool implementation using latest code from Crypto++.Mounir IDRASSI1-18/+68
2015-12-31Cryptography: Optimize Whirlpool implementation by using public domain ↵Mounir IDRASSI1-0/+258
assembly code developed by Wei Dai