diff options
author | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2024-05-14 00:00:00 +0000 |
---|---|---|
committer | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2024-05-15 23:55:04 +0500 |
commit | fc662341e6f85da78ada0e443f6116b978f79f22 (patch) | |
tree | 1be1cc402a7a9cbc18d4eeea6b141354c2d559e3 /C/Sha1.c | |
parent | 5b39dc76f1bc82f941d5c800ab9f34407a06b53a (diff) | |
download | 7zip-fc662341e6f85da78ada0e443f6116b978f79f22.tar.gz 7zip-fc662341e6f85da78ada0e443f6116b978f79f22.tar.bz2 7zip-fc662341e6f85da78ada0e443f6116b978f79f22.zip |
24.0524.05
Diffstat (limited to 'C/Sha1.c')
-rw-r--r-- | C/Sha1.c | 52 |
1 files changed, 26 insertions, 26 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* Sha1.c -- SHA-1 Hash | 1 | /* Sha1.c -- SHA-1 Hash |
2 | 2023-04-02 : Igor Pavlov : Public domain | 2 | 2024-03-01 : Igor Pavlov : Public domain |
3 | This code is based on public domain code of Steve Reid from Wei Dai's Crypto++ library. */ | 3 | This code is based on public domain code of Steve Reid from Wei Dai's Crypto++ library. */ |
4 | 4 | ||
5 | #include "Precomp.h" | 5 | #include "Precomp.h" |
@@ -15,35 +15,35 @@ This code is based on public domain code of Steve Reid from Wei Dai's Crypto++ l | |||
15 | #endif | 15 | #endif |
16 | 16 | ||
17 | #ifdef MY_CPU_X86_OR_AMD64 | 17 | #ifdef MY_CPU_X86_OR_AMD64 |
18 | #ifdef _MSC_VER | 18 | #if defined(Z7_LLVM_CLANG_VERSION) && (Z7_LLVM_CLANG_VERSION >= 30800) \ |
19 | #if _MSC_VER >= 1200 | 19 | || defined(Z7_APPLE_CLANG_VERSION) && (Z7_APPLE_CLANG_VERSION >= 50100) \ |
20 | || defined(Z7_GCC_VERSION) && (Z7_GCC_VERSION >= 40900) \ | ||
21 | || defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1600) \ | ||
22 | || defined(_MSC_VER) && (_MSC_VER >= 1200) | ||
20 | #define Z7_COMPILER_SHA1_SUPPORTED | 23 | #define Z7_COMPILER_SHA1_SUPPORTED |
21 | #endif | ||
22 | #elif defined(__clang__) | ||
23 | #if (__clang_major__ >= 8) // fix that check | ||
24 | #define Z7_COMPILER_SHA1_SUPPORTED | ||
25 | #endif | ||
26 | #elif defined(__GNUC__) | ||
27 | #if (__GNUC__ >= 8) // fix that check | ||
28 | #define Z7_COMPILER_SHA1_SUPPORTED | ||
29 | #endif | ||
30 | #elif defined(__INTEL_COMPILER) | ||
31 | #if (__INTEL_COMPILER >= 1800) // fix that check | ||
32 | #define Z7_COMPILER_SHA1_SUPPORTED | ||
33 | #endif | ||
34 | #endif | 24 | #endif |
35 | #elif defined(MY_CPU_ARM_OR_ARM64) | 25 | #elif defined(MY_CPU_ARM_OR_ARM64) && defined(MY_CPU_LE) \ |
36 | #ifdef _MSC_VER | 26 | && (!defined(Z7_MSC_VER_ORIGINAL) || (_MSC_VER >= 1929) && (_MSC_FULL_VER >= 192930037)) |
37 | #if _MSC_VER >= 1910 && _MSC_VER >= 1929 && _MSC_FULL_VER >= 192930037 | 27 | #if defined(__ARM_FEATURE_SHA2) \ |
28 | || defined(__ARM_FEATURE_CRYPTO) | ||
29 | #define Z7_COMPILER_SHA1_SUPPORTED | ||
30 | #else | ||
31 | #if defined(MY_CPU_ARM64) \ | ||
32 | || defined(__ARM_ARCH) && (__ARM_ARCH >= 4) \ | ||
33 | || defined(Z7_MSC_VER_ORIGINAL) | ||
34 | #if defined(__ARM_FP) && \ | ||
35 | ( defined(Z7_CLANG_VERSION) && (Z7_CLANG_VERSION >= 30800) \ | ||
36 | || defined(__GNUC__) && (__GNUC__ >= 6) \ | ||
37 | ) \ | ||
38 | || defined(Z7_MSC_VER_ORIGINAL) && (_MSC_VER >= 1910) | ||
39 | #if defined(MY_CPU_ARM64) \ | ||
40 | || !defined(Z7_CLANG_VERSION) \ | ||
41 | || defined(__ARM_NEON) && \ | ||
42 | (Z7_CLANG_VERSION < 170000 || \ | ||
43 | Z7_CLANG_VERSION > 170001) | ||
38 | #define Z7_COMPILER_SHA1_SUPPORTED | 44 | #define Z7_COMPILER_SHA1_SUPPORTED |
39 | #endif | 45 | #endif |
40 | #elif defined(__clang__) | ||
41 | #if (__clang_major__ >= 8) // fix that check | ||
42 | #define Z7_COMPILER_SHA1_SUPPORTED | ||
43 | #endif | 46 | #endif |
44 | #elif defined(__GNUC__) | ||
45 | #if (__GNUC__ >= 6) // fix that check | ||
46 | #define Z7_COMPILER_SHA1_SUPPORTED | ||
47 | #endif | 47 | #endif |
48 | #endif | 48 | #endif |
49 | #endif | 49 | #endif |
@@ -436,7 +436,7 @@ void Sha1Prepare(void) | |||
436 | #endif | 436 | #endif |
437 | { | 437 | { |
438 | // printf("\n========== HW SHA1 ======== \n"); | 438 | // printf("\n========== HW SHA1 ======== \n"); |
439 | #if defined(MY_CPU_ARM_OR_ARM64) && defined(_MSC_VER) | 439 | #if 0 && defined(MY_CPU_ARM_OR_ARM64) && defined(_MSC_VER) |
440 | /* there was bug in MSVC compiler for ARM64 -O2 before version VS2019 16.10 (19.29.30037). | 440 | /* there was bug in MSVC compiler for ARM64 -O2 before version VS2019 16.10 (19.29.30037). |
441 | It generated incorrect SHA-1 code. | 441 | It generated incorrect SHA-1 code. |
442 | 21.03 : we test sha1-hardware code at runtime initialization */ | 442 | 21.03 : we test sha1-hardware code at runtime initialization */ |