Update documentation
parent
ad58f0cbdc
commit
a4dc4e2237
24
ppc_simd.h
24
ppc_simd.h
|
|
@ -1351,24 +1351,24 @@ inline T1 VecDecryptLast(const T1 state, const T2 key)
|
||||||
|
|
||||||
/// \brief SHA256 Sigma functions
|
/// \brief SHA256 Sigma functions
|
||||||
/// \tparam func function
|
/// \tparam func function
|
||||||
/// \tparam subfunc sub-function
|
/// \tparam fmask function mask
|
||||||
/// \tparam T vector type
|
/// \tparam T vector type
|
||||||
/// \param vec the block to transform
|
/// \param vec the block to transform
|
||||||
/// \details VecSHA256 selects sigma0, sigma1, Sigma0, Sigma1 based on
|
/// \details VecSHA256 selects sigma0, sigma1, Sigma0, Sigma1 based on
|
||||||
/// func and subfunc. The return vector is the same type as vec.
|
/// func and fmask. The return vector is the same type as vec.
|
||||||
/// \details VecSHA256 is available on POWER8 and above.
|
/// \details VecSHA256 is available on POWER8 and above.
|
||||||
/// \par Wraps
|
/// \par Wraps
|
||||||
/// __vshasigmaw, __builtin_altivec_crypto_vshasigmaw, __builtin_crypto_vshasigmaw
|
/// __vshasigmaw, __builtin_altivec_crypto_vshasigmaw, __builtin_crypto_vshasigmaw
|
||||||
/// \since GCC and XLC since Crypto++ 6.0, LLVM Clang since Crypto++ 8.0
|
/// \since GCC and XLC since Crypto++ 6.0, LLVM Clang since Crypto++ 8.0
|
||||||
template <int func, int subfunc, class T>
|
template <int func, int fmask, class T>
|
||||||
inline T VecSHA256(const T vec)
|
inline T VecSHA256(const T vec)
|
||||||
{
|
{
|
||||||
#if defined(__ibmxl__) || (defined(_AIX) && defined(__xlC__))
|
#if defined(__ibmxl__) || (defined(_AIX) && defined(__xlC__))
|
||||||
return (T)__vshasigmaw((uint32x4_p)vec, func, subfunc);
|
return (T)__vshasigmaw((uint32x4_p)vec, func, fmask);
|
||||||
#elif defined(__clang__)
|
#elif defined(__clang__)
|
||||||
return (T)__builtin_altivec_crypto_vshasigmaw((uint32x4_p)vec, func, subfunc);
|
return (T)__builtin_altivec_crypto_vshasigmaw((uint32x4_p)vec, func, fmask);
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
return (T)__builtin_crypto_vshasigmaw((uint32x4_p)vec, func, subfunc);
|
return (T)__builtin_crypto_vshasigmaw((uint32x4_p)vec, func, fmask);
|
||||||
#else
|
#else
|
||||||
CRYPTOPP_ASSERT(0);
|
CRYPTOPP_ASSERT(0);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -1376,24 +1376,24 @@ inline T VecSHA256(const T vec)
|
||||||
|
|
||||||
/// \brief SHA512 Sigma functions
|
/// \brief SHA512 Sigma functions
|
||||||
/// \tparam func function
|
/// \tparam func function
|
||||||
/// \tparam subfunc sub-function
|
/// \tparam fmask function mask
|
||||||
/// \tparam T vector type
|
/// \tparam T vector type
|
||||||
/// \param vec the block to transform
|
/// \param vec the block to transform
|
||||||
/// \details VecSHA512 selects sigma0, sigma1, Sigma0, Sigma1 based on
|
/// \details VecSHA512 selects sigma0, sigma1, Sigma0, Sigma1 based on
|
||||||
/// func and subfunc. The return vector is the same type as vec.
|
/// func and fmask. The return vector is the same type as vec.
|
||||||
/// \details VecSHA512 is available on POWER8 and above.
|
/// \details VecSHA512 is available on POWER8 and above.
|
||||||
/// \par Wraps
|
/// \par Wraps
|
||||||
/// __vshasigmad, __builtin_altivec_crypto_vshasigmad, __builtin_crypto_vshasigmad
|
/// __vshasigmad, __builtin_altivec_crypto_vshasigmad, __builtin_crypto_vshasigmad
|
||||||
/// \since GCC and XLC since Crypto++ 6.0, LLVM Clang since Crypto++ 8.0
|
/// \since GCC and XLC since Crypto++ 6.0, LLVM Clang since Crypto++ 8.0
|
||||||
template <int func, int subfunc, class T>
|
template <int func, int fmask, class T>
|
||||||
inline T VecSHA512(const T vec)
|
inline T VecSHA512(const T vec)
|
||||||
{
|
{
|
||||||
#if defined(__ibmxl__) || (defined(_AIX) && defined(__xlC__))
|
#if defined(__ibmxl__) || (defined(_AIX) && defined(__xlC__))
|
||||||
return (T)__vshasigmad((uint64x2_p)vec, func, subfunc);
|
return (T)__vshasigmad((uint64x2_p)vec, func, fmask);
|
||||||
#elif defined(__clang__)
|
#elif defined(__clang__)
|
||||||
return (T)__builtin_altivec_crypto_vshasigmad((uint64x2_p)vec, func, subfunc);
|
return (T)__builtin_altivec_crypto_vshasigmad((uint64x2_p)vec, func, fmask);
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
return (T)__builtin_crypto_vshasigmad((uint64x2_p)vec, func, subfunc);
|
return (T)__builtin_crypto_vshasigmad((uint64x2_p)vec, func, fmask);
|
||||||
#else
|
#else
|
||||||
CRYPTOPP_ASSERT(0);
|
CRYPTOPP_ASSERT(0);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue