From 6894dca64c04936d07048c0e8cbf7e25858548c3 Mon Sep 17 00:00:00 2001 From: lloyd Date: Fri, 10 Jan 2014 03:41:59 +0000 Subject: Move lib into src --- src/lib/pk_pad/eme.cpp | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/lib/pk_pad/eme.cpp (limited to 'src/lib/pk_pad/eme.cpp') diff --git a/src/lib/pk_pad/eme.cpp b/src/lib/pk_pad/eme.cpp new file mode 100644 index 000000000..f90239d8c --- /dev/null +++ b/src/lib/pk_pad/eme.cpp @@ -0,0 +1,50 @@ +/* +* EME Base Class +* (C) 1999-2008 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + +#include + +namespace Botan { + +/* +* Encode a message +*/ +secure_vector EME::encode(const byte msg[], size_t msg_len, + size_t key_bits, + RandomNumberGenerator& rng) const + { + return pad(msg, msg_len, key_bits, rng); + } + +/* +* Encode a message +*/ +secure_vector EME::encode(const secure_vector& msg, + size_t key_bits, + RandomNumberGenerator& rng) const + { + return pad(&msg[0], msg.size(), key_bits, rng); + } + +/* +* Decode a message +*/ +secure_vector EME::decode(const byte msg[], size_t msg_len, + size_t key_bits) const + { + return unpad(msg, msg_len, key_bits); + } + +/* +* Decode a message +*/ +secure_vector EME::decode(const secure_vector& msg, + size_t key_bits) const + { + return unpad(&msg[0], msg.size(), key_bits); + } + +} -- cgit v1.2.3