From 941a0164f946a7fcbb46f8b3244177bd10f674ef Mon Sep 17 00:00:00 2001 From: Thanabodee Charoenpiriyakij Date: Sat, 15 Oct 2016 20:39:16 +0700 Subject: Removed 'secure_vector' Close #780 --- libdevcore/Common.h | 41 ----------------------------------------- 1 file changed, 41 deletions(-) (limited to 'libdevcore/Common.h') diff --git a/libdevcore/Common.h b/libdevcore/Common.h index 6fbc112d..43ae7162 100644 --- a/libdevcore/Common.h +++ b/libdevcore/Common.h @@ -87,47 +87,6 @@ using bytes = std::vector; using bytesRef = vector_ref; using bytesConstRef = vector_ref; -template -class secure_vector -{ -public: - secure_vector() {} - secure_vector(secure_vector const& /*_c*/) = default; // See https://github.com/ethereum/libweb3core/pull/44 - explicit secure_vector(unsigned _size): m_data(_size) {} - explicit secure_vector(unsigned _size, T _item): m_data(_size, _item) {} - explicit secure_vector(std::vector const& _c): m_data(_c) {} - explicit secure_vector(vector_ref _c): m_data(_c.data(), _c.data() + _c.size()) {} - explicit secure_vector(vector_ref _c): m_data(_c.data(), _c.data() + _c.size()) {} - ~secure_vector() { ref().cleanse(); } - - secure_vector& operator=(secure_vector const& _c) - { - if (&_c == this) - return *this; - - ref().cleanse(); - m_data = _c.m_data; - return *this; - } - std::vector& writable() { clear(); return m_data; } - std::vector const& makeInsecure() const { return m_data; } - - void clear() { ref().cleanse(); } - - vector_ref ref() { return vector_ref(&m_data); } - vector_ref ref() const { return vector_ref(&m_data); } - - size_t size() const { return m_data.size(); } - bool empty() const { return m_data.empty(); } - - void swap(secure_vector& io_other) { m_data.swap(io_other.m_data); } - -private: - std::vector m_data; -}; - -using bytesSec = secure_vector; - // Numeric types. using bigint = boost::multiprecision::number>; using u64 = boost::multiprecision::number>; -- cgit