亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? secblock.h

?? 此文件是實(shí)現(xiàn)加解密算法的函數(shù)庫
?? H
字號:
// secblock.h - written and placed in the public domain by Wei Dai

#ifndef CRYPTOPP_SECBLOCK_H
#define CRYPTOPP_SECBLOCK_H

#include "config.h"
#include "misc.h"
#include <string.h>		// CodeWarrior doesn't have memory.h
#include <assert.h>

NAMESPACE_BEGIN(CryptoPP)

// ************** secure memory allocation ***************

template<class T>
class AllocatorBase
{
public:
	typedef T value_type;
	typedef size_t size_type;
#if (defined(_MSC_VER) && _MSC_VER < 1300)
	typedef ptrdiff_t difference_type;
#else
	typedef std::ptrdiff_t difference_type;
#endif
	typedef T * pointer;
	typedef const T * const_pointer;
	typedef T & reference;
	typedef const T & const_reference;

	pointer address(reference r) const {return (&r);}
	const_pointer address(const_reference r) const {return (&r); }
	void construct(pointer p, const T& val) {new (p) T(val);}
	void destroy(pointer p) {p->~T();}
	size_type max_size() const {return size_type(-1)/sizeof(T);}
};

#define CRYPTOPP_INHERIT_ALLOCATOR_TYPES	\
typedef typename AllocatorBase<T>::value_type value_type;\
typedef typename AllocatorBase<T>::size_type size_type;\
typedef typename AllocatorBase<T>::difference_type difference_type;\
typedef typename AllocatorBase<T>::pointer pointer;\
typedef typename AllocatorBase<T>::const_pointer const_pointer;\
typedef typename AllocatorBase<T>::reference reference;\
typedef typename AllocatorBase<T>::const_reference const_reference;

template <class T, class A>
typename A::pointer StandardReallocate(A& a, T *p, typename A::size_type oldSize, typename A::size_type newSize, bool preserve)
{
	if (oldSize == newSize)
		return p;

	if (preserve)
	{
		typename A::pointer newPointer = a.allocate(newSize, NULL);
		memcpy(newPointer, p, sizeof(T)*STDMIN(oldSize, newSize));
		a.deallocate(p, oldSize);
		return newPointer;
	}
	else
	{
		a.deallocate(p, oldSize);
		return a.allocate(newSize, NULL);
	}
}

template <class T>
class AllocatorWithCleanup : public AllocatorBase<T>
{
public:
	CRYPTOPP_INHERIT_ALLOCATOR_TYPES

	pointer allocate(size_type n, const void * = NULL)
	{
		if (n > 0)
			return new T[n];
		else
			return NULL;
	}

	void deallocate(void *p, size_type n)
	{
		memset(p, 0, n*sizeof(T));
		delete [] (T *)p;
	}

	pointer reallocate(T *p, size_type oldSize, size_type newSize, bool preserve)
	{
		return StandardReallocate(*this, p, oldSize, newSize, preserve);
	}

	// VS.NET STL enforces the policy of "All STL-compliant allocators have to provide a
	// template class member called rebind".
    template <class U> struct rebind { typedef AllocatorWithCleanup<U> other; };
};

template <class T>
class NullAllocator : public AllocatorBase<T>
{
public:
	CRYPTOPP_INHERIT_ALLOCATOR_TYPES

	pointer allocate(size_type n, const void * = NULL)
	{
		assert(false);
		return NULL;
	}

	void deallocate(void *p, size_type n)
	{
		assert(false);
	}
};

// this allocator can't be used with standard collections
template <class T, unsigned int S, class A = NullAllocator<T> >
class FixedSizeAllocatorWithCleanup : public AllocatorBase<T>
{
public:
	CRYPTOPP_INHERIT_ALLOCATOR_TYPES

	pointer allocate(size_type n)
	{
		if (n <= S)
		{
			assert(!m_allocated);
#ifndef NDEBUG
			m_allocated = true;
#endif
			return m_array;
		}
		else
			return m_fallbackAllocator.allocate(n);
	}

	pointer allocate(size_type n, const void *hint)
	{
		if (n <= S)
		{
			assert(!m_allocated);
#ifndef NDEBUG
			m_allocated = true;
#endif
			return m_array;
		}
		else
			return m_fallbackAllocator.allocate(n, hint);
	}

	void deallocate(void *p, size_type n)
	{
		if (n <= S)
		{
			assert(m_allocated);
			assert(p == m_array);
#ifndef NDEBUG
			m_allocated = false;
#endif
			memset(p, 0, n*sizeof(T));
		}
		else
			m_fallbackAllocator.deallocate(p, n);
	}

	pointer reallocate(pointer p, size_type oldSize, size_type newSize, bool preserve)
	{
		if (oldSize <= S && newSize <= S)
			return p;

		return StandardReallocate(*this, p, oldSize, newSize, preserve);
	}

	size_type max_size() const {return m_fallbackAllocator.max_size();}

private:
	A m_fallbackAllocator;
	T m_array[S];

#ifndef NDEBUG
public:
	FixedSizeAllocatorWithCleanup() : m_allocated(false) {}
	bool m_allocated;
#endif
};

//! a block of memory allocated using A
template <class T, class A = AllocatorWithCleanup<T> >
class SecBlock
{
public:
	explicit SecBlock(unsigned int size=0)
		: m_size(size) {m_ptr = m_alloc.allocate(size, NULL);}
	SecBlock(const SecBlock<T, A> &t)
		: m_size(t.m_size) {m_ptr = m_alloc.allocate(m_size, NULL); memcpy(m_ptr, t.m_ptr, m_size*sizeof(T));}
	SecBlock(const T *t, unsigned int len)
		: m_size(len)
	{
		m_ptr = m_alloc.allocate(len, NULL);
		if (t == NULL)
			memset(m_ptr, 0, len*sizeof(T));
		else
			memcpy(m_ptr, t, len*sizeof(T));
	}

	~SecBlock()
		{m_alloc.deallocate(m_ptr, m_size);}

#if defined(__GNUC__) || defined(__BCPLUSPLUS__)
	operator const void *() const
		{return m_ptr;}
	operator void *()
		{return m_ptr;}
#endif
#if defined(__GNUC__)	// reduce warnings
	operator const void *()
		{return m_ptr;}
#endif

	operator const T *() const
		{return m_ptr;}
	operator T *()
		{return m_ptr;}
#if defined(__GNUC__)	// reduce warnings
	operator const T *()
		{return m_ptr;}
#endif

	template <typename I>
	T *operator +(I offset)
		{return m_ptr+offset;}

	template <typename I>
	const T *operator +(I offset) const
		{return m_ptr+offset;}

	template <typename I>
	T& operator[](I index)
		{assert(index >= 0 && (unsigned int)index < m_size); return m_ptr[index];}

	template <typename I>
	const T& operator[](I index) const
		{assert(index >= 0 && (unsigned int)index < m_size); return m_ptr[index];}

	typedef typename A::pointer iterator;
	typedef typename A::const_pointer const_iterator;
	typedef typename A::size_type size_type;

	iterator begin()
		{return m_ptr;}
	const_iterator begin() const
		{return m_ptr;}
	iterator end()
		{return m_ptr+m_size;}
	const_iterator end() const
		{return m_ptr+m_size;}

	typename A::pointer data() {return m_ptr;}
	typename A::const_pointer data() const {return m_ptr;}

	size_type size() const {return m_size;}
	bool empty() const {return m_size == 0;}

	void Assign(const T *t, unsigned int len)
	{
		New(len);
		memcpy(m_ptr, t, len*sizeof(T));
	}

	void Assign(const SecBlock<T, A> &t)
	{
		New(t.m_size);
		memcpy(m_ptr, t.m_ptr, m_size*sizeof(T));
	}

	SecBlock& operator=(const SecBlock<T, A> &t)
	{
		Assign(t);
		return *this;
	}

	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;
	}

	bool operator!=(const SecBlock<T, A> &t) const
	{
		return !operator==(t);
	}

	void New(unsigned int newSize)
	{
		m_ptr = m_alloc.reallocate(m_ptr, m_size, newSize, false);
		m_size = newSize;
	}

	void CleanNew(unsigned int newSize)
	{
		New(newSize);
		memset(m_ptr, 0, m_size*sizeof(T));
	}

	void Grow(unsigned int newSize)
	{
		if (newSize > m_size)
		{
			m_ptr = m_alloc.reallocate(m_ptr, m_size, newSize, true);
			m_size = newSize;
		}
	}

	void CleanGrow(unsigned int newSize)
	{
		if (newSize > m_size)
		{
			m_ptr = m_alloc.reallocate(m_ptr, m_size, newSize, true);
			memset(m_ptr+m_size, 0, (newSize-m_size)*sizeof(T));
			m_size = newSize;
		}
	}

	void resize(unsigned int newSize)
	{
		m_ptr = m_alloc.reallocate(m_ptr, m_size, newSize, true);
		m_size = newSize;
	}

	void swap(SecBlock<T, A> &b);

//private:
	A m_alloc;
	unsigned int m_size;
	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;

template <class T, unsigned int S, class A = FixedSizeAllocatorWithCleanup<T, S> >
class FixedSizeSecBlock : public SecBlock<T, A>
{
public:
	explicit FixedSizeSecBlock() : SecBlock<T, A>(S) {}
};

template <class T, unsigned int S, class A = FixedSizeAllocatorWithCleanup<T, S, AllocatorWithCleanup<T> > >
class SecBlockWithHint : public SecBlock<T, A>
{
public:
	explicit SecBlockWithHint(unsigned int size) : SecBlock<T, A>(size) {}
};

template<class T, class U>
inline bool operator==(const CryptoPP::AllocatorWithCleanup<T>&, const CryptoPP::AllocatorWithCleanup<U>&) {return (true);}
template<class T, class U>
inline bool operator!=(const CryptoPP::AllocatorWithCleanup<T>&, const CryptoPP::AllocatorWithCleanup<U>&) {return (false);}

NAMESPACE_END

NAMESPACE_BEGIN(std)
template <class T, class A>
inline void swap(CryptoPP::SecBlock<T, A> &a, CryptoPP::SecBlock<T, A> &b)
{
	a.swap(b);
}

NAMESPACE_END

#endif

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本一区二区视频在线| 91香蕉视频mp4| 欧美成人性福生活免费看| 日韩精品电影一区亚洲| 69久久夜色精品国产69蝌蚪网| 亚洲成人在线网站| 日韩精品一区二区在线| 国内精品国产成人| 中文久久乱码一区二区| 99麻豆久久久国产精品免费 | 久久精品亚洲乱码伦伦中文| 韩国在线一区二区| 国产精品美女www爽爽爽| 日本韩国欧美一区二区三区| 视频一区在线视频| 久久这里只有精品视频网| av福利精品导航| 午夜精品久久久久久久蜜桃app| 日韩精品综合一本久道在线视频| 国产伦精品一区二区三区免费 | 在线综合视频播放| 国产乱色国产精品免费视频| 国产精品毛片久久久久久久| 91久久免费观看| 国产一区在线观看视频| 亚洲欧美另类综合偷拍| 精品久久久久久久人人人人传媒| av一区二区三区在线| 视频一区中文字幕| 国产精品乱人伦中文| 91精品中文字幕一区二区三区| 国产经典欧美精品| 偷偷要91色婷婷| 国产精品女主播av| 欧美一级高清片| av在线播放成人| 精品亚洲国内自在自线福利| 亚洲免费在线视频| 久久精品亚洲麻豆av一区二区| 欧洲视频一区二区| 成人av在线一区二区| 麻豆一区二区99久久久久| 一区二区三区四区在线播放| 欧美成人精品二区三区99精品| 色吊一区二区三区| 粉嫩在线一区二区三区视频| 日本成人在线网站| 亚洲精品视频在线观看免费| 国产亚洲欧美一级| 欧美一区三区四区| 在线一区二区三区做爰视频网站| 精品一区二区在线视频| 亚洲一区二区三区四区在线| 国产精品久久久久7777按摩| 日韩免费福利电影在线观看| 欧美人妇做爰xxxⅹ性高电影 | 另类的小说在线视频另类成人小视频在线| 中文字幕一区二| 国产午夜精品美女毛片视频| 欧美电影精品一区二区| 欧美日韩成人激情| 在线观看免费亚洲| 91在线观看美女| 成人理论电影网| 国产91富婆露脸刺激对白| 国内欧美视频一区二区| 麻豆精品在线视频| 日本不卡中文字幕| 日韩精品乱码av一区二区| 亚洲午夜视频在线| 亚洲无线码一区二区三区| 国产69精品久久久久毛片| 成人午夜视频福利| 国内国产精品久久| 久久av老司机精品网站导航| 丝袜美腿成人在线| 五月天丁香久久| 天天综合色天天综合色h| 亚洲.国产.中文慕字在线| 亚洲午夜激情av| 亚洲国产视频一区| 亚洲成人资源在线| 日韩精品电影在线观看| 久色婷婷小香蕉久久| 久88久久88久久久| 国产最新精品精品你懂的| 国产一区二区网址| 成人精品鲁一区一区二区| 成人伦理片在线| 一本久久a久久免费精品不卡| 一本到三区不卡视频| 色婷婷亚洲综合| 欧美性猛片aaaaaaa做受| 91精品在线一区二区| 精品sm捆绑视频| 欧美国产激情一区二区三区蜜月| 欧美国产激情二区三区| 亚洲免费观看高清完整版在线 | 国内偷窥港台综合视频在线播放| 国产一区二区三区久久久| 成人天堂资源www在线| 91日韩在线专区| 欧美日韩一本到| 26uuu精品一区二区在线观看| 国产欧美一区二区在线观看| 国产精品不卡在线| 午夜欧美大尺度福利影院在线看| 久久99久久精品| 91丝袜高跟美女视频| 色噜噜狠狠一区二区三区果冻| 欧美日韩国产另类一区| 国产午夜精品一区二区| 一区二区三区国产豹纹内裤在线| 丝袜亚洲精品中文字幕一区| 国产综合久久久久影院| 99视频精品在线| 日韩欧美www| 亚洲蜜臀av乱码久久精品| 美女网站色91| 色婷婷亚洲精品| 久久久亚洲国产美女国产盗摄| 亚洲另类中文字| 韩国精品主播一区二区在线观看 | 国产精品美女久久久久久 | 国产精品欧美久久久久无广告| 亚洲韩国精品一区| 国产成人午夜片在线观看高清观看| 色综合中文字幕国产| 日韩欧美一区二区视频| 亚洲女同女同女同女同女同69| 免费观看91视频大全| 91年精品国产| 国产欧美一区二区在线| 日韩中文字幕1| 91在线免费播放| 久久久久久一级片| 日韩精品电影一区亚洲| 91久久线看在观草草青青| 国产女主播视频一区二区| 日韩精品久久理论片| 色噜噜狠狠色综合中国| 中文字幕巨乱亚洲| 蜜桃视频免费观看一区| 欧美伊人久久大香线蕉综合69 | 亚洲欧美在线视频| 黑人精品欧美一区二区蜜桃| 欧美人体做爰大胆视频| 亚洲男帅同性gay1069| 国产成人精品在线看| 精品国产电影一区二区| 日韩电影在线一区二区三区| 91丨国产丨九色丨pron| 国产精品久久久久永久免费观看 | 成人av免费在线观看| 在线区一区二视频| 国产精品久久久久久久久免费相片| 日精品一区二区| 欧美网站一区二区| 亚洲乱码国产乱码精品精可以看 | 亚洲成人在线网站| 日本乱人伦一区| 亚洲欧美日韩电影| 99视频精品在线| 1024成人网| 91亚洲午夜精品久久久久久| 中文av一区二区| 成人午夜激情在线| 久久九九国产精品| 婷婷六月综合网| 欧美日本一区二区三区| 亚洲综合色噜噜狠狠| 欧美影视一区二区三区| 国产一区二区三区不卡在线观看| 欧美精品乱码久久久久久按摩| 午夜精品福利一区二区蜜股av | 亚洲成av人片在线观看无码| 欧美一a一片一级一片| 亚洲一区二区三区激情| 欧美美女激情18p| 视频一区欧美日韩| 欧美成人一区二区| 国产福利一区在线| 国产精品乱码人人做人人爱| 91在线免费视频观看| 亚洲国产日韩在线一区模特| 在线播放中文一区| 狠狠色伊人亚洲综合成人| 国产亚洲一区二区在线观看| eeuss鲁片一区二区三区在线看 | 综合久久给合久久狠狠狠97色| heyzo一本久久综合| 怡红院av一区二区三区| 777亚洲妇女| 国产精品影视在线| 亚洲天堂久久久久久久| 欧美日韩在线直播| 韩日精品视频一区| 亚洲女人小视频在线观看| 91麻豆精品久久久久蜜臀| 国产精品综合视频|