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

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

?? misc.h

?? 研讀AxCrypt對加解密的處理方法
?? H
?? 第 1 頁 / 共 2 頁
字號:
#ifndef CRYPTOPP_MISC_H
#define CRYPTOPP_MISC_H

#include "cryptlib.h"
#include "smartptr.h"

#ifdef INTEL_INTRINSICS
#include <stdlib.h>
#endif

NAMESPACE_BEGIN(CryptoPP)

// ************** compile-time assertion ***************

template <bool b>
struct CompileAssert
{
	static char dummy[2*b-1];
};

#define CRYPTOPP_COMPILE_ASSERT(assertion) CRYPTOPP_COMPILE_ASSERT_INSTANCE(assertion, __LINE__)
#if defined(CRYPTOPP_EXPORTS) || defined(CRYPTOPP_IMPORTS)
#define CRYPTOPP_COMPILE_ASSERT_INSTANCE(assertion, instance)
#else
#define CRYPTOPP_COMPILE_ASSERT_INSTANCE(assertion, instance) static CompileAssert<(assertion)> CRYPTOPP_ASSERT_JOIN(cryptopp_assert_, instance)
#endif
#define CRYPTOPP_ASSERT_JOIN(X, Y) CRYPTOPP_DO_ASSERT_JOIN(X, Y)
#define CRYPTOPP_DO_ASSERT_JOIN(X, Y) X##Y

// ************** misc classes ***************

class CRYPTOPP_DLL Empty
{
};

//! _
template <class BASE1, class BASE2>
class CRYPTOPP_NO_VTABLE TwoBases : public BASE1, public BASE2
{
};

//! _
template <class BASE1, class BASE2, class BASE3>
class CRYPTOPP_NO_VTABLE ThreeBases : public BASE1, public BASE2, public BASE3
{
};

template <class T>
class ObjectHolder
{
protected:
	T m_object;
};

class NotCopyable
{
public:
	NotCopyable() {}
private:
    NotCopyable(const NotCopyable &);
    void operator=(const NotCopyable &);
};

template <class T>
struct NewObject
{
	T* operator()() const {return new T;}
};

/*! This function safely initializes a static object in a multithreaded environment without using locks.
	It may leak memory when two threads try to initialize the static object at the same time
	but this should be acceptable since each static object is only initialized once per session.
*/
template <class T, class F = NewObject<T>, int instance=0>
class Singleton
{
public:
	Singleton(F objectFactory = F()) : m_objectFactory(objectFactory) {}

	// VC60 workaround: use "..." to prevent this function from being inlined
	const T & Ref(...) const;

private:
	F m_objectFactory;
};

template <class T, class F, int instance>
const T & Singleton<T, F, instance>::Ref(...) const
{
	static simple_ptr<T> s_pObject;
	static char s_objectState = 0;

retry:
	switch (s_objectState)
	{
	case 0:
		s_objectState = 1;
		try
		{
			s_pObject.m_p = m_objectFactory();
		}
		catch(...)
		{
			s_objectState = 0;
			throw;
		}
		s_objectState = 2;
		break;
	case 1:
		goto retry;
	default:
		break;
	}
	return *s_pObject.m_p;
}

// ************** misc functions ***************

// can't use std::min or std::max in MSVC60 or Cygwin 1.1.0
template <class T> inline const T& STDMIN(const T& a, const T& b)
{
	return b < a ? b : a;
}

template <class T> inline const T& STDMAX(const T& a, const T& b)
{
	return a < b ? b : a;
}

#define RETURN_IF_NONZERO(x) unsigned int returnedValue = x; if (returnedValue) return returnedValue

// this version of the macro is fastest on Pentium 3 and Pentium 4 with MSVC 6 SP5 w/ Processor Pack
#define GETBYTE(x, y) (unsigned int)byte((x)>>(8*(y)))
// these may be faster on other CPUs/compilers
// #define GETBYTE(x, y) (unsigned int)(((x)>>(8*(y)))&255)
// #define GETBYTE(x, y) (((byte *)&(x))[y])

CRYPTOPP_DLL unsigned int Parity(unsigned long);
CRYPTOPP_DLL unsigned int BytePrecision(unsigned long);
CRYPTOPP_DLL unsigned int BitPrecision(unsigned long);
CRYPTOPP_DLL unsigned long Crop(unsigned long, unsigned int size);

inline unsigned int BitsToBytes(unsigned int bitCount)
{
	return ((bitCount+7)/(8));
}

inline unsigned int BytesToWords(unsigned int byteCount)
{
	return ((byteCount+WORD_SIZE-1)/WORD_SIZE);
}

inline unsigned int BitsToWords(unsigned int bitCount)
{
	return ((bitCount+WORD_BITS-1)/(WORD_BITS));
}

inline unsigned int BitsToDwords(unsigned int bitCount)
{
	return ((bitCount+2*WORD_BITS-1)/(2*WORD_BITS));
}

CRYPTOPP_DLL void xorbuf(byte *buf, const byte *mask, unsigned int count);
CRYPTOPP_DLL void xorbuf(byte *output, const byte *input, const byte *mask, unsigned int count);

template <class T>
inline bool IsPowerOf2(T n)
{
	return n > 0 && (n & (n-1)) == 0;
}

template <class T1, class T2>
inline T2 ModPowerOf2(T1 a, T2 b)
{
	assert(IsPowerOf2(b));
	return T2(a) & (b-1);
}

template <class T>
inline T RoundDownToMultipleOf(T n, T m)
{
	return n - (IsPowerOf2(m) ? ModPowerOf2(n, m) : (n%m));
}

template <class T>
inline T RoundUpToMultipleOf(T n, T m)
{
	return RoundDownToMultipleOf(n+m-1, m);
}

template <class T>
inline unsigned int GetAlignment(T *dummy=NULL)	// VC60 workaround
{
#if (_MSC_VER >= 1300)
	return __alignof(T);
#elif defined(__GNUC__)
	return __alignof__(T);
#else
	return sizeof(T);
#endif
}

inline bool IsAlignedOn(const void *p, unsigned int alignment)
{
	return IsPowerOf2(alignment) ? ModPowerOf2((size_t)p, alignment) == 0 : (size_t)p % alignment == 0;
}

template <class T>
inline bool IsAligned(const void *p, T *dummy=NULL)	// VC60 workaround
{
	return IsAlignedOn(p, GetAlignment<T>());
}

#ifdef IS_LITTLE_ENDIAN
	typedef LittleEndian NativeByteOrder;
#else
	typedef BigEndian NativeByteOrder;
#endif

inline ByteOrder GetNativeByteOrder()
{
	return NativeByteOrder::ToEnum();
}

inline bool NativeByteOrderIs(ByteOrder order)
{
	return order == GetNativeByteOrder();
}

template <class T>		// can't use <sstream> because GCC 2.95.2 doesn't have it
std::string IntToString(T a, unsigned int base = 10)
{
	if (a == 0)
		return "0";
	bool negate = false;
	if (a < 0)
	{
		negate = true;
		a = 0-a;	// VC .NET does not like -a
	}
	std::string result;
	while (a > 0)
	{
		T digit = a % base;
		result = char((digit < 10 ? '0' : ('a' - 10)) + digit) + result;
		a /= base;
	}
	if (negate)
		result = "-" + result;
	return result;
}

template <class T1, class T2>
inline T1 SaturatingSubtract(T1 a, T2 b)
{
	CRYPTOPP_COMPILE_ASSERT_INSTANCE(T1(-1)>0, 0);	// T1 is unsigned type
	CRYPTOPP_COMPILE_ASSERT_INSTANCE(T2(-1)>0, 1);	// T2 is unsigned type
	return T1((a > b) ? (a - b) : 0);
}

template <class T>
inline CipherDir GetCipherDir(const T &obj)
{
	return obj.IsForwardTransformation() ? ENCRYPTION : DECRYPTION;
}

void CallNewHandler();

// ************** rotate functions ***************

template <class T> inline T rotlFixed(T x, unsigned int y)
{
	assert(y < sizeof(T)*8);
	return (x<<y) | (x>>(sizeof(T)*8-y));
}

template <class T> inline T rotrFixed(T x, unsigned int y)
{
	assert(y < sizeof(T)*8);
	return (x>>y) | (x<<(sizeof(T)*8-y));
}

template <class T> inline T rotlVariable(T x, unsigned int y)
{
	assert(y < sizeof(T)*8);
	return (x<<y) | (x>>(sizeof(T)*8-y));
}

template <class T> inline T rotrVariable(T x, unsigned int y)
{
	assert(y < sizeof(T)*8);
	return (x>>y) | (x<<(sizeof(T)*8-y));
}

template <class T> inline T rotlMod(T x, unsigned int y)
{
	y %= sizeof(T)*8;
	return (x<<y) | (x>>(sizeof(T)*8-y));
}

template <class T> inline T rotrMod(T x, unsigned int y)
{
	y %= sizeof(T)*8;
	return (x>>y) | (x<<(sizeof(T)*8-y));
}

#ifdef INTEL_INTRINSICS

#pragma intrinsic(_lrotl, _lrotr)

template<> inline word32 rotlFixed<word32>(word32 x, unsigned int y)
{
	assert(y < 32);
	return y ? _lrotl(x, y) : x;
}

template<> inline word32 rotrFixed<word32>(word32 x, unsigned int y)
{
	assert(y < 32);
	return y ? _lrotr(x, y) : x;
}

template<> inline word32 rotlVariable<word32>(word32 x, unsigned int y)
{
	assert(y < 32);
	return _lrotl(x, y);
}

template<> inline word32 rotrVariable<word32>(word32 x, unsigned int y)
{
	assert(y < 32);
	return _lrotr(x, y);
}

template<> inline word32 rotlMod<word32>(word32 x, unsigned int y)
{
	return _lrotl(x, y);
}

template<> inline word32 rotrMod<word32>(word32 x, unsigned int y)
{
	return _lrotr(x, y);
}

#endif // #ifdef INTEL_INTRINSICS

#ifdef PPC_INTRINSICS

template<> inline word32 rotlFixed<word32>(word32 x, unsigned int y)
{
	assert(y < 32);
	return y ? __rlwinm(x,y,0,31) : x;
}

template<> inline word32 rotrFixed<word32>(word32 x, unsigned int y)
{
	assert(y < 32);
	return y ? __rlwinm(x,32-y,0,31) : x;
}

template<> inline word32 rotlVariable<word32>(word32 x, unsigned int y)
{
	assert(y < 32);
	return (__rlwnm(x,y,0,31));
}

template<> inline word32 rotrVariable<word32>(word32 x, unsigned int y)
{
	assert(y < 32);
	return (__rlwnm(x,32-y,0,31));
}

template<> inline word32 rotlMod<word32>(word32 x, unsigned int y)
{
	return (__rlwnm(x,y,0,31));
}

template<> inline word32 rotrMod<word32>(word32 x, unsigned int y)
{
	return (__rlwnm(x,32-y,0,31));
}

#endif // #ifdef PPC_INTRINSICS

// ************** endian reversal ***************

template <class T>
inline unsigned int GetByte(ByteOrder order, T value, unsigned int index)
{
	if (order == LITTLE_ENDIAN_ORDER)
		return GETBYTE(value, index);
	else
		return GETBYTE(value, sizeof(T)-index-1);
}

inline byte ByteReverse(byte value)
{
	return value;
}

inline word16 ByteReverse(word16 value)
{
	return rotlFixed(value, 8U);
}

inline word32 ByteReverse(word32 value)
{
#ifdef PPC_INTRINSICS

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美一区二区三区久本道91| 亚洲国产视频一区| 亚洲裸体xxx| 久久99久久99小草精品免视看| 成人av午夜影院| 日韩色在线观看| 亚洲丝袜另类动漫二区| 国产剧情一区在线| 欧美一三区三区四区免费在线看| 欧美激情综合五月色丁香小说| 亚洲va中文字幕| 色婷婷久久久亚洲一区二区三区| 337p日本欧洲亚洲大胆色噜噜| 亚洲综合丁香婷婷六月香| 国产成人a级片| 久久久久久久久一| 日日夜夜精品视频天天综合网| 91亚洲国产成人精品一区二区三| 久久精品一区蜜桃臀影院| 美美哒免费高清在线观看视频一区二区 | 亚洲国产一区二区视频| 国产91丝袜在线播放| 欧美成人在线直播| 人人超碰91尤物精品国产| 欧美在线一区二区| 亚洲欧美成aⅴ人在线观看| 国产精品一区三区| 久久久久97国产精华液好用吗| 日韩精品一区第一页| 精品视频色一区| 亚洲午夜影视影院在线观看| 欧美日韩一区二区三区视频| 亚洲一区二区四区蜜桃| 欧美亚洲一区二区在线观看| 亚洲欧美日本韩国| 在线观看亚洲专区| 亚洲制服丝袜av| 欧美性大战久久| 婷婷开心久久网| 8v天堂国产在线一区二区| 日本少妇一区二区| 日韩欧美亚洲一区二区| 精品一区二区综合| 久久久久99精品一区| 成人高清免费在线播放| 国产精品嫩草久久久久| 色综合久久综合网欧美综合网| 成人免费视频在线观看| 欧美亚洲综合在线| 久久激情五月婷婷| 欧美国产成人精品| 91麻豆成人久久精品二区三区| 亚洲午夜免费福利视频| 日韩写真欧美这视频| 国内久久婷婷综合| 国产精品福利一区二区| 在线观看亚洲成人| 日本va欧美va瓶| 国产精品麻豆99久久久久久| 欧洲av在线精品| 极品少妇xxxx精品少妇偷拍| 日本一区二区免费在线观看视频 | 亚洲国产视频a| 日韩精品一区国产麻豆| 国产福利一区二区三区| 国产精品欧美精品| 欧美片网站yy| 粉嫩蜜臀av国产精品网站| 亚洲在线中文字幕| 久久综合av免费| 日本高清不卡一区| 国产一区二区调教| 亚洲自拍欧美精品| 欧美激情艳妇裸体舞| 欧美日韩在线一区二区| 国产精品18久久久久久久久| 亚洲精品伦理在线| 欧美电影免费观看高清完整版在线 | 欧美国产日韩在线观看| 精品视频在线免费看| 国产一区二区不卡| 亚洲综合激情另类小说区| 2017欧美狠狠色| 欧美日本一区二区| 99热这里都是精品| 精品一区二区三区影院在线午夜 | 三级欧美韩日大片在线看| 中文字幕欧美日韩一区| 日韩免费福利电影在线观看| 一本色道久久综合精品竹菊| 国产精品一区二区无线| 天天色综合天天| 夜夜精品浪潮av一区二区三区| wwwwxxxxx欧美| 欧美一区二区三区系列电影| 在线视频你懂得一区二区三区| 国产精一品亚洲二区在线视频| 亚洲成人免费在线观看| 国产精品欧美经典| 久久丝袜美腿综合| 久久综合中文字幕| 日韩欧美国产1| 欧美老年两性高潮| 欧美亚洲日本国产| 一本大道久久a久久综合婷婷| 国产成人av影院| 国产麻豆9l精品三级站| 久久国产人妖系列| 91丝袜呻吟高潮美腿白嫩在线观看| 韩国av一区二区| 轻轻草成人在线| 日韩精品一卡二卡三卡四卡无卡| 亚洲成人www| 午夜久久久久久电影| 亚洲国产一区视频| 视频一区欧美精品| 免费成人深夜小野草| 伦理电影国产精品| 国产中文一区二区三区| 极品少妇一区二区三区精品视频| 免费成人在线观看| 国产乱人伦偷精品视频不卡| 国产乱码一区二区三区| 成人免费不卡视频| 97久久精品人人做人人爽| 99re成人在线| 欧美日韩一区二区三区四区五区| 欧美三级乱人伦电影| 欧美高清激情brazzers| 日韩一二三区视频| 26uuu国产在线精品一区二区| 欧美一级久久久久久久大片| 精品国产乱码久久| 国产亚洲成年网址在线观看| 中文字幕中文字幕在线一区| 中文字幕佐山爱一区二区免费| 亚洲美女视频一区| 日日摸夜夜添夜夜添精品视频| 麻豆精品一区二区三区| 国产成人超碰人人澡人人澡| 一本大道av一区二区在线播放| 欧美亚洲丝袜传媒另类| 欧美va日韩va| 亚洲视频在线观看三级| 青青草伊人久久| 成人午夜av在线| 欧美影视一区在线| 久久亚洲一区二区三区明星换脸| 久久久精品人体av艺术| 亚洲婷婷综合久久一本伊一区| 亚洲不卡在线观看| 国产美女在线观看一区| 91国在线观看| 久久久久久久一区| 亚洲午夜在线电影| 国产成人午夜精品5599| 精品视频色一区| 中文字幕免费观看一区| 午夜伦欧美伦电影理论片| 成人妖精视频yjsp地址| 欧美日韩国产一二三| 国产精品麻豆一区二区| 日本欧美在线观看| 99国产精品久久久久久久久久久| 在线综合+亚洲+欧美中文字幕| 久久精品一区二区三区不卡牛牛| 亚洲自拍与偷拍| 成人高清视频免费观看| 欧美tickle裸体挠脚心vk| 一区二区三区波多野结衣在线观看 | 亚洲成av人影院在线观看网| 国产精品一级在线| 在线播放视频一区| 亚洲欧美另类在线| 国产电影一区二区三区| 91精选在线观看| 一区二区三区蜜桃| 不卡视频一二三四| 国产拍欧美日韩视频二区| 美女高潮久久久| 欧美一二三四在线| 亚洲国产日韩a在线播放| av色综合久久天堂av综合| 久久新电视剧免费观看| 免费在线观看一区| 欧美四级电影在线观看| 中文字幕日韩一区二区| 国产a区久久久| 中文字幕免费不卡在线| 国产a精品视频| 欧美成人免费网站| 蜜桃在线一区二区三区| 91精品国产欧美一区二区18| 亚洲成av人片一区二区| 欧美性一区二区| 亚洲成av人综合在线观看| 色综合中文字幕| 一级特黄大欧美久久久| 在线观看日韩av先锋影音电影院| 亚洲欧美另类图片小说|