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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? secblock.h

?? AlgorithmType: SymmetricCipher Name: AES/ECB Source: NIST Special Publication 800-38A Plaintext:
?? 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 <assert.h>

#if defined(CRYPTOPP_MEMALIGN_AVAILABLE) || defined(CRYPTOPP_MM_MALLOC_AVAILABLE) || defined(QNX)
	#include <malloc.h>
#else
	#include <stdlib.h>
#endif

NAMESPACE_BEGIN(CryptoPP)

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

template<class T>
class AllocatorBase
{
public:
	typedef T value_type;
	typedef size_t size_type;
#ifdef CRYPTOPP_MSVCRT6
	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(0)/sizeof(T);}	// switch to std::numeric_limits<T>::max later

protected:
	static void CheckSize(size_t n)
	{
		if (n > ~size_t(0) / sizeof(T))
			throw InvalidArgument("AllocatorBase: requested size would cause integer overflow");
	}
};

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

#if defined(_MSC_VER) && (_MSC_VER < 1300)
// this pragma causes an internal compiler error if placed immediately before std::swap(a, b)
#pragma warning(push)
#pragma warning(disable: 4700)	// VC60 workaround: don't know how to get rid of this warning
#endif

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_s(newPointer, sizeof(T)*newSize, p, sizeof(T)*STDMIN(oldSize, newSize));
		a.deallocate(p, oldSize);
		return newPointer;
	}
	else
	{
		a.deallocate(p, oldSize);
		return a.allocate(newSize, NULL);
	}
}

#if defined(_MSC_VER) && (_MSC_VER < 1300)
#pragma warning(pop)
#endif

template <class T, bool T_Align16 = false>
class AllocatorWithCleanup : public AllocatorBase<T>
{
public:
	CRYPTOPP_INHERIT_ALLOCATOR_TYPES

	pointer allocate(size_type n, const void * = NULL)
	{
		CheckSize(n);
		if (n == 0)
			return NULL;

		if (T_Align16 && n*sizeof(T) >= 16)
		{
			byte *p;
		#ifdef CRYPTOPP_MM_MALLOC_AVAILABLE
			while (!(p = (byte *)_mm_malloc(sizeof(T)*n, 16)))
		#elif defined(CRYPTOPP_MEMALIGN_AVAILABLE)
			while (!(p = (byte *)memalign(16, sizeof(T)*n)))
		#elif defined(CRYPTOPP_MALLOC_ALIGNMENT_IS_16)
			while (!(p = (byte *)malloc(sizeof(T)*n)))
		#else
			while (!(p = (byte *)malloc(sizeof(T)*n + 16)))
		#endif
				CallNewHandler();

		#ifdef CRYPTOPP_NO_ALIGNED_ALLOC
			size_t adjustment = 16-((size_t)p%16);
			p += adjustment;
			p[-1] = (byte)adjustment;
		#endif

			assert(IsAlignedOn(p, 16));
			return (pointer)p;
		}

		pointer p;
		while (!(p = (pointer)malloc(sizeof(T)*n)))
			CallNewHandler();
		return p;
	}

	void deallocate(void *p, size_type n)
	{
		memset(p, 0, n*sizeof(T));

		if (T_Align16 && n*sizeof(T) >= 16)
		{
		#ifdef CRYPTOPP_MM_MALLOC_AVAILABLE
			_mm_free(p);
		#elif defined(CRYPTOPP_NO_ALIGNED_ALLOC)
			p = (byte *)p - ((byte *)p)[-1];
			free(p);
		#else
			free(p);
		#endif
			return;
		}

		free(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, T_Align16> other; };
#if _MSC_VER >= 1500
	AllocatorWithCleanup() {}
	template <class U, bool A> AllocatorWithCleanup(const AllocatorWithCleanup<U, A> &) {}
#endif
};

CRYPTOPP_DLL_TEMPLATE_CLASS AllocatorWithCleanup<byte>;
CRYPTOPP_DLL_TEMPLATE_CLASS AllocatorWithCleanup<word16>;
CRYPTOPP_DLL_TEMPLATE_CLASS AllocatorWithCleanup<word32>;
CRYPTOPP_DLL_TEMPLATE_CLASS AllocatorWithCleanup<word64>;
#if CRYPTOPP_BOOL_X86
CRYPTOPP_DLL_TEMPLATE_CLASS AllocatorWithCleanup<word, true>;	// for Integer
#endif

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

	size_type max_size() const {return 0;}
};

// This allocator can't be used with standard collections because
// they require that all objects of the same allocator type are equivalent.
// So this is for use with SecBlock only.
template <class T, size_t S, class A = NullAllocator<T>, bool T_Align16 = false>
class FixedSizeAllocatorWithCleanup : public AllocatorBase<T>
{
public:
	CRYPTOPP_INHERIT_ALLOCATOR_TYPES

	FixedSizeAllocatorWithCleanup() : m_allocated(false) {}

	pointer allocate(size_type n)
	{
		assert(IsAlignedOn(m_array, 8));

		if (n <= S && !m_allocated)
		{
			m_allocated = true;
			return GetAlignedArray();
		}
		else
			return m_fallbackAllocator.allocate(n);
	}

	pointer allocate(size_type n, const void *hint)
	{
		if (n <= S && !m_allocated)
		{
			m_allocated = true;
			return GetAlignedArray();
		}
		else
			return m_fallbackAllocator.allocate(n, hint);
	}

	void deallocate(void *p, size_type n)
	{
		if (p == GetAlignedArray())
		{
			assert(n <= S);
			assert(m_allocated);
			m_allocated = false;
			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 (p == GetAlignedArray() && newSize <= S)
		{
			assert(oldSize <= S);
			if (oldSize > newSize)
				memset(p + newSize, 0, (oldSize-newSize)*sizeof(T));
			return p;
		}

		pointer newPointer = allocate(newSize, NULL);
		if (preserve)
			memcpy(newPointer, p, sizeof(T)*STDMIN(oldSize, newSize));
		deallocate(p, oldSize);
		return newPointer;
	}

	size_type max_size() const {return STDMAX(m_fallbackAllocator.max_size(), S);}

private:
#ifdef __BORLANDC__
	T* GetAlignedArray() {return m_array;}
	T m_array[S];
#else
	T* GetAlignedArray() {return T_Align16 ? (T*)(((byte *)m_array) + (0-(size_t)m_array)%16) : m_array;}
	CRYPTOPP_ALIGN_DATA(8) T m_array[T_Align16 ? S+8/sizeof(T) : S];
#endif
	A m_fallbackAllocator;
	bool m_allocated;
};

//! a block of memory allocated using A
template <class T, class A = AllocatorWithCleanup<T> >
class SecBlock
{
public:
	typedef typename A::value_type value_type;
	typedef typename A::pointer iterator;
	typedef typename A::const_pointer const_iterator;
	typedef typename A::size_type size_type;

	explicit SecBlock(size_type 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_s(m_ptr, m_size*sizeof(T), t.m_ptr, m_size*sizeof(T));}
	SecBlock(const T *t, size_type 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);}

#ifdef __BORLANDC__
	operator T *() const
		{return (T*)m_ptr;}
#else
	operator const void *() const
		{return m_ptr;}
	operator void *()
		{return m_ptr;}

	operator const T *() const
		{return m_ptr;}
	operator T *()
		{return m_ptr;}
#endif

//	T *operator +(size_type offset)
//		{return m_ptr+offset;}

//	const T *operator +(size_type offset) const
//		{return m_ptr+offset;}

//	T& operator[](size_type index)
//		{assert(index >= 0 && index < m_size); return m_ptr[index];}

//	const T& operator[](size_type index) const
//		{assert(index >= 0 && index < m_size); return m_ptr[index];}

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

	byte * BytePtr() {return (byte *)m_ptr;}
	const byte * BytePtr() const {return (const byte *)m_ptr;}
	size_type SizeInBytes() const {return m_size*sizeof(T);}

	//! set contents and size
	void Assign(const T *t, size_type len)
	{
		New(len);
		memcpy_s(m_ptr, m_size*sizeof(T), t, len*sizeof(T));
	}

	//! copy contents and size from another SecBlock
	void Assign(const SecBlock<T, A> &t)
	{
		New(t.m_size);
		memcpy_s(m_ptr, m_size*sizeof(T), t.m_ptr, m_size*sizeof(T));
	}

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

	// append to this object
	SecBlock<T, A>& operator+=(const SecBlock<T, A> &t)
	{
		size_type oldSize = m_size;
		Grow(m_size+t.m_size);
		memcpy_s(m_ptr+oldSize, m_size*sizeof(T), t.m_ptr, t.m_size*sizeof(T));
		return *this;
	}

	// append operator
	SecBlock<T, A> operator+(const SecBlock<T, A> &t)
	{
		SecBlock<T, A> result(m_size+t.m_size);
		memcpy_s(result.m_ptr, result.m_size*sizeof(T), m_ptr, m_size*sizeof(T));
		memcpy_s(result.m_ptr+m_size, t.m_size*sizeof(T), 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;
	}

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

	//! change size, without preserving contents
	void New(size_type newSize)
	{
		m_ptr = m_alloc.reallocate(m_ptr, m_size, newSize, false);
		m_size = newSize;
	}

	//! change size and set contents to 0
	void CleanNew(size_type newSize)
	{
		New(newSize);
		memset(m_ptr, 0, m_size*sizeof(T));
	}

	//! change size only if newSize > current size. contents are preserved
	void Grow(size_type newSize)
	{
		if (newSize > m_size)
		{
			m_ptr = m_alloc.reallocate(m_ptr, m_size, newSize, true);
			m_size = newSize;
		}
	}

	//! change size only if newSize > current size. contents are preserved and additional area is set to 0
	void CleanGrow(size_type 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;
		}
	}

	//! change size and preserve contents
	void resize(size_type newSize)
	{
		m_ptr = m_alloc.reallocate(m_ptr, m_size, newSize, true);
		m_size = newSize;
	}

	//! swap contents and size with another SecBlock
	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;
	size_type m_size;
	T *m_ptr;
};

typedef SecBlock<byte> SecByteBlock;
typedef SecBlock<byte, AllocatorWithCleanup<byte, CRYPTOPP_BOOL_X86 | CRYPTOPP_BOOL_X64> > AlignedSecByteBlock;
typedef SecBlock<word> SecWordBlock;

//! a SecBlock with fixed size, allocated statically
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, bool T_Align16 = CRYPTOPP_BOOL_X86 | CRYPTOPP_BOOL_X64>
class FixedSizeAlignedSecBlock : public FixedSizeSecBlock<T, S, FixedSizeAllocatorWithCleanup<T, S, NullAllocator<word32>, T_Align16> >
{
};

//! a SecBlock that preallocates size S statically, and uses the heap when this size is exceeded
template <class T, unsigned int S, class A = FixedSizeAllocatorWithCleanup<T, S, AllocatorWithCleanup<T> > >
class SecBlockWithHint : public SecBlock<T, A>
{
public:
	explicit SecBlockWithHint(size_t size) : SecBlock<T, A>(size) {}
};

template<class T, bool A, class U, bool B>
inline bool operator==(const CryptoPP::AllocatorWithCleanup<T, A>&, const CryptoPP::AllocatorWithCleanup<U, B>&) {return (true);}
template<class T, bool A, class U, bool B>
inline bool operator!=(const CryptoPP::AllocatorWithCleanup<T, A>&, const CryptoPP::AllocatorWithCleanup<U, B>&) {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);
}

#if defined(_STLP_DONT_SUPPORT_REBIND_MEMBER_TEMPLATE) || (defined(_STLPORT_VERSION) && !defined(_STLP_MEMBER_TEMPLATE_CLASSES))
// working for STLport 5.1.3 and MSVC 6 SP5
template <class _Tp1, class _Tp2>
inline CryptoPP::AllocatorWithCleanup<_Tp2>&
__stl_alloc_rebind(CryptoPP::AllocatorWithCleanup<_Tp1>& __a, const _Tp2*)
{
	return (CryptoPP::AllocatorWithCleanup<_Tp2>&)(__a);
}
#endif

NAMESPACE_END

#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美撒尿777hd撒尿| 国产精品久久久一区麻豆最新章节| 日韩一区二区免费电影| 国产精品久99| 美国欧美日韩国产在线播放| 成人h精品动漫一区二区三区| 欧美一级在线观看| 一区二区三区在线视频观看| 国产一区二区三区在线观看免费| 欧美日韩中文国产| 亚洲丝袜制服诱惑| 懂色一区二区三区免费观看| 日韩美女视频在线| 午夜视频在线观看一区二区三区 | 99精品视频一区二区| 欧美v国产在线一区二区三区| 亚洲国产一区视频| 91视频在线看| 亚洲欧洲色图综合| 国产91丝袜在线播放| 亚洲精品一区二区三区福利 | 国产精品污www在线观看| 美日韩黄色大片| 欧美一区二区三区不卡| 午夜婷婷国产麻豆精品| 欧美日韩美女一区二区| 亚洲一二三四区不卡| 色8久久精品久久久久久蜜| 自拍偷拍欧美激情| 成人激情免费电影网址| 中文字幕乱码一区二区免费| 国产精品中文欧美| 国产色一区二区| 成人国产视频在线观看 | 欧美一区二区日韩| 天天影视涩香欲综合网| 91精品国产91综合久久蜜臀| 丝袜脚交一区二区| 欧美一区二区三区日韩视频| 久久国产精品一区二区| 精品国精品自拍自在线| 国产电影一区二区三区| 亚洲国产精品av| 99久久久久免费精品国产| 亚洲色图清纯唯美| 欧美日韩你懂得| 免费日本视频一区| 国产亚洲成av人在线观看导航| 丰满放荡岳乱妇91ww| 国产精品国产精品国产专区不片| 日本精品一级二级| 日日夜夜免费精品| 久久久久久免费网| 91蜜桃视频在线| 日韩在线观看一区二区| 国产欧美一区二区精品秋霞影院| 99视频在线观看一区三区| 亚洲香肠在线观看| 久久久久国产精品人| 亚洲精品中文在线影院| 99视频精品全部免费在线| 亚洲综合自拍偷拍| 精品国产制服丝袜高跟| 99re这里都是精品| 免费久久精品视频| 亚洲免费观看高清完整| 精品国产人成亚洲区| 色综合一个色综合亚洲| 美女爽到高潮91| 亚洲美女免费视频| 欧美成人精品二区三区99精品| av在线不卡网| 精东粉嫩av免费一区二区三区| 国产精品乱码人人做人人爱| 91精品国产欧美日韩| 99久久综合狠狠综合久久| 日韩不卡一二三区| 亚洲欧洲色图综合| 精品99久久久久久| 欧美性感一类影片在线播放| 国产高清不卡一区二区| 日产欧产美韩系列久久99| 中国色在线观看另类| 日韩午夜在线观看| 91九色最新地址| 国产精品原创巨作av| 日韩av一二三| 亚洲综合区在线| 一区精品在线播放| 久久蜜桃av一区二区天堂| 欧美精品色一区二区三区| 99精品欧美一区二区三区综合在线| 久久国产综合精品| 天天综合网 天天综合色| 国产精品不卡在线观看| 精品国产髙清在线看国产毛片| 日本精品视频一区二区| 成人免费视频视频在线观看免费| 美女视频网站久久| 日韩影院免费视频| 亚洲va天堂va国产va久| 亚洲精品综合在线| 《视频一区视频二区| 国产色产综合产在线视频 | 欧洲精品一区二区| 国产大陆精品国产| 国产精品中文字幕日韩精品| 美国十次了思思久久精品导航| 天天综合色天天| 视频一区免费在线观看| 香蕉久久一区二区不卡无毒影院| 亚洲人精品午夜| 亚洲色图20p| 亚洲久本草在线中文字幕| 亚洲精品中文字幕乱码三区| 亚洲欧美一区二区三区孕妇| **网站欧美大片在线观看| 国产精品嫩草影院av蜜臀| 国产精品理论在线观看| 国产精品九色蝌蚪自拍| 日韩一区日韩二区| 一区二区三区在线视频观看58| 亚洲精品免费电影| 亚洲伊人色欲综合网| 婷婷丁香久久五月婷婷| 日韩高清一级片| 久久成人av少妇免费| 国产一区二区0| 成人网男人的天堂| 91视频免费观看| 欧美日韩在线不卡| 91精品国产美女浴室洗澡无遮挡| 69av一区二区三区| www国产成人| 国产精品女主播av| 夜夜嗨av一区二区三区| 亚洲成人一区二区| 久久国产尿小便嘘嘘尿| 顶级嫩模精品视频在线看| 成人国产精品免费观看视频| 在线精品视频小说1| 欧美一级片在线看| 国产视频不卡一区| 一区二区三区四区视频精品免费 | 777午夜精品免费视频| 欧美xxxx在线观看| 国产精品成人一区二区艾草| 无码av免费一区二区三区试看| 久久精品国产亚洲一区二区三区| 国产寡妇亲子伦一区二区| 色婷婷激情综合| 日韩女优制服丝袜电影| 国产精品久久久久一区二区三区共| 亚洲综合av网| 国产在线精品一区二区不卡了| 成人国产精品视频| 欧美一区二区女人| 综合色天天鬼久久鬼色| 久久99国产精品久久99| 色综合久久中文字幕| 日韩精品在线网站| 最新日韩av在线| 精品一区二区三区蜜桃| 色综合色狠狠综合色| 久久免费偷拍视频| 天堂一区二区在线免费观看| 福利电影一区二区| 欧美久久久久中文字幕| 国产精品国产三级国产| 久久99精品国产.久久久久久| 色成年激情久久综合| 国产视频一区二区在线观看| 丝袜a∨在线一区二区三区不卡| 成人午夜短视频| 欧美一区二区福利视频| 亚洲综合一区二区| k8久久久一区二区三区| 久久综合五月天婷婷伊人| 香蕉成人啪国产精品视频综合网| 岛国av在线一区| 久久色中文字幕| 老司机免费视频一区二区| 欧美丝袜丝交足nylons图片| 亚洲欧美一区二区久久| 国产凹凸在线观看一区二区| 日韩视频免费观看高清完整版 | 在线国产电影不卡| 亚洲色图都市小说| 99免费精品视频| 国产精品成人一区二区三区夜夜夜| 国产精品自拍av| 国产日本亚洲高清| 国内成人免费视频| 日韩欧美一区电影| 美女被吸乳得到大胸91| 91精品国产一区二区三区| 五月婷婷欧美视频| 欧美精品日韩一区| 日本亚洲三级在线| 欧美一区二区三区婷婷月色|