summaryrefslogtreecommitdiff
path: root/sha_simd.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2018-11-22 22:41:56 -0500
committerJeffrey Walton <noloader@gmail.com>2018-11-22 22:41:56 -0500
commitbc63a78b69eff6a823e939ec1b76012db296b98f (patch)
tree078a7ea7edfd1a8969c4534203c21bd4a128a5c7 /sha_simd.cpp
parent2b5bea7b126072b27e7e04a00e46f9f99e9c0e08 (diff)
downloadcryptopp-git-bc63a78b69eff6a823e939ec1b76012db296b98f.tar.gz
Move Power8 SHA tests into ppc_power8.cpp
Diffstat (limited to 'sha_simd.cpp')
-rw-r--r--sha_simd.cpp90
1 files changed, 0 insertions, 90 deletions
diff --git a/sha_simd.cpp b/sha_simd.cpp
index 2795c41a..497d9f92 100644
--- a/sha_simd.cpp
+++ b/sha_simd.cpp
@@ -197,96 +197,6 @@ bool CPU_ProbeSHA2()
}
#endif // ARM32 or ARM64
-#if (CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64)
-bool CPU_ProbeSHA256()
-{
-#if defined(CRYPTOPP_NO_CPU_FEATURE_PROBES)
- return false;
-#elif (CRYPTOPP_POWER8_AVAILABLE)
-# if defined(CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY)
-
- // longjmp and clobber warnings. Volatile is required.
- // http://github.com/weidai11/cryptopp/issues/24 and http://stackoverflow.com/q/7721854
- volatile int result = false;
-
- volatile SigHandler oldHandler = signal(SIGILL, SigIllHandler);
- if (oldHandler == SIG_ERR)
- return false;
-
- volatile sigset_t oldMask;
- if (sigprocmask(0, NULLPTR, (sigset_t*)&oldMask))
- return false;
-
- if (setjmp(s_jmpSIGILL))
- result = false;
- else
- {
- byte r[16], z[16] = {0};
- uint8x16_p x = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-
- x = VecSHA256<0,0>(x);
- x = VecSHA256<0,1>(x);
- x = VecSHA256<1,0>(x);
- x = VecSHA256<1,1>(x);
- VecStore(x, r);
-
- result = (0 == std::memcmp(r, z, 16));
- }
-
- sigprocmask(SIG_SETMASK, (sigset_t*)&oldMask, NULLPTR);
- signal(SIGILL, oldHandler);
- return result;
-# endif
-#else
- return false;
-#endif // CRYPTOPP_ALTIVEC_AVAILABLE
-}
-
-bool CPU_ProbeSHA512()
-{
-#if defined(CRYPTOPP_NO_CPU_FEATURE_PROBES)
- return false;
-#elif (CRYPTOPP_POWER8_AVAILABLE)
-# if defined(CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY)
-
- // longjmp and clobber warnings. Volatile is required.
- // http://github.com/weidai11/cryptopp/issues/24 and http://stackoverflow.com/q/7721854
- volatile int result = false;
-
- volatile SigHandler oldHandler = signal(SIGILL, SigIllHandler);
- if (oldHandler == SIG_ERR)
- return false;
-
- volatile sigset_t oldMask;
- if (sigprocmask(0, NULLPTR, (sigset_t*)&oldMask))
- return false;
-
- if (setjmp(s_jmpSIGILL))
- result = false;
- else
- {
- byte r[16], z[16] = {0};
- uint8x16_p x = ((uint8x16_p){0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0});
-
- x = VecSHA512<0,0>(x);
- x = VecSHA512<0,1>(x);
- x = VecSHA512<1,0>(x);
- x = VecSHA512<1,1>(x);
- VecStore(x, r);
-
- result = (0 == std::memcmp(r, z, 16));
- }
-
- sigprocmask(SIG_SETMASK, (sigset_t*)&oldMask, NULLPTR);
- signal(SIGILL, oldHandler);
- return result;
-# endif
-#else
- return false;
-#endif // CRYPTOPP_POWER8_AVAILABLE
-}
-#endif // PPC32 or PPC64
-
// ***************** Intel x86 SHA ********************
/////////////////////////////////////