summaryrefslogtreecommitdiff
path: root/cryptlib.h
diff options
context:
space:
mode:
Diffstat (limited to 'cryptlib.h')
-rw-r--r--cryptlib.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/cryptlib.h b/cryptlib.h
index 35952ef9..3b143799 100644
--- a/cryptlib.h
+++ b/cryptlib.h
@@ -1419,8 +1419,6 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE KeyDerivationFunction : public Algorithm
public:
virtual ~KeyDerivationFunction() {}
- virtual const Algorithm & GetAlgorithm() const =0;
-
/// \brief Provides the name of this algorithm
/// \return the standard algorithm name
virtual std::string AlgorithmName() const =0;
@@ -1452,15 +1450,14 @@ public:
/// \param secret the seed input buffer
/// \param secretLen the size of the secret buffer, in bytes
/// \param params additional initialization parameters to configure this object
- /// \returns the number of bytes derived
+ /// \returns the number of iterations performed
/// \throws InvalidDerivedLength if <tt>derivedLen</tt> is invalid for the scheme
/// \details DeriveKey() provides a standard interface to derive a key from
/// a secret seed and other parameters. Each class that derives from KeyDerivationFunction
/// provides an overload that accepts most parameters used by the derivation function.
- /// \details the number of bytes derived by DeriveKey() may be less than the number
- /// requested in <tt>derivedLen</tt>. For example, a scheme may be limited to a
- /// certain amount of time for derivation.
- virtual size_t DeriveKey(byte *derived, size_t derivedLen, const byte *secret, size_t secretLen, const NameValuePairs& params) const =0;
+ /// \details the number of iterations performed by DeriveKey() may be 1. For example, a
+ // scheme like HKDF does not use the iteration count so it returns 1.
+ virtual size_t DeriveKey(byte *derived, size_t derivedLen, const byte *secret, size_t secretLen, const NameValuePairs& params = g_nullNameValuePairs) const =0;
/// \brief Set or change parameters
/// \param params additional initialization parameters to configure this object
@@ -1469,6 +1466,9 @@ public:
virtual void SetParameters(const NameValuePairs& params);
protected:
+ /// \brief Returns the base class Algorithm
+ /// \return the base class Algorithm
+ virtual const Algorithm & GetAlgorithm() const =0;
/// \brief Validates the derived key length
/// \param length the size of the derived key material, in bytes