diff --git a/blake2.cpp b/blake2.cpp index 7646eaa9b..733082d70 100644 --- a/blake2.cpp +++ b/blake2.cpp @@ -343,6 +343,26 @@ BLAKE2b::BLAKE2b(bool treeMode, unsigned int digestSize) (Name::TreeMode(), treeMode)); } +BLAKE2s::BLAKE2s(unsigned int digestSize) + : m_digestSize(digestSize), m_keyLength(0), m_treeMode(false) +{ + CRYPTOPP_ASSERT(digestSize <= DIGESTSIZE); + + UncheckedSetKey(NULLPTR, 0, MakeParameters + (Name::DigestSize(), (int)digestSize) + (Name::TreeMode(), false)); +} + +BLAKE2b::BLAKE2b(unsigned int digestSize) + : m_digestSize(digestSize), m_keyLength(0), m_treeMode(false) +{ + CRYPTOPP_ASSERT(digestSize <= DIGESTSIZE); + + UncheckedSetKey(NULLPTR, 0, MakeParameters + (Name::DigestSize(), (int)digestSize) + (Name::TreeMode(), false)); +} + BLAKE2s::BLAKE2s(const byte *key, size_t keyLength, const byte* salt, size_t saltLength, const byte* personalization, size_t personalizationLength, bool treeMode, unsigned int digestSize) : m_digestSize(digestSize), m_keyLength(static_cast(keyLength)), m_treeMode(treeMode) diff --git a/blake2.h b/blake2.h index 7b27ed73e..28a6a60a6 100644 --- a/blake2.h +++ b/blake2.h @@ -256,8 +256,15 @@ class BLAKE2s : public SimpleKeyingInterfaceImpl