aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pbkdf/pbkdf2
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-09-06 15:02:52 -0400
committerJack Lloyd <[email protected]>2018-09-10 13:27:45 -0400
commit9e88329b1d5c64e399c1677ccc6c158e45f19511 (patch)
treee69afd7882e49959ac8059695c09d54c5a965232 /src/lib/pbkdf/pbkdf2
parent7a5ef7c8277ef5d85e3f99b7165e42108c179c24 (diff)
Add from_iterations
Diffstat (limited to 'src/lib/pbkdf/pbkdf2')
-rw-r--r--src/lib/pbkdf/pbkdf2/pbkdf2.cpp5
-rw-r--r--src/lib/pbkdf/pbkdf2/pbkdf2.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/pbkdf/pbkdf2/pbkdf2.cpp b/src/lib/pbkdf/pbkdf2/pbkdf2.cpp
index 47a5a0bb4..65e8a9503 100644
--- a/src/lib/pbkdf/pbkdf2/pbkdf2.cpp
+++ b/src/lib/pbkdf/pbkdf2/pbkdf2.cpp
@@ -214,4 +214,9 @@ std::unique_ptr<PasswordHash> PBKDF2_Family::from_params(size_t iter, size_t, si
return std::unique_ptr<PasswordHash>(new PBKDF2(*m_prf, iter));
}
+std::unique_ptr<PasswordHash> PBKDF2_Family::from_iterations(size_t iter) const
+ {
+ return std::unique_ptr<PasswordHash>(new PBKDF2(*m_prf, iter));
+ }
+
}
diff --git a/src/lib/pbkdf/pbkdf2/pbkdf2.h b/src/lib/pbkdf/pbkdf2/pbkdf2.h
index e70f56d99..72637bc30 100644
--- a/src/lib/pbkdf/pbkdf2/pbkdf2.h
+++ b/src/lib/pbkdf/pbkdf2/pbkdf2.h
@@ -77,6 +77,8 @@ class BOTAN_PUBLIC_API(2,8) PBKDF2_Family final : public PasswordHashFamily
*/
std::unique_ptr<PasswordHash> default_params() const override;
+ std::unique_ptr<PasswordHash> from_iterations(size_t iter) const override;
+
std::unique_ptr<PasswordHash> from_params(
size_t iter, size_t, size_t) const override;
private: