Remove unneeded ThrowIfInvalidDerivedLength in DeriveKey

pull/614/head
Jeffrey Walton 2018-03-30 16:40:15 -04:00
parent 05fe384d82
commit 8d60521f8c
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 4 additions and 3 deletions

7
hkdf.h
View File

@ -30,17 +30,20 @@ public:
return name;
}
// KeyDerivationFunction interface
std::string AlgorithmName() const {
return StaticAlgorithmName();
}
// KeyDerivationFunction interface
size_t MaxDerivedLength() const {
return static_cast<size_t>(T::DIGESTSIZE) * 255;
}
// KeyDerivationFunction interface
size_t GetValidDerivedLength(size_t keylength) const;
// Base class override
// KeyDerivationFunction interface
size_t DeriveKey(byte *derived, size_t derivedLen, const byte *secret, size_t secretLen,
const NameValuePairs& params) const;
@ -99,8 +102,6 @@ size_t HKDF<T>::DeriveKey(byte *derived, size_t derivedLen,
CRYPTOPP_ASSERT(derived && derivedLen);
CRYPTOPP_ASSERT(derivedLen <= MaxDerivedLength());
ThrowIfInvalidDerivedLength(derivedLen);
ConstByteArrayParameter p;
SecByteBlock salt, info;