From 9e6720cceee1429658175c92cc8edf101ab4a4b3 Mon Sep 17 00:00:00 2001 From: lloyd Date: Fri, 9 Oct 2009 22:38:57 +0000 Subject: Remove redundant function --- src/wrap/python/rsa.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/wrap/python/rsa.cpp b/src/wrap/python/rsa.cpp index 895725384..900c3f93d 100644 --- a/src/wrap/python/rsa.cpp +++ b/src/wrap/python/rsa.cpp @@ -21,13 +21,6 @@ std::string bigint2str(const BigInt& n) return out.str(); } -std::string secvec2str(const MemoryRegion& vec) - { - std::string str(vec.size(), 0); - memcpy(&str[0], vec.begin(), vec.size()); - return str; - } - class Py_RSA_PrivateKey { public: @@ -66,7 +59,7 @@ std::string Py_RSA_PrivateKey::decrypt(const std::string& in, const byte* in_bytes = reinterpret_cast(in.data()); - return secvec2str(enc->decrypt(in_bytes, in.size())); + return make_string(enc->decrypt(in_bytes, in.size())); } std::string Py_RSA_PrivateKey::sign(const std::string& in, @@ -76,7 +69,7 @@ std::string Py_RSA_PrivateKey::sign(const std::string& in, std::auto_ptr sign(get_pk_signer(*rsa_key, padding)); const byte* in_bytes = reinterpret_cast(in.data()); sign->update(in_bytes, in.size()); - return secvec2str(sign->signature(rng.get_underlying_rng())); + return make_string(sign->signature(rng.get_underlying_rng())); } Py_RSA_PrivateKey::Py_RSA_PrivateKey(u32bit bits, @@ -155,7 +148,7 @@ std::string Py_RSA_PublicKey::encrypt(const std::string& in, const byte* in_bytes = reinterpret_cast(in.data()); - return secvec2str(enc->encrypt(in_bytes, in.size(), + return make_string(enc->encrypt(in_bytes, in.size(), rng.get_underlying_rng())); } -- cgit v1.2.3