diff options
author | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2003-07-04 00:17:37 +0000 |
---|---|---|
committer | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2003-07-04 00:17:37 +0000 |
commit | 572fe07633123ce38abf28c6426356e37aef3a99 (patch) | |
tree | 0536d87e504a82920156c239bc5ae6aa43e70ebc /secblock.h | |
parent | 3e8c979ddc194e043567c036321e67c89f847362 (diff) | |
download | cryptopp-572fe07633123ce38abf28c6426356e37aef3a99.tar.gz |
create DLL version, fix GetNextIV() bug in CTR and OFB modes
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@87 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'secblock.h')
-rw-r--r-- | secblock.h | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -18,7 +18,7 @@ class AllocatorBase public: typedef T value_type; typedef size_t size_type; -#if (defined(_MSC_VER) && _MSC_VER < 1300) +#ifdef CRYPTOPP_MSVCRT6 typedef ptrdiff_t difference_type; #else typedef std::ptrdiff_t difference_type; @@ -94,6 +94,10 @@ public: template <class U> struct rebind { typedef AllocatorWithCleanup<U> other; }; }; +CRYPTOPP_DLL_TEMPLATE_CLASS AllocatorWithCleanup<byte>; +CRYPTOPP_DLL_TEMPLATE_CLASS AllocatorWithCleanup<word16>; +CRYPTOPP_DLL_TEMPLATE_CLASS AllocatorWithCleanup<word32>; + template <class T> class NullAllocator : public AllocatorBase<T> { @@ -325,7 +329,12 @@ public: m_size = newSize; } - void swap(SecBlock<T, A> &b); + void swap(SecBlock<T, A> &b) + { + std::swap(m_alloc, b.m_alloc); + std::swap(m_size, b.m_size); + std::swap(m_ptr, b.m_ptr); + } //private: A m_alloc; @@ -333,13 +342,6 @@ public: T *m_ptr; }; -template <class T, class A> void SecBlock<T, A>::swap(SecBlock<T, A> &b) -{ - std::swap(m_alloc, b.m_alloc); - std::swap(m_size, b.m_size); - std::swap(m_ptr, b.m_ptr); -} - typedef SecBlock<byte> SecByteBlock; typedef SecBlock<word> SecWordBlock; |