Add SHACAL2 cipher AlgorithmProvider()

This commit is contained in:
Jeffrey Walton 2018-08-18 22:26:01 -04:00
parent 1f5d0d85cf
commit 3929c3594c
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
3 changed files with 13 additions and 2 deletions

View File

@ -44,6 +44,15 @@ extern void SHACAL2_Enc_ProcessAndXorBlock_SHANI(const word32* subKeys,
const byte *inBlock, const byte *xorBlock, byte *outBlock);
#endif
std::string SHACAL2::Base::AlgorithmProvider() const
{
#if CRYPTOPP_SHANI_AVAILABLE
if (HasSHA())
return "SHANI";
#endif
return "C++";
}
void SHACAL2::Base::UncheckedSetKey(const byte *userKey, unsigned int keylen, const NameValuePairs &)
{
AssertValidKeyLength(keylen);

View File

@ -28,6 +28,7 @@ class SHACAL2 : public SHACAL2_Info, public BlockCipherDocumentation
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<SHACAL2_Info>
{
public:
std::string AlgorithmProvider() const;
void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &params);
protected:

View File

@ -29,11 +29,12 @@ NAMESPACE_BEGIN(CryptoPP)
class Whirlpool : public IteratedHashWithStaticTransform<word64, BigEndian, 64, 64, Whirlpool>
{
public:
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Whirlpool";}
std::string AlgorithmProvider() const;
static void InitState(HashWordType *state);
static void Transform(word64 *digest, const word64 *data);
void TruncatedFinal(byte *hash, size_t size);
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Whirlpool";}
std::string AlgorithmProvider() const;
};
NAMESPACE_END