aboutsummaryrefslogtreecommitdiffstats
path: root/include/s2k.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-05-18 18:33:19 +0000
committerlloyd <[email protected]>2006-05-18 18:33:19 +0000
commita2c99d3270eb73ef2db5704fc54356c6b75096f8 (patch)
treead3d6c4fcc8dd0f403f8105598943616246fe172 /include/s2k.h
Initial checkin1.5.6
Diffstat (limited to 'include/s2k.h')
-rw-r--r--include/s2k.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/include/s2k.h b/include/s2k.h
new file mode 100644
index 000000000..0b1eb0b50
--- /dev/null
+++ b/include/s2k.h
@@ -0,0 +1,42 @@
+/*************************************************
+* S2K Header File *
+* (C) 1999-2006 The Botan Project *
+*************************************************/
+
+#ifndef BOTAN_S2K_H__
+#define BOTAN_S2K_H__
+
+#include <botan/base.h>
+
+namespace Botan {
+
+/*************************************************
+* S2K Interface *
+*************************************************/
+class S2K : public Algorithm
+ {
+ public:
+ virtual S2K* clone() const = 0;
+
+ OctetString derive_key(u32bit, const std::string&) const;
+
+ void set_iterations(u32bit);
+ void change_salt(const byte[], u32bit);
+ void change_salt(const MemoryRegion<byte>&);
+ void new_random_salt(u32bit);
+
+ u32bit iterations() const { return iter; }
+ SecureVector<byte> current_salt() const { return salt; }
+
+ S2K() { iter = 0; }
+ virtual ~S2K() {}
+ private:
+ virtual OctetString derive(u32bit, const std::string&,
+ const byte[], u32bit, u32bit) const = 0;
+ SecureVector<byte> salt;
+ u32bit iter;
+ };
+
+}
+
+#endif