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

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

?? luc.h

?? 加密解密算法
?? 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一区二区三区免费野_久草精品视频
日本成人中文字幕| 国产精品美女久久久久久| 亚洲一区二区三区四区在线免费观看| 激情小说亚洲一区| 日韩欧美国产系列| 久久97超碰色| 精品国产一区二区精华| 久久av中文字幕片| 26uuu色噜噜精品一区二区| 六月婷婷色综合| 久久影院午夜片一区| 精品一区二区免费视频| 欧美系列亚洲系列| 亚洲妇女屁股眼交7| 欧美日韩精品电影| 免费亚洲电影在线| 精品国产乱码久久久久久蜜臀| 精品在线视频一区| 欧美国产精品v| 91亚洲精品久久久蜜桃网站| 一区二区三区电影在线播| 成人激情小说网站| 久久午夜国产精品| 成人黄色在线视频| 一区二区三区在线视频免费观看| 色婷婷亚洲一区二区三区| 亚洲乱码日产精品bd| 日本高清不卡一区| 日韩二区三区在线观看| 精品久久久久一区| 成人av资源站| 午夜私人影院久久久久| 日韩欧美你懂的| 懂色av一区二区三区免费看| 亚洲美腿欧美偷拍| 欧美成人一级视频| av不卡在线播放| 亚洲国产欧美一区二区三区丁香婷| 欧美一级xxx| 国产一区二区伦理片| 亚洲婷婷国产精品电影人久久| 欧美日韩国产一二三| 国产在线精品一区二区| 亚洲精品国产无套在线观| 91精品国产日韩91久久久久久| 丰满放荡岳乱妇91ww| 亚洲国产一区二区三区青草影视| 日韩你懂的电影在线观看| 99久久久精品| 美脚の诱脚舐め脚责91| 国产精品美女久久久久aⅴ国产馆| 欧美专区亚洲专区| 国产成人午夜高潮毛片| 五月天视频一区| 国产精品久久久久影院亚瑟| 色婷婷久久久亚洲一区二区三区 | 夜夜精品视频一区二区| 日韩午夜激情视频| 91免费版在线| 国产精品一区免费视频| 亚洲国产sm捆绑调教视频| 国产日韩欧美一区二区三区乱码| 97精品超碰一区二区三区| 久久精品国产色蜜蜜麻豆| 一区二区三区中文在线观看| 久久精品亚洲精品国产欧美| 7777精品伊人久久久大香线蕉经典版下载 | 美女久久久精品| 亚洲欧美日韩国产综合| 久久新电视剧免费观看| 欧美日韩国产不卡| 91国产免费观看| av一区二区不卡| 全部av―极品视觉盛宴亚洲| 亚洲精品中文在线| 国产精品久久久久久亚洲毛片| 日韩你懂的电影在线观看| 欧美肥妇bbw| 99精品一区二区| 国产黄色精品视频| 国产麻豆精品视频| 日本视频中文字幕一区二区三区| 亚洲一卡二卡三卡四卡 | 欧美一二三区精品| 欧美视频在线播放| 欧洲国内综合视频| 欧美专区亚洲专区| 欧美图片一区二区三区| 在线视频观看一区| 欧美亚洲图片小说| 色综合久久久久综合体桃花网| 成人精品免费网站| 成人h动漫精品一区二区| 成人自拍视频在线观看| 风间由美中文字幕在线看视频国产欧美| 久久国产精品无码网站| 精品一区二区三区蜜桃| 激情综合网激情| 国内精品久久久久影院一蜜桃| 九九九久久久精品| 国产一区三区三区| 狠狠狠色丁香婷婷综合激情 | 国产高清一区日本| 成人一级片网址| 91成人免费在线| 日韩精品在线看片z| 久久久久亚洲蜜桃| 国产女主播一区| 亚洲色图制服丝袜| 亚洲国产高清aⅴ视频| 中文字幕在线观看一区二区| 亚洲欧美日韩在线播放| 亚洲成人在线网站| 精品中文av资源站在线观看| 国产一区二区三区综合| 成人午夜碰碰视频| 欧美在线一区二区| 欧美xfplay| 中文字幕乱码久久午夜不卡| 色999日韩国产欧美一区二区| 日韩一区二区在线看片| 久久精品日产第一区二区三区高清版 | 国产麻豆91精品| 在线观看日韩高清av| 精品99一区二区| 亚洲一二三四在线| 丰满少妇在线播放bd日韩电影| 欧美视频完全免费看| 欧美国产日韩在线观看| 偷偷要91色婷婷| av在线播放成人| 精品久久久网站| 视频一区二区三区中文字幕| 成人午夜大片免费观看| 日韩一区二区三区观看| 亚洲图片欧美综合| 9人人澡人人爽人人精品| 精品福利二区三区| 亚洲一区二区三区在线| 成av人片一区二区| xfplay精品久久| 日韩av中文字幕一区二区 | 韩国在线一区二区| 欧美视频一区在线| 国产精品九色蝌蚪自拍| 韩国欧美国产一区| 欧美日韩大陆一区二区| 亚洲免费资源在线播放| 国产91精品欧美| 久久久亚洲午夜电影| 美女爽到高潮91| 欧美一区二区三区色| 亚洲电影一区二区三区| 色欧美88888久久久久久影院| 中日韩av电影| 成人小视频在线| 中文av一区二区| 粉嫩av亚洲一区二区图片| 久久久精品人体av艺术| 国产原创一区二区| 精品福利一二区| 黄页网站大全一区二区| 久久中文字幕电影| 国产乱色国产精品免费视频| 久久久精品天堂| 国产福利91精品一区二区三区| 久久免费午夜影院| 国产一区二区电影| 欧美激情艳妇裸体舞| 成人激情免费视频| 亚洲三级在线播放| 91久久国产综合久久| 亚洲一区自拍偷拍| 欧美男男青年gay1069videost | 亚洲精品成人天堂一二三| 99久久综合狠狠综合久久| 国产精品不卡一区二区三区| av亚洲精华国产精华精华| 综合在线观看色| 在线免费av一区| 天天综合日日夜夜精品| 精品国产一区二区三区不卡 | 国产精品国模大尺度视频| 成人精品一区二区三区中文字幕| 国产精品黄色在线观看| 91黄色免费观看| 日韩精品一二三四| 久久免费偷拍视频| 91丝袜呻吟高潮美腿白嫩在线观看| 亚洲图片你懂的| 91精品视频网| 国产超碰在线一区| 一区二区三区四区蜜桃 | 美国三级日本三级久久99| 精品国产电影一区二区| 成人黄色av电影| 亚洲与欧洲av电影| 337p粉嫩大胆噜噜噜噜噜91av| 99久久精品国产一区| 亚洲永久免费av|