VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Crypto
AgeCommit message (Collapse)AuthorFilesLines
2023-08-06Linux/macOS: Add explicit include of <sys/types.h> to define ssize_tMounir IDRASSI1-0/+2
Some systems (e.g. Alpine Linux) seems to require this.
2023-08-04fix warnings and UB (#1164)kovalev02-2/+2
* 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-07-18Windows: Fix compiler warningsMounir IDRASSI1-1/+0
2023-06-30Correctly detect ARM builds when listing CPU features in headersMounir IDRASSI1-4/+4
2023-06-13Crypto: Fix detection of SSSE3 intrinsics in compilerMounir IDRASSI1-1/+1
We use correct define CRYPTOPP_BOOL_SSSE3_INTRINSICS_AVAILABLE
2023-05-26Windows: Add missing Blake2s source files to VS 2019 crypto projectMounir IDRASSI1-0/+3
2022-08-21Fixed a typo error (#929)Matteo Baccan1-1/+1
Hi I have fixed a little typo error: a double semicolon at the end of one line ciao matteo
2022-03-26Windows: Add various checks to address Coverity reported issues.Mounir IDRASSI1-2/+2
2022-03-26Remove dead code from chacha_ECRYPT_encrypt_bytes (Coverity)Mounir IDRASSI1-15/+8
2022-03-21Add missing Blake2s source filesMounir IDRASSI10-0/+1474
2022-03-08Implement support of Blake2s-256 hash algorithm and remove deprecated ↵Mounir IDRASSI12-1410/+47
algorithms RIPEMD-160 and GOST89.
2022-02-13Linux/FreeBSD: Enable building without AESNI support by setting environment ↵Mounir IDRASSI2-0/+4
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-30Windows: Fix some VS static analyzed warningsMounir IDRASSI1-1/+1
2021-08-16MacOSX: Make AESNI availability linked to compiler target and not ↵Mounir IDRASSI1-0/+1
compilation host
2021-07-13Windows: Fix compilation error on ARM64 caused by definition of UINT64_MAXMounir IDRASSI1-1/+1
2021-01-02Windows: Add support for ARM64 platform (e.g. Microsoft Surface Pro X). ↵Mounir IDRASSI6-2/+659
System encryption still not implemented on ARM64
2020-12-11Windows Driver: Fix build error using Windows 10 WDK caused by name conflict ↵Mounir IDRASSI1-4/+4
for KeSaveExtendedProcessorState/KeRestoreExtendedProcessorState functions
2020-12-11Crypto: small speed optimization of Streebog and removal of unused macroMounir IDRASSI1-35/+17
2020-07-25Remove unused variable in Streebog implementationMounir IDRASSI1-97/+0
2020-07-15Enable FIPS mode in JitterEntropy random generator in order to let the ↵Mounir IDRASSI1-1/+1
function jent_read_entropy report failure if any of the continuous statistical tests fail.
2020-06-26Whirlpool: Remove unused "num" variable affectation in WHIRLPOOL_addMounir IDRASSI1-1/+0
2020-06-25Crypto: Fix random crash in Streebog in 32-bit, caused by use of aligned ↵Mounir IDRASSI1-8/+8
SSE2 instructions _mm_load_si128. Now we use _mm_loadu_si128 instead which is not slower than _mm_load_si128 on recent CPUs
2020-06-19Windows: remove duplicated function to detect AES-NI support in CPUMounir IDRASSI2-22/+2
2019-12-09Fix wrong check on the define CRYPTOPP_BOOL_X64Mounir IDRASSI1-1/+1
2019-12-09Linux/MacOSX: use x64 optimized SHA256 implementation instead of limiting it ↵Mounir IDRASSI1-1/+1
to Windows.
2019-12-09Add burn calls for temporary ss variable (#569)Hanno Böck1-0/+13
2019-12-09Linux: fix NOASM compilation (#563) (#568)alt3r 3go6-10/+10
Signed-off-by: alt3r 3go <alt3r.3go@protonmail.com>
2019-11-09Windows: include rdrand.h file only in Windows case since it is not yet ↵Mounir IDRASSI1-0/+2
included for other OSes
2019-11-07Windows: fix driver build error caused by missing headerMounir IDRASSI1-0/+5
2019-11-03Linux/MacOSX: Fix build error caused by RDRAND_getBytes/RDSEED_getBytes ↵Mounir IDRASSI1-1/+1
implemented only on Windows
2019-11-02Windows: when building for EFI bootloader, don't make calls to RDRAND/RDSEED ↵Mounir IDRASSI1-1/+2
functions since we don't link against their implementation in EFI bootloader
2019-10-30Update Jitterentropy Library to version 2.2.0Mounir IDRASSI3-183/+331
2019-10-30Disable both RDRAND and RDSEED if a failure is detectedMounir IDRASSI1-0/+13
2019-10-30Add check for buggy RDRAND (AMD Ryzen CPU case) even if we always use RDSEED ↵Mounir IDRASSI1-0/+13
instead of RDRAND when RDSEED is available (which is the case on modern CPUs)
2019-10-30Windows: use separate assembly files for RDRAND and RDSEED in order to fix a ↵Mounir IDRASSI6-228/+291
mysterious crash when MASM_RDSEED_GenerateBlock is called after MASM_RDRAND_GenerateBlock.
2019-10-29Fix wrong detection of AMD CPUs.Mounir IDRASSI1-2/+2
2019-10-28Linux: Fix compilation error on non-x86 platform by providing generic ↵Mounir IDRASSI1-0/+25
implementation for jent_get_nstime function
2019-10-28Linux: Fix compilation error if type __u64 is already defined by gccMounir IDRASSI1-5/+3
This is the case with Mageia Cauldron which has gcc 9.2.1
2019-10-24Linux/MacOSX: Better approach to avoid that jitterentropy code is optimized ↵Mounir IDRASSI1-1/+5
by the compiler
2019-10-23Linux/MacOSX: Add missing JitterEntropy implementationMounir IDRASSI1-4/+13
2019-10-17Linux: Workaround for gcc 4.4.7 bug under CentOS 6 that causes VeraCrypt ↵Mounir IDRASSI1-0/+14
built under CentOS 6 to crash when Whirlpool hash is used.
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-10-02Align section types of Whirlpool_C and SHA256_K (#479)Hans-Peter Jansen1-1/+1
in order to fix LTO linking. After switching to LTO for openSUSE Tumbleweed, veracrypt build failed with: [ 185s] ../Crypto/Whirlpool.c:105:45: error: 'Whirlpool_C' causes a section type conflict with 'SHA256_K' [ 185s] 105 | CRYPTOPP_ALIGN_DATA(16) static const uint64 Whirlpool_C[8*256+R] CRYPTOPP_SECTION_ALIGN16 = { [ 185s] | ^ [ 185s] ../Crypto/Sha2.c:321:34: note: 'SHA256_K' was declared here [ 185s] 321 | CRYPTOPP_ALIGN_DATA(16) uint_32t SHA256_K[64] CRYPTOPP_SECTION_ALIGN16 = { [ 185s] | ^ [ 185s] lto-wrapper: fatal error: g++ returned 1 exit status Aligning section types of Whirlpool_C and SHA256_K fixes this.
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-03-02Windows: Generalize RAM encryption for keys to VeraCrypt binaries, ↵Mounir IDRASSI2-0/+24
especially Format and Expander
2019-03-01Windows: Implement RAM encryption for keys on 64-bit machines using ChaCha12 ↵Mounir IDRASSI7-0/+1852
cipher and t1ha non-cryptographic fast hash (https://github.com/leo-yuriev/t1ha)
2019-02-12Windows: Use Hardware RNG based on CPU timing jitter "Jitterentropy" by ↵Mounir IDRASSI8-4/+1038
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 IDRASSI12-4/+929
driver need of random bytes (currently only wipe bytes but more to come later).
2019-02-01Windows: use CPU RDRAND or RDSEED as an additional entropy source for our ↵Mounir IDRASSI7-0/+519
random generator when available
929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485