Skip to content

Commit 22bc6b6

Browse files
committed
MSVC & SHA512 extension support
1 parent 51511d1 commit 22bc6b6

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/hashes/sha2/sha512_x86.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ static int LTC_SHA512_TARGET s_sha512_x86_compress(hash_state * md, const unsign
345345
state_b = ltc_mm256_blend_epi64(tmp_c, tmp_d, ltc_blend_epi64_k(0x1, 0x1, 0x0, 0x0));
346346
_mm256_storeu_si256(((__m256i*)(&md->sha512.state[0])), state_a);
347347
_mm256_storeu_si256(((__m256i*)(&md->sha512.state[4])), state_b);
348-
return CRYPT_OK;
348+
return CRYPT_OK;
349349

350350
#undef ltc_permute_epi64_k
351351
#undef ltc_blend_epi32_k

src/headers/tomcrypt_cfg.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,10 @@ typedef unsigned long ltc_mp_digit;
342342
#define LTC_SHA256_X86
343343
#endif
344344
#endif
345-
/* the SHA512 extension intrinsics require GCC 14 resp. clang 17 (MSVC doesn't support them yet) */
345+
/* the SHA512 extension intrinsics require GCC 14 resp. clang 17 */
346346
#if (defined __GNUC__ && !defined __clang__ && (__GNUC__ >= 14)) || \
347-
(defined __clang__ && (__clang_major__ >= 17))
347+
(defined __clang__ && (__clang_major__ >= 17)) || \
348+
(defined _MSC_FULL_VER && (_MSC_FULL_VER) >= 194033813l) /* MSVC 2022 17.10 */
348349
#if !defined(LTC_NO_SHA384_X86)
349350
#define LTC_SHA384_X86
350351
#endif

0 commit comments

Comments
 (0)