Update documentation

pull/748/head
Jeffrey Walton 2018-11-24 02:23:25 -05:00
parent ad58f0cbdc
commit a4dc4e2237
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 12 additions and 12 deletions

View File

@ -1351,24 +1351,24 @@ inline T1 VecDecryptLast(const T1 state, const T2 key)
/// \brief SHA256 Sigma functions
/// \tparam func function
/// \tparam subfunc sub-function
/// \tparam fmask function mask
/// \tparam T vector type
/// \param vec the block to transform
/// \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.
/// \par Wraps
/// __vshasigmaw, __builtin_altivec_crypto_vshasigmaw, __builtin_crypto_vshasigmaw
/// \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)
{
#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__)
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__)
return (T)__builtin_crypto_vshasigmaw((uint32x4_p)vec, func, subfunc);
return (T)__builtin_crypto_vshasigmaw((uint32x4_p)vec, func, fmask);
#else
CRYPTOPP_ASSERT(0);
#endif
@ -1376,24 +1376,24 @@ inline T VecSHA256(const T vec)
/// \brief SHA512 Sigma functions
/// \tparam func function
/// \tparam subfunc sub-function
/// \tparam fmask function mask
/// \tparam T vector type
/// \param vec the block to transform
/// \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.
/// \par Wraps
/// __vshasigmad, __builtin_altivec_crypto_vshasigmad, __builtin_crypto_vshasigmad
/// \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)
{
#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__)
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__)
return (T)__builtin_crypto_vshasigmad((uint64x2_p)vec, func, subfunc);
return (T)__builtin_crypto_vshasigmad((uint64x2_p)vec, func, fmask);
#else
CRYPTOPP_ASSERT(0);
#endif