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

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

?? luc.h

?? 300種加密解密算法(C++)源代碼,在VC下編譯通過
?? H
字號:
#ifndef CRYPTOPP_LUC_H
#define CRYPTOPP_LUC_H

#include "pkcspad.h"
#include "oaep.h"
#include "integer.h"

NAMESPACE_BEGIN(CryptoPP)

class LUCFunction : virtual public TrapdoorFunction
{
public:
	LUCFunction(const Integer &n, const Integer &e) : n(n), e(e) {}
	LUCFunction(BufferedTransformation &bt);
	void DEREncode(BufferedTransformation &bt) const;

	Integer ApplyFunction(const Integer &x) const;
	Integer MaxPreimage() const {return n-1;}
	Integer MaxImage() const {return n-1;}

protected:
	LUCFunction() {}	// to be used only by InvertableLUCFunction
	Integer n, e;	// these are only modified in constructors
};

class InvertableLUCFunction : public LUCFunction, public InvertableTrapdoorFunction
{
public:
	InvertableLUCFunction(const Integer &n, const Integer &e,
						  const Integer &p, const Integer &q, const Integer &u);
	// generate a random private key
	InvertableLUCFunction(RandomNumberGenerator &rng, unsigned int keybits, const Integer &eStart=17);
	InvertableLUCFunction(BufferedTransformation &bt);
	void DEREncode(BufferedTransformation &bt) const;

	Integer CalculateInverse(const Integer &x) const;

protected:
	Integer p, q, u;
};

template <class B>
class LUCPrivateKeyTemplate : public B
{
public:
	LUCPrivateKeyTemplate(const Integer &n, const Integer &e, 
				const Integer &p, const Integer &q, const Integer &u)
		: PublicKeyBaseTemplate<InvertableLUCFunction>(
			InvertableLUCFunction(n, e, p, q, u)) {}

	LUCPrivateKeyTemplate(RandomNumberGenerator &rng, unsigned int keybits, const Integer &eStart=17)
		: PublicKeyBaseTemplate<InvertableLUCFunction>(
			InvertableLUCFunction(rng, keybits, eStart)) {}

	LUCPrivateKeyTemplate(BufferedTransformation &bt)
		: PublicKeyBaseTemplate<InvertableLUCFunction>(bt) {}
};

template <class B, class V>
class LUCPublicKeyTemplate : public B
{
public:
	LUCPublicKeyTemplate(const Integer &n, const Integer &e)
		: PublicKeyBaseTemplate<LUCFunction>(LUCFunction(n, e)) {}

	LUCPublicKeyTemplate(const V &priv)
		: PublicKeyBaseTemplate<LUCFunction>(priv.GetTrapdoorFunction()) {}

	LUCPublicKeyTemplate(BufferedTransformation &bt)
		: PublicKeyBaseTemplate<LUCFunction>(bt) {}
};

// analagous to the RSA schemes defined in PKCS #1 v2.0
typedef LUCPrivateKeyTemplate<DecryptorTemplate<OAEP<SHA>, InvertableLUCFunction> >
	LUCES_OAEP_SHA_Decryptor;
typedef LUCPublicKeyTemplate<EncryptorTemplate<OAEP<SHA>, LUCFunction>, LUCES_OAEP_SHA_Decryptor>
	LUCES_OAEP_SHA_Encryptor;

typedef LUCPrivateKeyTemplate<SignerTemplate<DigestSignerTemplate<PKCS_SignaturePaddingScheme, InvertableLUCFunction>, PKCS_DecoratedHashModule<SHA> > >
	LUCSSA_PKCS1v15_SHA_Signer;
typedef LUCPublicKeyTemplate<VerifierTemplate<DigestVerifierTemplate<PKCS_SignaturePaddingScheme, LUCFunction>, PKCS_DecoratedHashModule<SHA> >, LUCSSA_PKCS1v15_SHA_Signer>
	LUCSSA_PKCS1v15_SHA_Verifier;

// ********************************************************

class LUCELG_Encryptor : public PK_FixedLengthEncryptor
{
public:
	LUCELG_Encryptor(const Integer &p, const Integer &g, const Integer &y);
	LUCELG_Encryptor(BufferedTransformation &bt);

	void DEREncode(BufferedTransformation &bt) const;

	void Encrypt(RandomNumberGenerator &rng, const byte *plainText, unsigned int plainTextLength, byte *cipherText);

	unsigned int MaxPlainTextLength() const {return STDMIN(255U, modulusLen-3);}
	unsigned int CipherTextLength() const {return 2*modulusLen;}

protected:
	LUCELG_Encryptor() {}
	void RawEncrypt(const Integer &k, const Integer &m, Integer &a, Integer &b) const;
	unsigned int ExponentBitLength() const;

	Integer p, g, y;
	unsigned int modulusLen;
};

class LUCELG_Decryptor : public LUCELG_Encryptor, public PK_FixedLengthDecryptor
{
public:
	LUCELG_Decryptor(const Integer &p, const Integer &g, const Integer &y, const Integer &x);
	LUCELG_Decryptor(RandomNumberGenerator &rng, unsigned int pbits);
	// generate a random private key, given p and g
	LUCELG_Decryptor(RandomNumberGenerator &rng, const Integer &p, const Integer &g);

	LUCELG_Decryptor(BufferedTransformation &bt);
	void DEREncode(BufferedTransformation &bt) const;

	unsigned int Decrypt(const byte *cipherText, byte *plainText);

protected:
	void RawDecrypt(const Integer &a, const Integer &b, Integer &m) const;

	Integer x;
};

// ********************************************************

class LUCELG_DigestVerifier : public DigestVerifier
{
public:
	LUCELG_DigestVerifier(const Integer &p, const Integer &q, const Integer &g, const Integer &y);
	LUCELG_DigestVerifier(BufferedTransformation &bt);

	void DEREncode(BufferedTransformation &bt) const;
	bool VerifyDigest(const byte *digest, unsigned int digestLen, const byte *signature) const;

	unsigned int MaxDigestLength() const {return UINT_MAX;}
	unsigned int DigestSignatureLength() const {return p.ByteCount()+q.ByteCount();}

protected:
	LUCELG_DigestVerifier() {}
	bool RawVerify(const Integer &m, const Integer &a, const Integer &b) const;
	Integer EncodeDigest(const byte *digest, unsigned int digestLen) const;

	Integer p, q, g, y;
};

class LUCELG_DigestSigner : public LUCELG_DigestVerifier, public DigestSigner
{
public:
	LUCELG_DigestSigner(const Integer &p, const Integer &q, const Integer &g, const Integer &y, const Integer &x);
	LUCELG_DigestSigner(RandomNumberGenerator &rng, unsigned int pbits);
	LUCELG_DigestSigner(RandomNumberGenerator &rng, const Integer &p, const Integer &q, const Integer &g);
	LUCELG_DigestSigner(BufferedTransformation &bt);

	void DEREncode(BufferedTransformation &bt) const;
	void SignDigest(RandomNumberGenerator &rng, const byte *digest, unsigned int digestLen, byte *signature) const;

protected:
	void RawSign(RandomNumberGenerator &rng, const Integer &m, Integer &a, Integer &b) const;

	Integer x;
};

template <class H>
class LUCELG_Signer : public SignerTemplate<LUCELG_DigestSigner, H>
{
	typedef SignerTemplate<LUCELG_DigestSigner, H> Base;
public:
	LUCELG_Signer(const Integer &p, const Integer &q, const Integer &g, const Integer &y, const Integer &x)
		: Base(LUCELG_DigestSigner(p, q, g, y, x)) {}

	// generate a random private key
	LUCELG_Signer(RandomNumberGenerator &rng, unsigned int keybits)
		: Base(LUCELG_DigestSigner(rng, keybits)) {}

	// generate a random private key, given p, q, and g
	LUCELG_Signer(RandomNumberGenerator &rng, const Integer &p, const Integer &q, const Integer &g)
		: Base(LUCELG_DigestSigner(rng, p, q, g)) {}

	// load a previously generated key
	LUCELG_Signer(BufferedTransformation &storedKey)
		: Base(storedKey) {}
};

template <class H>
class LUCELG_Verifier : public VerifierTemplate<LUCELG_DigestVerifier, H>
{
	typedef VerifierTemplate<LUCELG_DigestVerifier, H> Base;
public:
	LUCELG_Verifier(const Integer &p, const Integer &q, const Integer &g, const Integer &y)
		: Base(LUCELG_DigestVerifier(p, q, g, y)) {}

	// create a matching public key from a private key
	LUCELG_Verifier(const LUCELG_Signer<H> &priv)
		: Base(priv) {}

	// load a previously generated key
	LUCELG_Verifier(BufferedTransformation &storedKey)
		: Base(storedKey) {}
};

// ********************************************************

class LUCDIF : public PK_SimpleKeyAgreementDomain
{
public:
	LUCDIF(const Integer &p, const Integer &g);
	LUCDIF(RandomNumberGenerator &rng, unsigned int pbits);
	LUCDIF(BufferedTransformation &domainParams);

	void DEREncode(BufferedTransformation &domainParams) const;

	bool ValidateDomainParameters(RandomNumberGenerator &rng) const;
	unsigned int AgreedValueLength() const {return p.ByteCount();}
	unsigned int PrivateKeyLength() const {return p.ByteCount();}
	unsigned int PublicKeyLength() const {return p.ByteCount();}

	void GenerateKeyPair(RandomNumberGenerator &rng, byte *secretKey, byte *publicKey) const;
	bool Agree(byte *agreedValue, const byte *secretKey, const byte *otherPublicKey, bool validateOtherPublicKey=true) const;

	const Integer &Prime() const {return p;}
	const Integer &Generator() const {return g;}

private:
	unsigned int ExponentBitLength() const;

	Integer p, g;
};

NAMESPACE_END

#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美视频一区在线| 99久久精品免费精品国产| 亚洲精品视频一区| 欧美国产乱子伦| 久久婷婷色综合| 337p粉嫩大胆色噜噜噜噜亚洲 | 日本欧美韩国一区三区| 亚洲欧美日本在线| 亚洲自拍欧美精品| 亚洲一区二区三区影院| 亚洲一级片在线观看| 亚洲一区二区三区免费视频| 亚洲午夜成aⅴ人片| 亚洲地区一二三色| 日本三级亚洲精品| 狠狠色丁香婷婷综合| 国产一区亚洲一区| 国产成人精品免费视频网站| 成人网页在线观看| 一本久道中文字幕精品亚洲嫩| 99热在这里有精品免费| 在线观看一区二区精品视频| 欧美日韩精品专区| 日韩欧美国产一区二区三区| 26uuu色噜噜精品一区二区| 国产亚洲精品aa午夜观看| 国产精品沙发午睡系列990531| 18成人在线观看| 一区二区在线免费| 精品一区二区三区在线观看国产 | 国产精品私房写真福利视频| 中文字幕综合网| 亚洲sss视频在线视频| 激情成人综合网| 成人av在线电影| 欧美日韩国产片| 精品国产乱码久久久久久老虎| 国产精品全国免费观看高清 | 欧美久久久久久蜜桃| 欧美成va人片在线观看| 1区2区3区精品视频| 亚洲欧洲国产日韩| 日韩女优制服丝袜电影| 亚洲图片你懂的| 色综合天天综合狠狠| 欧美性色黄大片手机版| 久久久精品国产99久久精品芒果| 日韩理论片网站| 国产麻豆精品视频| 91 com成人网| 亚洲精品少妇30p| 国产综合色视频| 91行情网站电视在线观看高清版| 精品国产免费久久| 亚洲国产精品久久人人爱蜜臀 | 免费不卡在线视频| 97超碰欧美中文字幕| 精品国产乱码久久久久久牛牛 | 欧美日本在线一区| 中文字幕一区二区三区精华液| 五月激情六月综合| 91久久精品一区二区三| 久久久久久久久久久久久女国产乱| 亚洲一区免费在线观看| 成人免费毛片app| 亚洲精品在线一区二区| 奇米亚洲午夜久久精品| 欧美日本国产一区| 亚洲午夜在线观看视频在线| 99久久99久久免费精品蜜臀| 久久综合九色综合欧美98| 午夜精品久久久久久久久| 色综合久久天天综合网| 国产精品久久久久久久岛一牛影视| 国产一区在线精品| www成人在线观看| 久久国产尿小便嘘嘘尿| 91精品婷婷国产综合久久竹菊| 亚洲一区免费在线观看| 欧美视频一区在线观看| 亚洲福利一二三区| 久久久电影一区二区三区| 国产一区二区电影| 国产精品丝袜久久久久久app| 国产91精品免费| 国产精品水嫩水嫩| 91网站最新网址| 亚洲与欧洲av电影| 欧美三区免费完整视频在线观看| 一区二区三区视频在线观看| 91国在线观看| 日韩不卡一二三区| 欧美大片免费久久精品三p| 黄色日韩网站视频| 国产精品午夜在线观看| 91麻豆精东视频| 亚洲在线视频网站| 精品日产卡一卡二卡麻豆| 国产乱码精品一区二区三区av| 国产日产欧产精品推荐色| caoporn国产精品| 亚洲一卡二卡三卡四卡 | 91精品国产色综合久久不卡蜜臀| 天天综合网 天天综合色| 欧美tk丨vk视频| 成人福利视频网站| 五月天一区二区三区| 久久影院电视剧免费观看| 884aa四虎影成人精品一区| 韩国女主播一区| 亚洲天堂免费在线观看视频| 69成人精品免费视频| 国产精品一区二区久久精品爱涩| 亚洲日本va午夜在线影院| 91精品国产福利在线观看| 粉嫩高潮美女一区二区三区| 香蕉av福利精品导航| 久久天堂av综合合色蜜桃网| 色哟哟精品一区| 激情偷乱视频一区二区三区| 亚洲黄色av一区| 国产日韩欧美高清| 欧美精品v国产精品v日韩精品| 国产精品一区二区三区乱码| 亚洲高清在线视频| 国产精品国产三级国产a | 欧美r级在线观看| 91在线免费视频观看| 麻豆精品精品国产自在97香蕉| 国产精品嫩草99a| 日韩视频在线永久播放| 欧美午夜精品免费| 成人黄页毛片网站| 国产一区二区精品久久99| 天天综合色天天综合色h| 亚洲欧美日韩精品久久久久| 久久精品人人做| 欧美tk—视频vk| 欧美一级片在线看| 欧美日韩亚洲另类| 色999日韩国产欧美一区二区| 国产黑丝在线一区二区三区| 日韩激情视频在线观看| 一二三区精品福利视频| 亚洲素人一区二区| 中文文精品字幕一区二区| 久久久一区二区三区| 日韩女优电影在线观看| 日韩精品中文字幕一区| 欧美精品日日鲁夜夜添| 欧美日韩在线播| 在线亚洲免费视频| 色欧美日韩亚洲| 色综合久久久久综合体| 在线视频国产一区| 欧美日韩综合在线| 欧美日韩午夜在线视频| 欧美日韩午夜在线| 69av一区二区三区| 日韩欧美专区在线| 欧美成人一区二区三区在线观看| 欧美日韩国产另类一区| 51久久夜色精品国产麻豆| 3atv一区二区三区| 日韩视频一区在线观看| 精品av久久707| 欧美激情中文字幕| 国产精品国产自产拍在线| **性色生活片久久毛片| 亚洲影视在线播放| 午夜久久久影院| 麻豆国产91在线播放| 国产乱码一区二区三区| 成年人网站91| 色婷婷亚洲一区二区三区| 欧美在线制服丝袜| 91精品国产综合久久精品图片| 日韩免费高清电影| 国产欧美日韩视频在线观看| 国产精品美女久久久久久久久 | 亚洲自拍欧美精品| 日韩成人av影视| 国产成人精品免费视频网站| 色呦呦国产精品| 日韩欧美精品三级| 亚洲男帅同性gay1069| 五月天一区二区三区| 国产成人精品亚洲午夜麻豆| 色系网站成人免费| 欧美一二三区在线观看| 中文无字幕一区二区三区| 亚洲图片欧美色图| 国产乱码精品1区2区3区| 一本大道久久a久久综合婷婷| 欧美一级日韩免费不卡| 国产精品精品国产色婷婷| 日韩在线观看一区二区| 不卡一区二区在线| 精品欧美一区二区久久| 亚洲美女视频在线|