diff options
author | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2005-01-20 04:19:35 +0000 |
---|---|---|
committer | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2005-01-20 04:19:35 +0000 |
commit | 242d67fb17619670d9b757c442dcf2e26d8478a1 (patch) | |
tree | 1f61e8bf59450a028415e5a3f08565a6ceb86afe /secblock.h | |
parent | 4b85e6cac0d84aaf65d0695adb137ae956e4e241 (diff) | |
download | cryptopp-242d67fb17619670d9b757c442dcf2e26d8478a1.tar.gz |
changes done for FIPS-140 lab code drop
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@195 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'secblock.h')
-rw-r--r-- | secblock.h | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -286,12 +286,28 @@ public: memcpy(m_ptr, t.m_ptr, m_size*sizeof(T)); } - SecBlock& operator=(const SecBlock<T, A> &t) + SecBlock<T, A>& operator=(const SecBlock<T, A> &t) { Assign(t); return *this; } + SecBlock<T, A>& operator+=(const SecBlock<T, A> &t) + { + unsigned int oldSize = m_size; + Grow(m_size+t.m_size); + memcpy(m_ptr+oldSize, t.m_ptr, t.m_size*sizeof(T)); + return *this; + } + + SecBlock<T, A> operator+(const SecBlock<T, A> &t) + { + SecBlock<T, A> result(m_size+t.m_size); + memcpy(result.m_ptr, m_ptr, m_size*sizeof(T)); + memcpy(result.m_ptr+m_size, t.m_ptr, t.m_size*sizeof(T)); + return result; + } + bool operator==(const SecBlock<T, A> &t) const { return m_size == t.m_size && memcmp(m_ptr, t.m_ptr, m_size*sizeof(T)) == 0; |