亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
精品国产乱码久久久久久夜甘婷婷| 这里是久久伊人| 一二三区精品福利视频| 欧美精品粉嫩高潮一区二区| 性欧美疯狂xxxxbbbb| 日韩欧美高清dvd碟片| 国产激情精品久久久第一区二区| 亚洲欧美激情小说另类| 欧美成人vps| 91久久精品网| 九一久久久久久| 亚洲精品视频免费看| 久久日一线二线三线suv| 精彩视频一区二区| 欧美极品另类videosde| 欧美日韩国产三级| 国产精品99久久久久久久vr| 亚洲小说欧美激情另类| 日本一区二区视频在线| 91精品国产91久久综合桃花| 99国产精品视频免费观看| 免费人成黄页网站在线一区二区| 精品国免费一区二区三区| 99免费精品视频| 亚洲va中文字幕| 亚洲国产激情av| 日韩欧美www| 91丝袜美腿高跟国产极品老师| 久久精品国产亚洲一区二区三区| 亚洲在线中文字幕| 国产精品久久久久影院亚瑟 | 成人sese在线| 精品一区二区三区视频在线观看| 樱花草国产18久久久久| 国产午夜亚洲精品羞羞网站| 日韩精品一区二区三区四区| 欧美日韩大陆一区二区| 色天天综合久久久久综合片| 北条麻妃一区二区三区| 国产成人精品亚洲午夜麻豆| 免播放器亚洲一区| 久久精品国产精品亚洲综合| 精品亚洲国内自在自线福利| 精品一区二区三区久久久| 久久国产欧美日韩精品| 国产一区二区精品久久91| 国产在线精品免费| 国产一区二区三区精品欧美日韩一区二区三区| 久久99久久99小草精品免视看| 日本 国产 欧美色综合| 捆绑紧缚一区二区三区视频| 国产高清不卡一区二区| 成人av影院在线| 91美女片黄在线观看91美女| 欧美四级电影在线观看| 欧美高清视频一二三区| 日韩精品专区在线影院重磅| 国产午夜精品在线观看| 亚洲视频在线一区观看| 一区二区激情小说| 日韩精品一区第一页| 韩国欧美一区二区| av电影天堂一区二区在线| 在线免费不卡电影| 欧美成人免费网站| 国产精品青草综合久久久久99| 亚洲精品伦理在线| 免费在线视频一区| 成人免费视频网站在线观看| 欧美无乱码久久久免费午夜一区| 日韩欧美中文字幕精品| 国产精品久久久久久久午夜片| 一区二区三区在线不卡| 免费高清在线一区| 成人爱爱电影网址| 欧美日韩不卡视频| 亚洲国产精品精华液2区45| 亚洲乱码精品一二三四区日韩在线| 午夜精品久久一牛影视| 国产精品自拍三区| 欧美日韩一级片网站| 久久久电影一区二区三区| 亚洲黄色免费网站| 经典三级视频一区| 欧美三级资源在线| 国产清纯白嫩初高生在线观看91| 亚洲最大成人网4388xx| 国产乱色国产精品免费视频| 色综合天天综合色综合av| 日韩欧美国产小视频| 亚洲女同一区二区| 国模娜娜一区二区三区| 亚洲天堂2014| 亚洲免费毛片网站| 日本大胆欧美人术艺术动态| 99视频精品在线| 欧美电影免费观看高清完整版 | 久久精品国产亚洲a| 色综合亚洲欧洲| 国产午夜精品福利| 美女一区二区三区| 欧洲精品视频在线观看| 久久久精品国产99久久精品芒果| 视频一区在线视频| 色婷婷国产精品| 国产精品视频在线看| 狠狠色狠狠色综合| 欧美一区二区在线播放| 一区二区三区精品在线| eeuss鲁一区二区三区| 久久一夜天堂av一区二区三区| 一区二区三区不卡在线观看| 北条麻妃一区二区三区| 久久免费偷拍视频| 久久精品国产99| 色美美综合视频| 国产精品午夜春色av| 秋霞影院一区二区| 色婷婷综合久久久久中文 | 成人一区二区三区| 爽好多水快深点欧美视频| 国产在线视视频有精品| 欧美一区三区四区| 91在线观看地址| 久久久久久久精| 成人妖精视频yjsp地址| 国产精品成人在线观看| 欧美一区二区精品在线| 欧美日韩一级二级| 91麻豆精品国产91久久久久久久久 | 蜜桃久久av一区| 欧美日本高清视频在线观看| 中文字幕日本不卡| 国产99精品在线观看| 久久久国产一区二区三区四区小说| 麻豆精品一区二区av白丝在线| 欧美一级淫片007| 老汉av免费一区二区三区 | 国产情人综合久久777777| 麻豆精品一二三| 欧美精品一区二区蜜臀亚洲| 国产麻豆成人精品| 国产精品人妖ts系列视频| 豆国产96在线|亚洲| 中文字幕亚洲电影| 91国在线观看| 亚洲第四色夜色| 91精品国产色综合久久ai换脸| 日韩vs国产vs欧美| 欧美大片在线观看一区二区| 国产精品原创巨作av| 中文字幕国产一区| 色哟哟欧美精品| 亚洲地区一二三色| 日韩欧美国产精品| 国产91丝袜在线播放| 中文字幕永久在线不卡| 色欧美片视频在线观看在线视频| 国内久久精品视频| 欧洲亚洲精品在线| 午夜精品久久久久影视| 日韩三区在线观看| 国产精品自拍在线| 亚洲美女视频一区| 欧美肥妇bbw| 国产高清精品网站| 一区二区三区四区五区视频在线观看| 欧美猛男男办公室激情| 国内不卡的二区三区中文字幕| 国产精品无遮挡| 欧美色图一区二区三区| 激情综合色丁香一区二区| 国产精品色婷婷| 欧美久久久久久蜜桃| 国产传媒久久文化传媒| 一区二区三区四区五区视频在线观看| 51久久夜色精品国产麻豆| 成人网男人的天堂| 亚洲国产色一区| 欧美激情中文不卡| 欧美日韩美少妇| 风间由美性色一区二区三区| 亚洲一区二区不卡免费| 久久综合九色综合97婷婷| 91丝袜美腿高跟国产极品老师 | 亚洲精品一二三四区| 欧美一区二区三区在线看| 成人av网站在线| 日韩专区在线视频| 中文字幕日本乱码精品影院| 日韩一卡二卡三卡| 91蜜桃免费观看视频| 久久er精品视频| 亚洲女性喷水在线观看一区| 久久久午夜精品| 91麻豆精品国产91久久久 | 自拍av一区二区三区| 日韩一级精品视频在线观看| 99国产欧美另类久久久精品| 韩日精品视频一区|