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

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

?? pubkey.h

?? 研讀AxCrypt對加解密的處理方法
?? H
?? 第 1 頁 / 共 5 頁
字號:
// pubkey.h - written and placed in the public domain by Wei Dai

#ifndef CRYPTOPP_PUBKEY_H
#define CRYPTOPP_PUBKEY_H

/** \file

	This file contains helper classes/functions for implementing public key algorithms.

	The class hierachies in this .h file tend to look like this:
<pre>
                  x1
                 / \
                y1  z1
                 |  |
            x2<y1>  x2<z1>
                 |  |
                y2  z2
                 |  |
            x3<y2>  x3<z2>
                 |  |
                y3  z3
</pre>
	- x1, y1, z1 are abstract interface classes defined in cryptlib.h
	- x2, y2, z2 are implementations of the interfaces using "abstract policies", which
	  are pure virtual functions that should return interfaces to interchangeable algorithms.
	  These classes have "Base" suffixes.
	- x3, y3, z3 hold actual algorithms and implement those virtual functions.
	  These classes have "Impl" suffixes.

	The "TF_" prefix means an implementation using trapdoor functions on integers.
	The "DL_" prefix means an implementation using group operations (in groups where discrete log is hard).
*/

#include "modarith.h"
#include "filters.h"
#include "eprecomp.h"
#include "fips140.h"
#include "argnames.h"
#include <memory>

// VC60 workaround: this macro is defined in shlobj.h and conflicts with a template parameter used in this file
#undef INTERFACE

NAMESPACE_BEGIN(CryptoPP)

//! _
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TrapdoorFunctionBounds
{
public:
	virtual ~TrapdoorFunctionBounds() {}

	virtual Integer PreimageBound() const =0;
	virtual Integer ImageBound() const =0;
	virtual Integer MaxPreimage() const {return --PreimageBound();}
	virtual Integer MaxImage() const {return --ImageBound();}
};

//! _
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE RandomizedTrapdoorFunction : public TrapdoorFunctionBounds
{
public:
	virtual Integer ApplyRandomizedFunction(RandomNumberGenerator &rng, const Integer &x) const =0;
	virtual bool IsRandomized() const {return true;}
};

//! _
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TrapdoorFunction : public RandomizedTrapdoorFunction
{
public:
	Integer ApplyRandomizedFunction(RandomNumberGenerator &rng, const Integer &x) const
		{return ApplyFunction(x);}
	bool IsRandomized() const {return false;}

	virtual Integer ApplyFunction(const Integer &x) const =0;
};

//! _
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE RandomizedTrapdoorFunctionInverse
{
public:
	virtual ~RandomizedTrapdoorFunctionInverse() {}

	virtual Integer CalculateRandomizedInverse(RandomNumberGenerator &rng, const Integer &x) const =0;
	virtual bool IsRandomized() const {return true;}
};

//! _
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TrapdoorFunctionInverse : public RandomizedTrapdoorFunctionInverse
{
public:
	virtual ~TrapdoorFunctionInverse() {}

	Integer CalculateRandomizedInverse(RandomNumberGenerator &rng, const Integer &x) const
		{return CalculateInverse(rng, x);}
	bool IsRandomized() const {return false;}

	virtual Integer CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const =0;
};

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

//! message encoding method for public key encryption
class CRYPTOPP_NO_VTABLE PK_EncryptionMessageEncodingMethod
{
public:
	virtual ~PK_EncryptionMessageEncodingMethod() {}

	virtual bool ParameterSupported(const char *name) const {return false;}

	//! max size of unpadded message in bytes, given max size of padded message in bits (1 less than size of modulus)
	virtual unsigned int MaxUnpaddedLength(unsigned int paddedLength) const =0;

	virtual void Pad(RandomNumberGenerator &rng, const byte *raw, unsigned int inputLength, byte *padded, unsigned int paddedBitLength, const NameValuePairs &parameters) const =0;

	virtual DecodingResult Unpad(const byte *padded, unsigned int paddedBitLength, byte *raw, const NameValuePairs &parameters) const =0;
};

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

//! _
template <class TFI, class MEI>
class CRYPTOPP_NO_VTABLE TF_Base
{
protected:
	virtual const TrapdoorFunctionBounds & GetTrapdoorFunctionBounds() const =0;

	typedef TFI TrapdoorFunctionInterface;
	virtual const TrapdoorFunctionInterface & GetTrapdoorFunctionInterface() const =0;

	typedef MEI MessageEncodingInterface;
	virtual const MessageEncodingInterface & GetMessageEncodingInterface() const =0;
};

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

//! _
template <class BASE>
class CRYPTOPP_NO_VTABLE PK_FixedLengthCryptoSystemImpl : public BASE
{
public:
	unsigned int MaxPlaintextLength(unsigned int ciphertextLength) const
		{return ciphertextLength == FixedCiphertextLength() ? FixedMaxPlaintextLength() : 0;}
	unsigned int CiphertextLength(unsigned int plaintextLength) const
		{return plaintextLength <= FixedMaxPlaintextLength() ? FixedCiphertextLength() : 0;}

	virtual unsigned int FixedMaxPlaintextLength() const =0;
	virtual unsigned int FixedCiphertextLength() const =0;
};

//! _
template <class INTERFACE, class BASE>
class CRYPTOPP_NO_VTABLE TF_CryptoSystemBase : public PK_FixedLengthCryptoSystemImpl<INTERFACE>, protected BASE
{
public:
	bool ParameterSupported(const char *name) const {return this->GetMessageEncodingInterface().ParameterSupported(name);}
	unsigned int FixedMaxPlaintextLength() const {return this->GetMessageEncodingInterface().MaxUnpaddedLength(PaddedBlockBitLength());}
	unsigned int FixedCiphertextLength() const {return this->GetTrapdoorFunctionBounds().MaxImage().ByteCount();}

protected:
	unsigned int PaddedBlockByteLength() const {return BitsToBytes(PaddedBlockBitLength());}
	unsigned int PaddedBlockBitLength() const {return this->GetTrapdoorFunctionBounds().PreimageBound().BitCount()-1;}
};

//! _
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TF_DecryptorBase : public TF_CryptoSystemBase<PK_Decryptor, TF_Base<TrapdoorFunctionInverse, PK_EncryptionMessageEncodingMethod> >
{
public:
	DecodingResult Decrypt(RandomNumberGenerator &rng, const byte *ciphertext, unsigned int ciphertextLength, byte *plaintext, const NameValuePairs &parameters = g_nullNameValuePairs) const;
};

//! _
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TF_EncryptorBase : public TF_CryptoSystemBase<PK_Encryptor, TF_Base<RandomizedTrapdoorFunction, PK_EncryptionMessageEncodingMethod> >
{
public:
	void Encrypt(RandomNumberGenerator &rng, const byte *plaintext, unsigned int plaintextLength, byte *ciphertext, const NameValuePairs &parameters = g_nullNameValuePairs) const;
};

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

typedef std::pair<const byte *, unsigned int> HashIdentifier;

//! interface for message encoding method for public key signature schemes
class CRYPTOPP_NO_VTABLE PK_SignatureMessageEncodingMethod
{
public:
	virtual ~PK_SignatureMessageEncodingMethod() {}

	virtual unsigned int MaxRecoverableLength(unsigned int representativeBitLength, unsigned int hashIdentifierLength, unsigned int digestLength) const
		{return 0;}

	bool IsProbabilistic() const 
		{return true;}
	bool AllowNonrecoverablePart() const
		{throw NotImplemented("PK_MessageEncodingMethod: this signature scheme does not support message recovery");}
	virtual bool RecoverablePartFirst() const
		{throw NotImplemented("PK_MessageEncodingMethod: this signature scheme does not support message recovery");}

	// for verification, DL
	virtual void ProcessSemisignature(HashTransformation &hash, const byte *semisignature, unsigned int semisignatureLength) const {}

	// for signature
	virtual void ProcessRecoverableMessage(HashTransformation &hash, 
		const byte *recoverableMessage, unsigned int recoverableMessageLength, 
		const byte *presignature, unsigned int presignatureLength,
		SecByteBlock &semisignature) const
	{
		if (RecoverablePartFirst())
			assert(!"ProcessRecoverableMessage() not implemented");
	}

	virtual void ComputeMessageRepresentative(RandomNumberGenerator &rng, 
		const byte *recoverableMessage, unsigned int recoverableMessageLength,
		HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty,
		byte *representative, unsigned int representativeBitLength) const =0;

	virtual bool VerifyMessageRepresentative(
		HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty,
		byte *representative, unsigned int representativeBitLength) const =0;

	virtual DecodingResult RecoverMessageFromRepresentative(	// for TF
		HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty,
		byte *representative, unsigned int representativeBitLength,
		byte *recoveredMessage) const
		{throw NotImplemented("PK_MessageEncodingMethod: this signature scheme does not support message recovery");}

	virtual DecodingResult RecoverMessageFromSemisignature(		// for DL
		HashTransformation &hash, HashIdentifier hashIdentifier,
		const byte *presignature, unsigned int presignatureLength,
		const byte *semisignature, unsigned int semisignatureLength,
		byte *recoveredMessage) const
		{throw NotImplemented("PK_MessageEncodingMethod: this signature scheme does not support message recovery");}

	// VC60 workaround
	struct HashIdentifierLookup
	{
		template <class H> struct HashIdentifierLookup2
		{
			static HashIdentifier Lookup()
			{
				return HashIdentifier(NULL, 0);
			}
		};
	};
};

class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_DeterministicSignatureMessageEncodingMethod : public PK_SignatureMessageEncodingMethod
{
public:
	bool VerifyMessageRepresentative(
		HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty,
		byte *representative, unsigned int representativeBitLength) const;
};

class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_RecoverableSignatureMessageEncodingMethod : public PK_SignatureMessageEncodingMethod
{
public:
	bool VerifyMessageRepresentative(
		HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty,
		byte *representative, unsigned int representativeBitLength) const;
};

class CRYPTOPP_DLL DL_SignatureMessageEncodingMethod_DSA : public PK_DeterministicSignatureMessageEncodingMethod
{
public:
	void ComputeMessageRepresentative(RandomNumberGenerator &rng, 
		const byte *recoverableMessage, unsigned int recoverableMessageLength,
		HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty,
		byte *representative, unsigned int representativeBitLength) const;
};

class CRYPTOPP_DLL DL_SignatureMessageEncodingMethod_NR : public PK_DeterministicSignatureMessageEncodingMethod
{
public:
	void ComputeMessageRepresentative(RandomNumberGenerator &rng, 
		const byte *recoverableMessage, unsigned int recoverableMessageLength,
		HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty,
		byte *representative, unsigned int representativeBitLength) const;
};

class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_MessageAccumulatorBase : public PK_MessageAccumulator
{
public:
	PK_MessageAccumulatorBase() : m_empty(true) {}

	virtual HashTransformation & AccessHash() =0;

	void Update(const byte *input, unsigned int length)
	{
		AccessHash().Update(input, length);
		m_empty = m_empty && length == 0;
	}

	SecByteBlock m_recoverableMessage, m_representative, m_presignature, m_semisignature;
	Integer m_k, m_s;
	bool m_empty;
};

template <class HASH_ALGORITHM>
class PK_MessageAccumulatorImpl : public PK_MessageAccumulatorBase, protected ObjectHolder<HASH_ALGORITHM>
{
public:
	HashTransformation & AccessHash() {return this->m_object;}
};

//! _
template <class INTERFACE, class BASE>
class CRYPTOPP_NO_VTABLE TF_SignatureSchemeBase : public INTERFACE, protected BASE
{
public:
	unsigned int SignatureLength() const 
		{return this->GetTrapdoorFunctionBounds().MaxPreimage().ByteCount();}
	unsigned int MaxRecoverableLength() const 
		{return this->GetMessageEncodingInterface().MaxRecoverableLength(MessageRepresentativeBitLength(), GetHashIdentifier().second, GetDigestSize());}
	unsigned int MaxRecoverableLengthFromSignatureLength(unsigned int signatureLength) const
		{return this->MaxRecoverableLength();}

	bool IsProbabilistic() const 
		{return this->GetTrapdoorFunctionInterface().IsRandomized() || this->GetMessageEncodingInterface().IsProbabilistic();}
	bool AllowNonrecoverablePart() const 
		{return this->GetMessageEncodingInterface().AllowNonrecoverablePart();}
	bool RecoverablePartFirst() const 
		{return this->GetMessageEncodingInterface().RecoverablePartFirst();}

protected:
	unsigned int MessageRepresentativeLength() const {return BitsToBytes(MessageRepresentativeBitLength());}
	unsigned int MessageRepresentativeBitLength() const {return this->GetTrapdoorFunctionBounds().ImageBound().BitCount()-1;}
	virtual HashIdentifier GetHashIdentifier() const =0;
	virtual unsigned int GetDigestSize() const =0;
};

//! _

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人一区二区三区中文字幕| 精品国产亚洲在线| 亚洲国产视频a| 日韩精品中文字幕在线不卡尤物| 一区二区三区资源| 欧美色综合久久| 亚洲国产中文字幕| 欧美一区二区三区日韩视频| 日韩精品免费视频人成| 日韩欧美一区二区视频| 美国av一区二区| 国产精品久久久久影视| 91精品国产综合久久蜜臀| 国产精品一级黄| 一区二区国产视频| 国产亚洲欧美日韩在线一区| 91亚洲男人天堂| 午夜久久久久久久久| 国产性天天综合网| 日韩欧美国产一区在线观看| 91蝌蚪porny九色| 国产精品一区二区在线观看不卡| 国产精品福利影院| 久久―日本道色综合久久| 91黄色激情网站| 国产在线精品视频| 五月天亚洲婷婷| 亚洲福利视频导航| 亚洲最大成人网4388xx| 亚洲色大成网站www久久九九| 久久久久久久久久久黄色| 欧美美女直播网站| 一本到一区二区三区| 国产剧情av麻豆香蕉精品| 五月天亚洲精品| 首页国产丝袜综合| 日韩精品视频网站| 韩国成人精品a∨在线观看| 久久99精品国产麻豆婷婷洗澡| 中文字幕亚洲一区二区av在线| 久久精品亚洲乱码伦伦中文| 日韩丝袜情趣美女图片| 久久久亚洲精华液精华液精华液 | 免费观看成人鲁鲁鲁鲁鲁视频| 亚洲电影一区二区| 五月婷婷另类国产| 激情成人综合网| 精品一区二区免费在线观看| 九一久久久久久| 成人av免费在线| 制服丝袜亚洲播放| 最新国产成人在线观看| 亚洲午夜在线视频| 国产美女精品一区二区三区| 成人午夜在线播放| 欧美日韩黄色影视| 国产精品第一页第二页第三页| 亚洲男人的天堂一区二区| 亚洲第四色夜色| 国产乱对白刺激视频不卡| 一本到三区不卡视频| 欧美日韩1区2区| 国产精品久久久久久久久久免费看| 亚洲国产日韩综合久久精品| 国模无码大尺度一区二区三区| 在线观看视频一区二区欧美日韩| 久久免费午夜影院| 亚洲高清中文字幕| 成人sese在线| 国产精品婷婷午夜在线观看| 国产老肥熟一区二区三区| 精品福利一二区| 日韩精品成人一区二区三区| 色偷偷88欧美精品久久久| 久久久精品免费观看| 国产一区二区三区黄视频 | 夜夜嗨av一区二区三区网页| 国产精品亚洲视频| 国产偷国产偷亚洲高清人白洁| 国内外精品视频| 欧美精品一区二区三| 美女精品自拍一二三四| 91精品在线观看入口| 天堂资源在线中文精品| 色88888久久久久久影院野外| 亚洲国产另类av| 欧美久久久久免费| 捆绑紧缚一区二区三区视频| 欧美疯狂性受xxxxx喷水图片| 一区二区三区高清| 91麻豆精品国产91久久久资源速度 | 国产免费久久精品| 欧美伊人精品成人久久综合97 | 美女一区二区视频| 久久久久国产精品人| 91在线视频网址| 国产一区二区日韩精品| 亚洲免费毛片网站| 日韩欧美国产综合一区 | 一区二区三区免费观看| 欧美一区二区三区婷婷月色| 99久久免费精品| 精品在线一区二区| 91精品国产一区二区三区| 国产91精品在线观看| 1000精品久久久久久久久| 911国产精品| 欧美三片在线视频观看| 亚洲精品在线一区二区| 欧美国产国产综合| 天堂久久久久va久久久久| 国产一区二区三区免费看| 色综合亚洲欧洲| 日韩三级在线观看| 亚洲视频狠狠干| 懂色av噜噜一区二区三区av| 欧美视频你懂的| 国产日韩成人精品| 久久精品国产精品亚洲精品| 91免费观看视频在线| 精品精品欲导航| 午夜成人免费视频| 欧美另类变人与禽xxxxx| 国产精品视频一二三| 另类成人小视频在线| 欧美唯美清纯偷拍| 亚洲精品成人在线| 99久久精品国产毛片| 久久精品视频在线免费观看| 日韩精品乱码免费| 在线综合+亚洲+欧美中文字幕| 欧美一级xxx| 一级日本不卡的影视| 播五月开心婷婷综合| 国产精品久久久久婷婷| 高清不卡一区二区在线| 国产亚洲欧美日韩在线一区| 精品午夜久久福利影院| 久久综合一区二区| 成人h动漫精品一区二| 中文字幕一区日韩精品欧美| 91在线无精精品入口| 亚洲成人在线观看视频| 亚洲精品在线电影| 国产成人精品综合在线观看| 欧洲精品在线观看| 性感美女久久精品| 国产亚洲成年网址在线观看| 99久久久国产精品| 天堂在线一区二区| 亚洲成人精品一区二区| 欧美sm极限捆绑bd| 成人丝袜高跟foot| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 国产精品白丝jk白祙喷水网站 | 亚洲在线中文字幕| 亚洲精品在线电影| 欧美大片在线观看一区二区| 成人激情免费电影网址| 亚洲成av人片观看| 日本一二三不卡| 精品国产乱码久久久久久久久 | 精品国一区二区三区| 色综合激情久久| 国产精品影视天天线| 六月丁香婷婷色狠狠久久| 亚洲午夜免费电影| 亚洲人成网站色在线观看 | 中文字幕日本不卡| 欧美精品久久久久久久多人混战| av午夜一区麻豆| 国产在线播放一区| 韩国v欧美v亚洲v日本v| 欧美aaaaaa午夜精品| 蜜桃91丨九色丨蝌蚪91桃色| 性做久久久久久久免费看| 亚洲午夜av在线| 视频精品一区二区| 日本亚洲电影天堂| 久99久精品视频免费观看| 国产美女娇喘av呻吟久久| 男人的天堂久久精品| 日一区二区三区| 国产成人综合精品三级| a亚洲天堂av| 91免费在线视频观看| 欧美亚洲综合网| 91精品黄色片免费大全| 精品成人a区在线观看| 国产精品视频线看| 亚洲一区二区三区在线| 午夜精品久久久久久久99水蜜桃 | 国产一区在线看| 欧美伊人久久久久久久久影院 | 亚洲精品中文字幕乱码三区| 日本视频免费一区| 白白色 亚洲乱淫| 欧美色偷偷大香| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 极品销魂美女一区二区三区|