aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/kdf.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/kdf.h')
-rw-r--r--src/core/kdf.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/core/kdf.h b/src/core/kdf.h
new file mode 100644
index 000000000..7d0c1866b
--- /dev/null
+++ b/src/core/kdf.h
@@ -0,0 +1,50 @@
+/*************************************************
+* KDF/MGF Header File *
+* (C) 1999-2007 Jack Lloyd *
+*************************************************/
+
+#ifndef BOTAN_KDF_BASE_H__
+#define BOTAN_KDF_BASE_H__
+
+#include <botan/secmem.h>
+#include <botan/types.h>
+
+namespace Botan {
+
+/*************************************************
+* Key Derivation Function *
+*************************************************/
+class BOTAN_DLL KDF
+ {
+ public:
+ SecureVector<byte> derive_key(u32bit, const MemoryRegion<byte>&,
+ const std::string& = "") const;
+ SecureVector<byte> derive_key(u32bit, const MemoryRegion<byte>&,
+ const MemoryRegion<byte>&) const;
+ SecureVector<byte> derive_key(u32bit, const MemoryRegion<byte>&,
+ const byte[], u32bit) const;
+
+ SecureVector<byte> derive_key(u32bit, const byte[], u32bit,
+ const std::string& = "") const;
+ SecureVector<byte> derive_key(u32bit, const byte[], u32bit,
+ const byte[], u32bit) const;
+
+ virtual ~KDF() {}
+ private:
+ virtual SecureVector<byte> derive(u32bit, const byte[], u32bit,
+ const byte[], u32bit) const = 0;
+ };
+
+/*************************************************
+* Mask Generation Function *
+*************************************************/
+class BOTAN_DLL MGF
+ {
+ public:
+ virtual void mask(const byte[], u32bit, byte[], u32bit) const = 0;
+ virtual ~MGF() {}
+ };
+
+}
+
+#endif