diff options
author | Thanabodee Charoenpiriyakij <wingyminus@gmail.com> | 2016-10-15 21:39:16 +0800 |
---|---|---|
committer | Thanabodee Charoenpiriyakij <wingyminus@gmail.com> | 2016-10-15 21:46:14 +0800 |
commit | 941a0164f946a7fcbb46f8b3244177bd10f674ef (patch) | |
tree | 26bf121a9a69e076d46ea00a27a3b2cd6f84a3a7 /libdevcore | |
parent | 5e75cae28abd79c499aa8ba4b567efdf801ed735 (diff) | |
download | dexon-solidity-941a0164f946a7fcbb46f8b3244177bd10f674ef.tar dexon-solidity-941a0164f946a7fcbb46f8b3244177bd10f674ef.tar.gz dexon-solidity-941a0164f946a7fcbb46f8b3244177bd10f674ef.tar.bz2 dexon-solidity-941a0164f946a7fcbb46f8b3244177bd10f674ef.tar.lz dexon-solidity-941a0164f946a7fcbb46f8b3244177bd10f674ef.tar.xz dexon-solidity-941a0164f946a7fcbb46f8b3244177bd10f674ef.tar.zst dexon-solidity-941a0164f946a7fcbb46f8b3244177bd10f674ef.zip |
Removed 'secure_vector'
Close #780
Diffstat (limited to 'libdevcore')
-rw-r--r-- | libdevcore/Common.h | 41 |
1 files changed, 0 insertions, 41 deletions
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<byte>; using bytesRef = vector_ref<byte>; using bytesConstRef = vector_ref<byte const>; -template <class T> -class secure_vector -{ -public: - secure_vector() {} - secure_vector(secure_vector<T> 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<T> const& _c): m_data(_c) {} - explicit secure_vector(vector_ref<T> _c): m_data(_c.data(), _c.data() + _c.size()) {} - explicit secure_vector(vector_ref<const T> _c): m_data(_c.data(), _c.data() + _c.size()) {} - ~secure_vector() { ref().cleanse(); } - - secure_vector<T>& operator=(secure_vector<T> const& _c) - { - if (&_c == this) - return *this; - - ref().cleanse(); - m_data = _c.m_data; - return *this; - } - std::vector<T>& writable() { clear(); return m_data; } - std::vector<T> const& makeInsecure() const { return m_data; } - - void clear() { ref().cleanse(); } - - vector_ref<T> ref() { return vector_ref<T>(&m_data); } - vector_ref<T const> ref() const { return vector_ref<T const>(&m_data); } - - size_t size() const { return m_data.size(); } - bool empty() const { return m_data.empty(); } - - void swap(secure_vector<T>& io_other) { m_data.swap(io_other.m_data); } - -private: - std::vector<T> m_data; -}; - -using bytesSec = secure_vector<byte>; - // Numeric types. using bigint = boost::multiprecision::number<boost::multiprecision::cpp_int_backend<>>; using u64 = boost::multiprecision::number<boost::multiprecision::cpp_int_backend<64, 64, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>>; |