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

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

?? validat1.cpp

?? #include "pch.h" #include "base64.h" NAMESPACE_BEGIN(CryptoPP) static const int MAX_LINE_LENG
?? CPP
?? 第 1 頁 / 共 2 頁
字號(hào):
// validat1.cpp - written and placed in the public domain by Wei Dai

#include "pch.h"

#include "files.h"
#include "hex.h"
#include "idea.h"
#include "des.h"
#include "rc2.h"
#include "rc5.h"
#include "blowfish.h"
#include "diamond.h"
#include "wake.h"
#include "3way.h"
#include "safer.h"
#include "gost.h"
#include "shark.h"
#include "cast.h"
#include "square.h"
#include "seal.h"
#include "rc6.h"
#include "mars.h"

#include <stdlib.h>
#include <memory>
#include <iostream>
#include <iomanip>

#include "validate.h"

USING_NAMESPACE(CryptoPP)
USING_NAMESPACE(std)

bool ValidateAll()
{
	bool pass=TestSettings();

	pass=MD2Validate() && pass;
	pass=MD5Validate() && pass;
	pass=SHAValidate() && pass;
	pass=HAVALValidate() && pass;
	pass=TigerValidate() && pass;
	pass=RIPEMDValidate() && pass;

	pass=MD5MACValidate() && pass;
	pass=HMACValidate() && pass;
	pass=XMACCValidate() && pass;

	pass=DESValidate() && pass;
	pass=IDEAValidate() && pass;
	pass=SAFERValidate() && pass;
    pass=RC2Validate() && pass;
	pass=RC5Validate() && pass;
	pass=BlowfishValidate() && pass;
	pass=Diamond2Validate() && pass;
	pass=ThreeWayValidate() && pass;
	pass=GOSTValidate() && pass;
	pass=SHARKValidate() && pass;
	pass=SHARK2Validate() && pass;
	pass=CASTValidate() && pass;
	pass=SquareValidate() && pass;
	pass=SEALValidate() && pass;
	pass=RC6Validate() && pass;
	pass=MARSValidate() && pass;

	pass=BBSValidate() && pass;
	pass=DHValidate() && pass;
	pass=MQVValidate() && pass;
	pass=RSAValidate() && pass;
	pass=ElGamalValidate() && pass;
	pass=NRValidate() && pass;
	pass=DSAValidate() && pass;
	pass=LUCValidate() && pass;
	pass=LUCDIFValidate() && pass;
	pass=LUCELGValidate() && pass;
	pass=RabinValidate() && pass;
	pass=RWValidate() && pass;
	pass=BlumGoldwasserValidate() && pass;
	pass=ECPValidate() && pass;
	pass=EC2NValidate() && pass;

	if (pass)
		cout << "\nAll tests passed!\n";
	else
		cout << "\nOops!  Not all tests passed.\n";

	return pass;
}

bool TestSettings()
{
	bool pass = true;

	cout << "\nTesting Settings...\n\n";

	if (*(word32 *)"\x01\x02\x03\x04" == 0x04030201L)
	{
#ifdef IS_LITTLE_ENDIAN
		cout << "PASSED:  ";
#else
		cout << "FAILED:  ";
		pass = false;
#endif
		cout << "Your machine is little endian.\n";
	}
	else if (*(word32 *)"\x01\x02\x03\x04" == 0x01020304L)
	{
#ifndef IS_LITTLE_ENDIAN
		cout << "PASSED:  ";
#else
		cout << "FAILED:  ";
		pass = false;
#endif
		cout << "Your machine is big endian.\n";
	}
	else
	{
		cout << "FAILED:  Your machine is neither big endian nor little endian.\n";
		pass = false;
	}

	if (sizeof(byte) == 1)
		cout << "PASSED:  ";
	else
	{
		cout << "FAILED:  ";
		pass = false;
	}
	cout << "sizeof(byte) == " << sizeof(byte) << endl;

	if (sizeof(word16) == 2)
		cout << "PASSED:  ";
	else
	{
		cout << "FAILED:  ";
		pass = false;
	}
	cout << "sizeof(word16) == " << sizeof(word16) << endl;

	if (sizeof(word32) == 4)
		cout << "PASSED:  ";
	else
	{
		cout << "FAILED:  ";
		pass = false;
	}
	cout << "sizeof(word32) == " << sizeof(word32) << endl;

#ifdef WORD64_AVAILABLE
	if (sizeof(word64) == 8)
		cout << "PASSED:  ";
	else
	{
		cout << "FAILED:  ";
		pass = false;
	}
	cout << "sizeof(word64) == " << sizeof(word64) << endl;
#else
	if (sizeof(dword) >= 8)
	{
		cout << "FAILED:  sizeof(dword) >= 8, but WORD64_AVAILABLE not defined" << endl;
		pass = false;
	}
	else
		cout << "PASSED:  word64 not available" << endl;
#endif

	if (sizeof(dword) == 2*sizeof(word))
		cout << "PASSED:  ";
	else
	{
		cout << "FAILED:  ";
		pass = false;
	}
	cout << "sizeof(word) == " << sizeof(word) << ", sizeof(dword) == " << sizeof(dword) << endl;

	dword test = (dword(1)<<WORD_BITS) + 2;
	if (HIGH_WORD(test) == 1 && LOW_WORD(test) == 2)
		cout << "PASSED:  ";
	else
	{
		cout << "FAILED:  ";
		pass = false;
	}
	cout << "HIGH_WORD() and LOW_WORD() macros\n";

	if (!pass)
	{
		cout << "Some critical setting in config.h is in error.  Please fix it and recompile." << endl;
		abort();
	}
	return pass;
}

class CipherFactory
{
public:
	virtual unsigned int BlockSize() const =0;
	virtual unsigned int KeyLength() const =0;

	virtual auto_ptr<BlockTransformation> NewEncryption(const byte *key) const =0;
	virtual auto_ptr<BlockTransformation> NewDecryption(const byte *key) const =0;
};

template <class E, class D> class DefaultCipherFactory : public CipherFactory
{
public:
	unsigned int BlockSize() const {return E::BLOCKSIZE;}
	unsigned int KeyLength() const {return E::KEYLENGTH;}

	auto_ptr<BlockTransformation> NewEncryption(const byte *key) const
		{return auto_ptr<BlockTransformation>(new E(key));}
	auto_ptr<BlockTransformation> NewDecryption(const byte *key) const
		{return auto_ptr<BlockTransformation>(new D(key));}
};

template <class E, class D> class VariableCipherFactory : public CipherFactory
{
public:
	VariableCipherFactory(unsigned int keylen, unsigned int n=0) : keylen(keylen), n(n?n:keylen) {}
	unsigned int BlockSize() const {return E::BLOCKSIZE;}
	unsigned int KeyLength() const {return keylen;}

	auto_ptr<BlockTransformation> NewEncryption(const byte *key) const
		{return auto_ptr<BlockTransformation>(new E(key, n));}
	auto_ptr<BlockTransformation> NewDecryption(const byte *key) const
		{return auto_ptr<BlockTransformation>(new D(key, n));}

	unsigned int keylen, n;
};

bool BlockTransformationTest(const CipherFactory &cg, BufferedTransformation &valdata, unsigned int tuples = 0xffff)
{
	HexEncoder output(new FileSink(cout));
	SecByteBlock plain(cg.BlockSize()), cipher(cg.BlockSize()), out(cg.BlockSize()), outplain(cg.BlockSize());
	SecByteBlock key(cg.KeyLength());
	bool pass=true, fail;

	while (valdata.MaxRetrieveable() && tuples--)
	{
		valdata.Get(key, cg.KeyLength());
		valdata.Get(plain, cg.BlockSize());
		valdata.Get(cipher, cg.BlockSize());

		auto_ptr<BlockTransformation> trans = cg.NewEncryption(key);
		trans->ProcessBlock(plain, out);
		fail = memcmp(out, cipher, cg.BlockSize()) != 0;

		trans = cg.NewDecryption(key);
		trans->ProcessBlock(out, outplain);
		fail=fail || memcmp(outplain, plain, cg.BlockSize());

		pass = pass && !fail;

		cout << (fail ? "FAILED   " : "PASSED   ");
		output.Put(key, cg.KeyLength());
		cout << "   ";
		output.Put(outplain, cg.BlockSize());
		cout << "   ";
		output.Put(out, cg.BlockSize());
		cout << endl;
	}
	return pass;
}

bool DESValidate()
{
	cout << "\nDES validation suite running...\n\n";

	FileSource valdata("descert.dat", true, new HexDecoder);
	return BlockTransformationTest(DefaultCipherFactory<DESEncryption, DESDecryption>(), valdata);
}

bool IDEAValidate()
{
	cout << "\nIDEA validation suite running...\n\n";

	FileSource valdata("ideaval.dat", true, new HexDecoder);
	return BlockTransformationTest(DefaultCipherFactory<IDEAEncryption, IDEADecryption>(), valdata);
}

bool SAFERValidate()
{
	cout << "\nSAFER validation suite running...\n\n";

	FileSource valdata("saferval.dat", true, new HexDecoder);
	bool pass = true;
	pass = BlockTransformationTest(DefaultCipherFactory<SAFER_K64_Encryption, SAFER_K64_Decryption>(), valdata, 4) && pass;
	pass = BlockTransformationTest(VariableCipherFactory<SAFER_K128_Encryption, SAFER_K128_Decryption>(16,12), valdata, 4) && pass;
	pass = BlockTransformationTest(VariableCipherFactory<SAFER_SK64_Encryption, SAFER_SK64_Decryption>(8,6), valdata, 4) && pass;
	pass = BlockTransformationTest(DefaultCipherFactory<SAFER_SK128_Encryption, SAFER_SK128_Decryption>(), valdata, 4) && pass;
	return pass;
}

bool RC2Validate()
{
	FileSource valdata("rc2val.dat", true, new HexDecoder);
	HexEncoder output(new FileSink(cout));
	SecByteBlock plain(RC2Encryption::BLOCKSIZE), cipher(RC2Encryption::BLOCKSIZE), out(RC2Encryption::BLOCKSIZE), outplain(RC2Encryption::BLOCKSIZE);
	SecByteBlock key(128);
	bool pass=true, fail;

	while (valdata.MaxRetrieveable())
	{
		byte keyLen, effectiveLen;

		valdata.Get(keyLen);
		valdata.Get(effectiveLen);
		valdata.Get(key, keyLen);
		valdata.Get(plain, RC2Encryption::BLOCKSIZE);
		valdata.Get(cipher, RC2Encryption::BLOCKSIZE);

		auto_ptr<BlockTransformation> trans(new RC2Encryption(key, keyLen, effectiveLen));
		trans->ProcessBlock(plain, out);
		fail = memcmp(out, cipher, RC2Encryption::BLOCKSIZE) != 0;

		trans = auto_ptr<BlockTransformation>(new RC2Decryption(key, keyLen, effectiveLen));
		trans->ProcessBlock(out, outplain);
		fail=fail || memcmp(outplain, plain, RC2Encryption::BLOCKSIZE);

		pass = pass && !fail;

		cout << (fail ? "FAILED   " : "PASSED   ");
		output.Put(key, keyLen);
		cout << "   ";
		output.Put(outplain, RC2Encryption::BLOCKSIZE);
		cout << "   ";
		output.Put(out, RC2Encryption::BLOCKSIZE);
		cout << endl;
	}
	return pass;
}

bool RC4Validate()
{
	return true;
#if 0
unsigned char Key0[] = {0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef };
unsigned char Input0[]={0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef};
unsigned char Output0[] = {0x75,0xb7,0x87,0x80,0x99,0xe0,0xc5,0x96};

unsigned char Key1[]={0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef};
unsigned char Input1[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
unsigned char Output1[]={0x74,0x94,0xc2,0xe7,0x10,0x4b,0x08,0x79};

unsigned char Key2[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
unsigned char Input2[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
unsigned char Output2[]={0xde,0x18,0x89,0x41,0xa3,0x37,0x5d,0x3a};

unsigned char Key3[]={0xef,0x01,0x23,0x45};
unsigned char Input3[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
unsigned char Output3[]={0xd6,0xa1,0x41,0xa7,0xec,0x3c,0x38,0xdf,0xbd,0x61};

unsigned char Key4[]={ 0x01,0x23,0x45,0x67,0x89,0xab, 0xcd,0xef };
unsigned char Input4[] =
{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91视频在线观看| 韩国女主播一区| 日韩欧美专区在线| 91丨porny丨中文| 精品影视av免费| 亚洲国产成人精品视频| 国产欧美日韩麻豆91| 欧美一级专区免费大片| 欧美中文字幕一二三区视频| 美女视频免费一区| 亚洲一区二区免费视频| 国产精品乱码久久久久久| 日韩一二三区不卡| 欧美福利一区二区| 欧美日韩亚洲丝袜制服| 91丨porny丨首页| 成人精品免费网站| www.日本不卡| 国产亚洲欧美日韩在线一区| 国产精品一区二区三区四区| 午夜激情一区二区三区| 亚洲图片自拍偷拍| 亚洲欧洲日产国产综合网| ww久久中文字幕| 国产欧美日韩精品在线| 国产精品日韩成人| 亚洲同性gay激情无套| 亚洲三级在线看| 亚洲国产欧美另类丝袜| 五月天一区二区三区| 日本欧美一区二区三区乱码| 美女免费视频一区二区| 国产专区综合网| 91免费在线视频观看| 欧美日韩在线观看一区二区| 欧美女孩性生活视频| www久久久久| 亚洲欧美在线观看| 日韩国产一二三区| 国产专区欧美精品| 99久久精品99国产精品| 欧美高清视频不卡网| 欧美mv日韩mv国产网站app| 久久久蜜桃精品| 一区二区成人在线视频| 久草在线在线精品观看| 色综合久久88色综合天天免费| 在线观看www91| 欧美国产综合一区二区| 亚洲一区二区视频在线观看| 国产成人aaa| 欧美精品久久天天躁| 国产精品久久久久毛片软件| 午夜激情一区二区| 99v久久综合狠狠综合久久| 欧美一区二区三区在线视频| 中文字幕中文乱码欧美一区二区 | 91美女片黄在线观看91美女| 91精品久久久久久蜜臀| 成人免费在线视频观看| 精品夜夜嗨av一区二区三区| 欧美另类z0zxhd电影| 国产精品久久免费看| 久草这里只有精品视频| 538prom精品视频线放| 伊人开心综合网| aaa国产一区| 亚洲国产成人私人影院tom| 麻豆国产91在线播放| 欧美妇女性影城| 日韩黄色一级片| 91精品国产91久久综合桃花| 亚洲777理论| 6080国产精品一区二区| 久久精品国产成人一区二区三区| 国产精品自在欧美一区| 在线亚洲人成电影网站色www| 国产女人18毛片水真多成人如厕 | 亚洲图片自拍偷拍| 欧美私人免费视频| 日韩专区欧美专区| 日韩欧美你懂的| 国产精品99久| 一区二区三区在线不卡| 欧美视频在线观看一区| 日本不卡视频一二三区| 欧美一区二区三区日韩| 久久成人久久爱| 国产精品美女视频| 欧洲一区在线电影| 狠狠色综合色综合网络| 亚洲国产高清不卡| 91视频免费播放| 免费成人在线影院| 久久精品视频在线免费观看| 91麻豆免费观看| 毛片基地黄久久久久久天堂| 欧美国产一区视频在线观看| 欧美色成人综合| 成人免费视频一区二区| 午夜欧美在线一二页| 国产婷婷色一区二区三区| 在线观看日韩国产| 福利一区二区在线观看| 五月激情六月综合| 亚洲精品视频在线观看网站| 欧美电影免费观看高清完整版 | 色综合久久久久久久久久久| 麻豆精品一区二区av白丝在线| 国产精品理论片| 久久久久久久综合日本| 欧美美女一区二区在线观看| 成人av在线电影| 国内国产精品久久| 国内精品久久久久影院一蜜桃| 亚洲视频香蕉人妖| 国产欧美一区视频| 欧美变态口味重另类| 欧美性生活一区| 91麻豆免费在线观看| 成人av网站在线| 成人高清伦理免费影院在线观看| 日本欧美一区二区| 毛片不卡一区二区| 男男成人高潮片免费网站| 秋霞成人午夜伦在线观看| 亚洲国产日韩一区二区| 一区二区三区加勒比av| 亚洲成av人片| 全国精品久久少妇| 国产毛片精品视频| 国产剧情在线观看一区二区 | 亚洲欧美另类综合偷拍| 91视频国产观看| 懂色一区二区三区免费观看| 极品销魂美女一区二区三区| 奇米一区二区三区| 久99久精品视频免费观看| 国产一区二区三区视频在线播放| 久久99精品国产91久久来源| 国产一区二区三区免费看| 不卡电影一区二区三区| 91福利国产精品| 日韩精品一区二区三区视频在线观看| 欧美一区二区三区人| 久久久久国色av免费看影院| 中文字幕一区二区三区在线播放| 亚洲黄网站在线观看| 免费黄网站欧美| 成人免费高清在线| 欧美日韩免费视频| 久久久久青草大香线综合精品| 国产精品妹子av| 天天操天天色综合| caoporn国产精品| 91精品在线麻豆| 国产精品免费视频一区| 日韩高清一级片| 欧美亚洲精品一区| 国产欧美一区二区精品婷婷| 亚洲18色成人| 欧美日韩视频在线一区二区| 久久理论电影网| 七七婷婷婷婷精品国产| 91福利国产精品| 亚洲精品视频一区| 99久久国产综合精品麻豆| 国产色婷婷亚洲99精品小说| 日本视频一区二区三区| 欧美三级视频在线| 亚洲永久精品国产| 一本大道综合伊人精品热热| 国产精品三级电影| 高清久久久久久| 欧美国产精品一区| 99在线精品一区二区三区| 国产亚洲精品7777| 国产69精品久久99不卡| 国产日本欧洲亚洲| 99久久精品情趣| 亚洲一区二区三区不卡国产欧美| 色综合久久综合| 天堂av在线一区| 日韩一区二区三区在线观看 | 丁香六月久久综合狠狠色| 久久久精品人体av艺术| 成人综合婷婷国产精品久久蜜臀 | 中文字幕在线一区| 91视频com| 午夜精品aaa| 久久久噜噜噜久久人人看| 99re热这里只有精品视频| 国产精品免费视频观看| 欧美三级欧美一级| 另类中文字幕网| 亚洲色图制服丝袜| 欧美日本高清视频在线观看| 国产专区综合网| 亚洲一区二区三区中文字幕在线| 日韩欧美资源站|