Remove unneeded ThrowIfInvalidDerivedLength in DeriveKey
parent
05fe384d82
commit
8d60521f8c
7
hkdf.h
7
hkdf.h
|
|
@ -30,17 +30,20 @@ public:
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// KeyDerivationFunction interface
|
||||||
std::string AlgorithmName() const {
|
std::string AlgorithmName() const {
|
||||||
return StaticAlgorithmName();
|
return StaticAlgorithmName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// KeyDerivationFunction interface
|
||||||
size_t MaxDerivedLength() const {
|
size_t MaxDerivedLength() const {
|
||||||
return static_cast<size_t>(T::DIGESTSIZE) * 255;
|
return static_cast<size_t>(T::DIGESTSIZE) * 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// KeyDerivationFunction interface
|
||||||
size_t GetValidDerivedLength(size_t keylength) const;
|
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,
|
size_t DeriveKey(byte *derived, size_t derivedLen, const byte *secret, size_t secretLen,
|
||||||
const NameValuePairs& params) const;
|
const NameValuePairs& params) const;
|
||||||
|
|
||||||
|
|
@ -99,8 +102,6 @@ size_t HKDF<T>::DeriveKey(byte *derived, size_t derivedLen,
|
||||||
CRYPTOPP_ASSERT(derived && derivedLen);
|
CRYPTOPP_ASSERT(derived && derivedLen);
|
||||||
CRYPTOPP_ASSERT(derivedLen <= MaxDerivedLength());
|
CRYPTOPP_ASSERT(derivedLen <= MaxDerivedLength());
|
||||||
|
|
||||||
ThrowIfInvalidDerivedLength(derivedLen);
|
|
||||||
|
|
||||||
ConstByteArrayParameter p;
|
ConstByteArrayParameter p;
|
||||||
SecByteBlock salt, info;
|
SecByteBlock salt, info;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue