diff options
author | lloyd <[email protected]> | 2008-11-10 14:59:08 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-11-10 14:59:08 +0000 |
commit | 9ebe6ec5d24c6b28eb8d44b4204e42dda600fb4d (patch) | |
tree | 7f7a26de2d6ec50a12426b37359551618a194f52 /src/pk_pad/eme.cpp | |
parent | 52fa0b875ad616dd997ac6253f92ffb18812209c (diff) |
Split pk_pad.h into eme.h and emsa.h
Diffstat (limited to 'src/pk_pad/eme.cpp')
-rw-r--r-- | src/pk_pad/eme.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/pk_pad/eme.cpp b/src/pk_pad/eme.cpp new file mode 100644 index 000000000..ca618889b --- /dev/null +++ b/src/pk_pad/eme.cpp @@ -0,0 +1,48 @@ +/************************************************* +* EME Base Class Source File * +* (C) 1999-2008 Jack Lloyd * +*************************************************/ + +#include <botan/eme.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); + } + +} |