From acae4e84386056e80eb4bb633fcdf03375c087ea Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Fri, 20 May 2016 15:07:10 +0100 Subject: Remove functions which return strings We don't want anything which does dynamic memory allocation in the library. --- include/olm/crypto.hh | 2 -- include/olm/memory.hh | 19 ------------------- 2 files changed, 21 deletions(-) (limited to 'include/olm') diff --git a/include/olm/crypto.hh b/include/olm/crypto.hh index 159bac7..7a05f8d 100644 --- a/include/olm/crypto.hh +++ b/include/olm/crypto.hh @@ -17,7 +17,6 @@ #include #include -#include namespace olm { @@ -27,7 +26,6 @@ static const std::size_t IV_LENGTH = 16; struct Curve25519PublicKey { std::uint8_t public_key[KEY_LENGTH]; - std::string to_string() const; }; diff --git a/include/olm/memory.hh b/include/olm/memory.hh index 89afd99..74ff9f8 100644 --- a/include/olm/memory.hh +++ b/include/olm/memory.hh @@ -87,23 +87,4 @@ std::uint8_t * store_array( return destination + sizeof(T); } -/** convert an array of bytes to a string representation */ -template -std::string bytes_to_string(T start, T end) { - std::ostringstream ss; - ss << std::hex << std::setfill('0'); - while (start != end) { - ss << std::setw(2) << static_cast(*start++); - if (start != end) { - ss << ":"; - } - } - return ss.str(); -} - -template -std::string bytes_to_string(T start, size_t len) { - return bytes_to_string(start, start+len); -} - } // namespace olm -- cgit v1.2.3