aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/pk_pad.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/pk_pad.cpp')
-rw-r--r--src/core/pk_pad.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/core/pk_pad.cpp b/src/core/pk_pad.cpp
new file mode 100644
index 000000000..23dc9a95b
--- /dev/null
+++ b/src/core/pk_pad.cpp
@@ -0,0 +1,48 @@
+/*************************************************
+* EME/EMSA Base Class Source File *
+* (C) 1999-2008 Jack Lloyd *
+*************************************************/
+
+#include <botan/pk_pad.h>
+
+namespace Botan {
+
+/*************************************************
+* Encode a message *
+*************************************************/
+SecureVector<byte> EME::encode(const byte msg[], u32bit msg_len,
+ u32bit key_bits,
+ RandomNumberGenerator& rng) const
+ {
+ return pad(msg, msg_len, key_bits, rng);
+ }
+
+/*************************************************
+* Encode a message *
+*************************************************/
+SecureVector<byte> EME::encode(const MemoryRegion<byte>& msg,
+ u32bit key_bits,
+ RandomNumberGenerator& rng) const
+ {
+ return pad(msg, msg.size(), key_bits, rng);
+ }
+
+/*************************************************
+* Decode a message *
+*************************************************/
+SecureVector<byte> EME::decode(const byte msg[], u32bit msg_len,
+ u32bit key_bits) const
+ {
+ return unpad(msg, msg_len, key_bits);
+ }
+
+/*************************************************
+* Decode a message *
+*************************************************/
+SecureVector<byte> EME::decode(const MemoryRegion<byte>& msg,
+ u32bit key_bits) const
+ {
+ return unpad(msg, msg.size(), key_bits);
+ }
+
+}