Updated documentation for Crypto++ 1.0 algorithms
parent
374105198d
commit
c77029f142
14
arc4.h
14
arc4.h
|
|
@ -16,8 +16,9 @@ NAMESPACE_BEGIN(CryptoPP)
|
|||
namespace Weak1 {
|
||||
|
||||
//! \class ARC4_Base
|
||||
//! \brief Class specific methods used to operate the cipher.
|
||||
//! \brief ARC4 base class
|
||||
//! \details Implementations and overrides in \p Base apply to both \p ENCRYPTION and \p DECRYPTION directions
|
||||
//! \since Crypto++ 1.0
|
||||
class CRYPTOPP_NO_VTABLE ARC4_Base : public VariableKeyLength<16, 1, 256>, public RandomNumberGenerator, public SymmetricCipher, public SymmetricCipherDocumentation
|
||||
{
|
||||
public:
|
||||
|
|
@ -45,11 +46,14 @@ protected:
|
|||
byte m_x, m_y;
|
||||
};
|
||||
|
||||
//! <a href="http://www.weidai.com/scan-mirror/cs.html#RC4">Alleged RC4</a>
|
||||
//! \class ARC4
|
||||
//! \brief Alleged RC4
|
||||
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#RC4">Alleged RC4</a>
|
||||
//! \since Crypto++ 1.0
|
||||
DOCUMENTED_TYPEDEF(SymmetricCipherFinal<ARC4_Base>, ARC4)
|
||||
|
||||
//! \class MARC4_Base
|
||||
//! \brief Class specific methods used to operate the cipher.
|
||||
//! \brief MARC4 base class
|
||||
//! \details Implementations and overrides in \p Base apply to both \p ENCRYPTION and \p DECRYPTION directions
|
||||
//! \details MARC4 discards the first 256 bytes of keystream, which may be weaker than the rest
|
||||
class CRYPTOPP_NO_VTABLE MARC4_Base : public ARC4_Base
|
||||
|
|
@ -64,6 +68,10 @@ protected:
|
|||
unsigned int GetDefaultDiscardBytes() const {return 256;}
|
||||
};
|
||||
|
||||
//! \class MARC4
|
||||
//! \brief Modified Alleged RC4
|
||||
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#RC4">Alleged RC4</a>
|
||||
//! \since Crypto++ 1.0
|
||||
DOCUMENTED_TYPEDEF(SymmetricCipherFinal<MARC4_Base>, MARC4)
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,8 +20,9 @@ struct Blowfish_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 4,
|
|||
|
||||
// <a href="http://www.weidai.com/scan-mirror/cs.html#Blowfish">Blowfish</a>
|
||||
|
||||
//! \class Blowfish_Info
|
||||
//! \class Blowfish
|
||||
//! \brief Blowfish block cipher
|
||||
//! \since Crypto++ 1.0
|
||||
class Blowfish : public Blowfish_Info, public BlockCipherDocumentation
|
||||
{
|
||||
//! \class Base
|
||||
|
|
|
|||
6
des.h
6
des.h
|
|
@ -39,6 +39,7 @@ struct DES_Info : public FixedBlockSize<8>, public FixedKeyLength<8>
|
|||
//! (the least significant bits of each byte) in the key. However you can use CheckKeyParityBits()
|
||||
//! and CorrectKeyParityBits() to check or correct the parity bits if you wish.
|
||||
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#DES">DES</a>
|
||||
//! \since Crypto++ 1.0
|
||||
class DES : public DES_Info, public BlockCipherDocumentation
|
||||
{
|
||||
//! \class Base
|
||||
|
|
@ -69,7 +70,8 @@ struct DES_EDE2_Info : public FixedBlockSize<8>, public FixedKeyLength<16>
|
|||
|
||||
//! \class DES_EDE2
|
||||
//! \brief 2-key TripleDES block cipher
|
||||
/// \sa <a href="http://www.weidai.com/scan-mirror/cs.html#DESede">DES-EDE2</a>
|
||||
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#DESede">DES-EDE2</a>
|
||||
//! \since Crypto++ 1.0
|
||||
class DES_EDE2 : public DES_EDE2_Info, public BlockCipherDocumentation
|
||||
{
|
||||
//! \class Base
|
||||
|
|
@ -99,6 +101,7 @@ struct DES_EDE3_Info : public FixedBlockSize<8>, public FixedKeyLength<24>
|
|||
//! \class DES_EDE3
|
||||
//! \brief 3-key TripleDES block cipher
|
||||
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#DESede">DES-EDE3</a>
|
||||
//! \since Crypto++ 1.0
|
||||
class DES_EDE3 : public DES_EDE3_Info, public BlockCipherDocumentation
|
||||
{
|
||||
//! \class Base
|
||||
|
|
@ -128,6 +131,7 @@ struct DES_XEX3_Info : public FixedBlockSize<8>, public FixedKeyLength<24>
|
|||
//! \class DES_XEX3
|
||||
//! \brief DESX block cipher
|
||||
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#DESX">DES-XEX3</a>, AKA DESX
|
||||
//! \since Crypto++ 1.0
|
||||
class DES_XEX3 : public DES_XEX3_Info, public BlockCipherDocumentation
|
||||
{
|
||||
//! \class Base
|
||||
|
|
|
|||
10
dh.h
10
dh.h
|
|
@ -19,6 +19,8 @@ NAMESPACE_BEGIN(CryptoPP)
|
|||
//! \details A Diffie-Hellman domain is a set of parameters that must be shared
|
||||
//! by two parties in a key agreement protocol, along with the algorithms
|
||||
//! for generating key pairs and deriving agreed values.
|
||||
//! \sa DL_SimpleKeyAgreementDomainBase
|
||||
//! \since Crypto++ 1.0
|
||||
template <class GROUP_PARAMETERS, class COFACTOR_OPTION = CPP_TYPENAME GROUP_PARAMETERS::DefaultCofactorOption>
|
||||
class DH_Domain : public DL_SimpleKeyAgreementDomainBase<typename GROUP_PARAMETERS::Element>
|
||||
{
|
||||
|
|
@ -30,6 +32,10 @@ public:
|
|||
typedef DL_KeyAgreementAlgorithm_DH<Element, COFACTOR_OPTION> DH_Algorithm;
|
||||
typedef DH_Domain<GROUP_PARAMETERS, COFACTOR_OPTION> Domain;
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~DH_Domain() {}
|
||||
#endif
|
||||
|
||||
//! \brief Construct a Diffie-Hellman domain
|
||||
DH_Domain() {}
|
||||
|
||||
|
|
@ -153,10 +159,6 @@ public:
|
|||
{return GroupParameters::StaticAlgorithmNamePrefix() + DH_Algorithm::StaticAlgorithmName();}
|
||||
std::string AlgorithmName() const {return StaticAlgorithmName();}
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~DH_Domain() {}
|
||||
#endif
|
||||
|
||||
private:
|
||||
const DL_KeyAgreementAlgorithm<Element> & GetKeyAgreementAlgorithm() const
|
||||
{return Singleton<DH_Algorithm>().Ref();}
|
||||
|
|
|
|||
22
dh2.h
22
dh2.h
|
|
@ -1,7 +1,6 @@
|
|||
// dh2.h - written and placed in the public domain by Wei Dai
|
||||
|
||||
//! \file
|
||||
//! \headerfile dh2.h
|
||||
//! \file dh2.h
|
||||
//! \brief Classes for Diffie-Hellman authenticated key exchange
|
||||
|
||||
#ifndef CRYPTOPP_DH2_H
|
||||
|
|
@ -11,12 +10,25 @@
|
|||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
/// <a href="http://www.weidai.com/scan-mirror/ka.html#DH2">Unified Diffie-Hellman</a>
|
||||
//! \class DH2
|
||||
//! \brief Unified Diffie-Hellman
|
||||
//! \details A Diffie-Hellman domain is a set of parameters that must be shared
|
||||
//! by two parties in a key agreement protocol, along with the algorithms
|
||||
//! for generating key pairs and deriving agreed values.
|
||||
//! \sa AuthenticatedKeyAgreementDomain, <a href="http://www.weidai.com/scan-mirror/ka.html#DH2">Unified Diffie-Hellman</a>
|
||||
//! \since Crypto++ 1.0
|
||||
class DH2 : public AuthenticatedKeyAgreementDomain
|
||||
{
|
||||
public:
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~DH2() {}
|
||||
#endif
|
||||
|
||||
//! \brief Construct a DH2
|
||||
DH2(SimpleKeyAgreementDomain &domain)
|
||||
: d1(domain), d2(domain) {}
|
||||
//! \brief Construct a DH2
|
||||
DH2(SimpleKeyAgreementDomain &staticDomain, SimpleKeyAgreementDomain &ephemeralDomain)
|
||||
: d1(staticDomain), d2(ephemeralDomain) {}
|
||||
|
||||
|
|
@ -52,10 +64,6 @@ public:
|
|||
const byte *staticOtherPublicKey, const byte *ephemeralOtherPublicKey,
|
||||
bool validateStaticOtherPublicKey=true) const;
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~DH2() {}
|
||||
#endif
|
||||
|
||||
protected:
|
||||
SimpleKeyAgreementDomain &d1, &d2;
|
||||
};
|
||||
|
|
|
|||
1
dsa.h
1
dsa.h
|
|
@ -33,6 +33,7 @@ enum DSASignatureFormat {
|
|||
//! \details This function converts between these formats, and returns length
|
||||
//! of signature in the target format. If <tt>toFormat == DSA_P1363</tt>, then
|
||||
//! <tt>bufferSize</tt> must equal <tt>publicKey.SignatureLength()</tt>
|
||||
//! \since Crypto++ 1.0
|
||||
size_t DSAConvertSignatureFormat(byte *buffer, size_t bufferSize, DSASignatureFormat toFormat,
|
||||
const byte *signature, size_t signatureLen, DSASignatureFormat fromFormat);
|
||||
|
||||
|
|
|
|||
27
elgamal.h
27
elgamal.h
|
|
@ -16,11 +16,19 @@
|
|||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
//! \class ElGamalBase
|
||||
//! \brief ElGamal key agreement and encryption schemes base class
|
||||
//! \since Crypto++ 1.0
|
||||
class CRYPTOPP_NO_VTABLE ElGamalBase : public DL_KeyAgreementAlgorithm_DH<Integer, NoCofactorMultiplication>,
|
||||
public DL_KeyDerivationAlgorithm<Integer>,
|
||||
public DL_SymmetricEncryptionAlgorithm
|
||||
{
|
||||
public:
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~ElGamalBase() {}
|
||||
#endif
|
||||
|
||||
void Derive(const DL_GroupParameters<Integer> &groupParams, byte *derivedKey, size_t derivedLength, const Integer &agreedElement, const Integer &ephemeralPublicKey, const NameValuePairs &derivationParams) const
|
||||
{
|
||||
CRYPTOPP_UNUSED(groupParams), CRYPTOPP_UNUSED(ephemeralPublicKey), CRYPTOPP_UNUSED(derivationParams);
|
||||
|
|
@ -86,16 +94,20 @@ public:
|
|||
}
|
||||
|
||||
virtual const DL_GroupParameters_GFP & GetGroupParameters() const =0;
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~ElGamalBase() {}
|
||||
#endif
|
||||
};
|
||||
|
||||
//! \class ElGamalObjectImpl
|
||||
//! \brief ElGamal key agreement and encryption schemes default implementation
|
||||
//! \since Crypto++ 1.0
|
||||
template <class BASE, class SCHEME_OPTIONS, class KEY>
|
||||
class ElGamalObjectImpl : public DL_ObjectImplBase<BASE, SCHEME_OPTIONS, KEY>, public ElGamalBase
|
||||
{
|
||||
public:
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~ElGamalObjectImpl() {}
|
||||
#endif
|
||||
|
||||
size_t FixedMaxPlaintextLength() const {return this->MaxPlaintextLength(FixedCiphertextLength());}
|
||||
size_t FixedCiphertextLength() const {return this->CiphertextLength(0);}
|
||||
|
||||
|
|
@ -104,16 +116,14 @@ public:
|
|||
DecodingResult FixedLengthDecrypt(RandomNumberGenerator &rng, const byte *cipherText, byte *plainText) const
|
||||
{return Decrypt(rng, cipherText, FixedCiphertextLength(), plainText);}
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~ElGamalObjectImpl() {}
|
||||
#endif
|
||||
|
||||
protected:
|
||||
const DL_KeyAgreementAlgorithm<Integer> & GetKeyAgreementAlgorithm() const {return *this;}
|
||||
const DL_KeyDerivationAlgorithm<Integer> & GetKeyDerivationAlgorithm() const {return *this;}
|
||||
const DL_SymmetricEncryptionAlgorithm & GetSymmetricEncryptionAlgorithm() const {return *this;}
|
||||
};
|
||||
|
||||
//! \class ElGamalKeys
|
||||
//! \brief ElGamal key agreement and encryption schemes keys
|
||||
struct ElGamalKeys
|
||||
{
|
||||
typedef DL_CryptoKeys_GFP::GroupParameters GroupParameters;
|
||||
|
|
@ -123,6 +133,7 @@ struct ElGamalKeys
|
|||
|
||||
//! \class ElGamal
|
||||
//! \brief ElGamal encryption scheme with non-standard padding
|
||||
//! \since Crypto++ 1.0
|
||||
struct ElGamal
|
||||
{
|
||||
typedef DL_CryptoSchemeOptions<ElGamal, ElGamalKeys, int, int, int> SchemeOptions;
|
||||
|
|
|
|||
|
|
@ -436,6 +436,7 @@ public:
|
|||
//! \brief DSA signature scheme
|
||||
//! \tparam H HashTransformation derived class
|
||||
//! \sa <a href="http://www.weidai.com/scan-mirror/sig.html#DSA-1363">DSA-1363</a>
|
||||
//! \since Crypto++ 1.0 for DSA, Crypto++ 5.6.2 for DSA2
|
||||
template <class H>
|
||||
struct GDSA : public DL_SS<
|
||||
DL_SignatureKeys_GFP,
|
||||
|
|
@ -508,6 +509,7 @@ struct DL_Keys_DSA
|
|||
//! \tparam H HashTransformation derived class
|
||||
//! \details The class is named DSA2 instead of DSA for backwards compatibility because DSA was a non-template class.
|
||||
//! \sa <a href="http://en.wikipedia.org/wiki/Digital_Signature_Algorithm">DSA</a>, as specified in FIPS 186-3
|
||||
//! \since Crypto++ 1.0 for DSA, Crypto++ 5.6.2 for DSA2
|
||||
template <class H>
|
||||
class DSA2 : public DL_SS<
|
||||
DL_Keys_DSA,
|
||||
|
|
@ -529,7 +531,7 @@ public:
|
|||
};
|
||||
|
||||
//! DSA with SHA-1, typedef'd for backwards compatibility
|
||||
typedef DSA2<SHA> DSA;
|
||||
typedef DSA2<SHA1> DSA;
|
||||
|
||||
CRYPTOPP_DLL_TEMPLATE_CLASS DL_PublicKey_GFP<DL_GroupParameters_DSA>;
|
||||
CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_GFP<DL_GroupParameters_DSA>;
|
||||
|
|
|
|||
34
ida.h
34
ida.h
|
|
@ -1,7 +1,7 @@
|
|||
// ida.h - written and placed in the public domain by Wei Dai
|
||||
|
||||
//! \file ida.h
|
||||
//! \brief Classes for Information Dispersal Algorithm (IDA)
|
||||
//! \brief Classes for Rabin's Information Dispersal and Shamir's Secret Sharing algorithms
|
||||
|
||||
#ifndef CRYPTOPP_IDA_H
|
||||
#define CRYPTOPP_IDA_H
|
||||
|
|
@ -16,7 +16,9 @@
|
|||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
/// base class for secret sharing and information dispersal
|
||||
//! \class RawIDA
|
||||
//! \brief Secret sharing and information dispersal base class
|
||||
//! \since Crypto++ 1.0
|
||||
class RawIDA : public AutoSignaling<Unflushable<Multichannel<Filter> > >
|
||||
{
|
||||
public:
|
||||
|
|
@ -61,10 +63,15 @@ protected:
|
|||
SecBlock<word32> m_u, m_w, m_y;
|
||||
};
|
||||
|
||||
/// a variant of Shamir's Secret Sharing Algorithm
|
||||
//! \class SecretSharing
|
||||
//! \brief Shamir's Secret Sharing Algorithm
|
||||
//! \details SecretSharing is a variant of Shamir's secret sharing algorithm
|
||||
//! \sa SecretRecovery, SecretRecovery, InformationDispersal, InformationRecovery
|
||||
//! \since Crypto++ 1.0
|
||||
class SecretSharing : public CustomFlushPropagation<Filter>
|
||||
{
|
||||
public:
|
||||
//! \brief Construct a SecretSharing
|
||||
SecretSharing(RandomNumberGenerator &rng, int threshold, int nShares, BufferedTransformation *attachment=NULL, bool addPadding=true)
|
||||
: m_rng(rng), m_ida(new OutputProxy(*this, true))
|
||||
{
|
||||
|
|
@ -82,10 +89,15 @@ protected:
|
|||
bool m_pad;
|
||||
};
|
||||
|
||||
/// a variant of Shamir's Secret Sharing Algorithm
|
||||
//! \class SecretRecovery
|
||||
//! \brief Shamir's Secret Sharing Algorithm
|
||||
//! \details SecretSharing is a variant of Shamir's secret sharing algorithm
|
||||
//! \sa SecretRecovery, SecretRecovery, InformationDispersal, InformationRecovery
|
||||
//! \since Crypto++ 1.0
|
||||
class SecretRecovery : public RawIDA
|
||||
{
|
||||
public:
|
||||
//! \brief Construct a SecretRecovery
|
||||
SecretRecovery(int threshold, BufferedTransformation *attachment=NULL, bool removePadding=true)
|
||||
: RawIDA(attachment)
|
||||
{IsolatedInitialize(MakeParameters("RecoveryThreshold", threshold)("RemovePadding", removePadding));}
|
||||
|
|
@ -100,9 +112,16 @@ protected:
|
|||
};
|
||||
|
||||
/// a variant of Rabin's Information Dispersal Algorithm
|
||||
|
||||
//! \class InformationDispersal
|
||||
//! \brief Rabin's Information Dispersal Algorithm
|
||||
//! \details InformationDispersal is a variant of Rabin's information dispersal algorithm
|
||||
//! \sa SecretRecovery, SecretRecovery, InformationDispersal, InformationRecovery
|
||||
//! \since Crypto++ 1.0
|
||||
class InformationDispersal : public CustomFlushPropagation<Filter>
|
||||
{
|
||||
public:
|
||||
//! \brief Construct a InformationDispersal
|
||||
InformationDispersal(int threshold, int nShares, BufferedTransformation *attachment=NULL, bool addPadding=true)
|
||||
: m_ida(new OutputProxy(*this, true)), m_pad(false), m_nextChannel(0)
|
||||
{
|
||||
|
|
@ -120,10 +139,15 @@ protected:
|
|||
unsigned int m_nextChannel;
|
||||
};
|
||||
|
||||
/// a variant of Rabin's Information Dispersal Algorithm
|
||||
//! \class InformationRecovery
|
||||
//! \brief Rabin's Information Dispersal Algorithm
|
||||
//! \details InformationDispersal is a variant of Rabin's information dispersal algorithm
|
||||
//! \sa SecretRecovery, SecretRecovery, InformationDispersal, InformationRecovery
|
||||
//! \since Crypto++ 1.0
|
||||
class InformationRecovery : public RawIDA
|
||||
{
|
||||
public:
|
||||
//! \brief Construct a InformationRecovery
|
||||
InformationRecovery(int threshold, BufferedTransformation *attachment=NULL, bool removePadding=true)
|
||||
: RawIDA(attachment), m_pad(false)
|
||||
{IsolatedInitialize(MakeParameters("RecoveryThreshold", threshold)("RemovePadding", removePadding));}
|
||||
|
|
|
|||
2
idea.h
2
idea.h
|
|
@ -13,6 +13,7 @@ NAMESPACE_BEGIN(CryptoPP)
|
|||
|
||||
//! \class IDEA_Info
|
||||
//! \brief IDEA block cipher information
|
||||
//! \since Crypto++ 1.0
|
||||
struct IDEA_Info : public FixedBlockSize<8>, public FixedKeyLength<16>, public FixedRounds<8>
|
||||
{
|
||||
CRYPTOPP_CONSTEXPR static const char *StaticAlgorithmName() {return "IDEA";}
|
||||
|
|
@ -21,6 +22,7 @@ struct IDEA_Info : public FixedBlockSize<8>, public FixedKeyLength<16>, public F
|
|||
//! \class IDEA
|
||||
//! \brief IDEA block cipher
|
||||
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#IDEA">IDEA</a>
|
||||
//! \since Crypto++ 1.0
|
||||
class IDEA : public IDEA_Info, public BlockCipherDocumentation
|
||||
{
|
||||
public: // made public for internal purposes
|
||||
|
|
|
|||
5
md5.h
5
md5.h
|
|
@ -7,7 +7,10 @@ NAMESPACE_BEGIN(CryptoPP)
|
|||
|
||||
namespace Weak1 {
|
||||
|
||||
//! <a href="http://www.cryptolounge.org/wiki/MD5">MD5</a>
|
||||
//! \class MD5
|
||||
//! \brief MD5 message digest
|
||||
//! \sa <a href="http://www.cryptolounge.org/wiki/MD5">MD5</a>
|
||||
//! \since Crypto++ 1.0
|
||||
class MD5 : public IteratedHashWithStaticTransform<word32, LittleEndian, 64, 16, MD5>
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
2
rc5.h
2
rc5.h
|
|
@ -13,6 +13,7 @@ NAMESPACE_BEGIN(CryptoPP)
|
|||
|
||||
//! \class RC5_Info
|
||||
//! \brief RC5 block cipher information
|
||||
//! \since Crypto++ 1.0
|
||||
struct RC5_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 0, 255>, public VariableRounds<16>
|
||||
{
|
||||
CRYPTOPP_CONSTEXPR static const char *StaticAlgorithmName() {return "RC5";}
|
||||
|
|
@ -22,6 +23,7 @@ struct RC5_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 0, 255>
|
|||
//! \class RC5
|
||||
//! \brief RC5 block cipher
|
||||
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#RC5">RC5</a>
|
||||
//! \since Crypto++ 1.0
|
||||
class RC5 : public RC5_Info, public BlockCipherDocumentation
|
||||
{
|
||||
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<RC5_Info>
|
||||
|
|
|
|||
15
rsa.h
15
rsa.h
|
|
@ -20,6 +20,7 @@ NAMESPACE_BEGIN(CryptoPP)
|
|||
|
||||
//! \class RSAFunction
|
||||
//! \brief RSA trapdoor function using the public key
|
||||
//! \since Crypto++ 1.0
|
||||
class CRYPTOPP_DLL RSAFunction : public TrapdoorFunction, public X509PublicKey
|
||||
{
|
||||
typedef RSAFunction ThisClass;
|
||||
|
|
@ -59,6 +60,7 @@ protected:
|
|||
|
||||
//! \class InvertibleRSAFunction
|
||||
//! \brief RSA trapdoor function using the private key
|
||||
//! \since Crypto++ 1.0
|
||||
class CRYPTOPP_DLL InvertibleRSAFunction : public RSAFunction, public TrapdoorFunctionInverse, public PKCS8PrivateKey
|
||||
{
|
||||
typedef InvertibleRSAFunction ThisClass;
|
||||
|
|
@ -132,6 +134,7 @@ protected:
|
|||
|
||||
//! \class RSAFunction_ISO
|
||||
//! \brief RSA trapdoor function using the public key
|
||||
//! \since Crypto++ 1.0
|
||||
class CRYPTOPP_DLL RSAFunction_ISO : public RSAFunction
|
||||
{
|
||||
public:
|
||||
|
|
@ -141,6 +144,7 @@ public:
|
|||
|
||||
//! \class InvertibleRSAFunction_ISO
|
||||
//! \brief RSA trapdoor function using the private key
|
||||
//! \since Crypto++ 1.0
|
||||
class CRYPTOPP_DLL InvertibleRSAFunction_ISO : public InvertibleRSAFunction
|
||||
{
|
||||
public:
|
||||
|
|
@ -150,6 +154,7 @@ public:
|
|||
|
||||
//! \class RSA
|
||||
//! \brief RSA algorithm
|
||||
//! \since Crypto++ 1.0
|
||||
struct CRYPTOPP_DLL RSA
|
||||
{
|
||||
CRYPTOPP_CONSTEXPR static const char * CRYPTOPP_API StaticAlgorithmName() {return "RSA";}
|
||||
|
|
@ -161,6 +166,7 @@ struct CRYPTOPP_DLL RSA
|
|||
//! \brief RSA encryption algorithm
|
||||
//! \tparam STANDARD signature standard
|
||||
//! \sa <a href="http://www.weidai.com/scan-mirror/ca.html#RSA">RSA cryptosystem</a>
|
||||
//! \since Crypto++ 1.0
|
||||
template <class STANDARD>
|
||||
struct RSAES : public TF_ES<STANDARD, RSA>
|
||||
{
|
||||
|
|
@ -172,6 +178,7 @@ struct RSAES : public TF_ES<STANDARD, RSA>
|
|||
//! \tparam H hash transformation
|
||||
//! \details See documentation of PKCS1v15 for a list of hash functions that can be used with it.
|
||||
//! \sa <a href="http://www.weidai.com/scan-mirror/sig.html#RSA">RSA signature scheme with appendix</a>
|
||||
//! \since Crypto++ 1.0
|
||||
template <class STANDARD, class H>
|
||||
struct RSASS : public TF_SS<STANDARD, H, RSA>
|
||||
{
|
||||
|
|
@ -179,6 +186,7 @@ struct RSASS : public TF_SS<STANDARD, H, RSA>
|
|||
|
||||
//! \class RSA_ISO
|
||||
//! \brief RSA algorithm
|
||||
//! \since Crypto++ 1.0
|
||||
struct CRYPTOPP_DLL RSA_ISO
|
||||
{
|
||||
CRYPTOPP_CONSTEXPR static const char * CRYPTOPP_API StaticAlgorithmName() {return "RSA-ISO";}
|
||||
|
|
@ -189,6 +197,7 @@ struct CRYPTOPP_DLL RSA_ISO
|
|||
//! \class RSASS_ISO
|
||||
//! \brief RSA signature algorithm
|
||||
//! \tparam H hash transformation
|
||||
//! \since Crypto++ 1.0
|
||||
template <class H>
|
||||
struct RSASS_ISO : public TF_SS<P1363_EMSA2, H, RSA_ISO>
|
||||
{
|
||||
|
|
@ -211,25 +220,31 @@ DOCUMENTED_TYPEDEF(RSAES<OAEP<SHA> >::Encryptor, RSAES_OAEP_SHA_Encryptor);
|
|||
#ifdef CRYPTOPP_DOXYGEN_PROCESSING
|
||||
//! \brief \ref RSASS<STANDARD,HASH> "RSASS<PKCS1v15,SHA>::Signer" typedef
|
||||
//! \details RSA signature schemes defined in PKCS #1 v2.0
|
||||
//! \since Crypto++ 1.0
|
||||
class RSASSA_PKCS1v15_SHA_Signer : public RSASS<PKCS1v15,SHA>::Signer {};
|
||||
//! \brief \ref RSASS<STANDARD,HASH> "RSASS<PKCS1v15,SHA>::Verifier" typedef
|
||||
//! \details RSA signature schemes defined in PKCS #1 v2.0
|
||||
//! \since Crypto++ 1.0
|
||||
class RSASSA_PKCS1v15_SHA_Verifier : public RSASS<PKCS1v15,SHA>::Verifier {};
|
||||
|
||||
namespace Weak {
|
||||
|
||||
//! \brief \ref RSASS<STANDARD,HASH> "RSASS<PKCS1v15, Weak::MD2>::Signer" typedef
|
||||
//! \details RSA signature schemes defined in PKCS #1 v2.0
|
||||
//! \since Crypto++ 1.0
|
||||
class RSASSA_PKCS1v15_MD2_Signer : public RSASS<PKCS1v15, Weak1::MD2>::Signer {};
|
||||
//! \brief \ref RSASS<STANDARD,HASH> "RSASS<PKCS1v15, Weak::MD2>::Verifier" typedef
|
||||
//! \details RSA signature schemes defined in PKCS #1 v2.0
|
||||
//! \since Crypto++ 1.0
|
||||
class RSASSA_PKCS1v15_MD2_Verifier : public RSASS<PKCS1v15, Weak1::MD2>::Verifier {};
|
||||
|
||||
//! \brief \ref RSASS<STANDARD,HASH> "RSASS<PKCS1v15, Weak::MD5>::Signer" typedef
|
||||
//! \details RSA signature schemes defined in PKCS #1 v2.0
|
||||
//! \since Crypto++ 1.0
|
||||
class RSASSA_PKCS1v15_MD5_Signer : public RSASS<PKCS1v15, Weak1::MD5>::Signer {};
|
||||
//! \brief \ref RSASS<STANDARD,HASH> "RSASS<PKCS1v15, Weak::MD5>::Verifier" typedef
|
||||
//! \details RSA signature schemes defined in PKCS #1 v2.0
|
||||
//! \since Crypto++ 1.0
|
||||
class RSASSA_PKCS1v15_MD5_Verifier : public RSASS<PKCS1v15, Weak1::MD5>::Verifier {};
|
||||
}
|
||||
|
||||
|
|
|
|||
25
sha.h
25
sha.h
|
|
@ -18,7 +18,10 @@
|
|||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
/// <a href="http://www.weidai.com/scan-mirror/md.html#SHA-1">SHA-1</a>
|
||||
//! \class SHA1
|
||||
//! \brief SHA-1 message digest
|
||||
//! \sa <a href="http://www.weidai.com/scan-mirror/md.html#SHA-1">SHA-1</a>
|
||||
//! \since Crypto++ 1.0
|
||||
class CRYPTOPP_DLL SHA1 : public IteratedHashWithStaticTransform<word32, BigEndian, 64, 20, SHA1>
|
||||
{
|
||||
public:
|
||||
|
|
@ -29,7 +32,10 @@ public:
|
|||
|
||||
typedef SHA1 SHA; // for backwards compatibility
|
||||
|
||||
//! implements the SHA-256 standard
|
||||
//! \class SHA256
|
||||
//! \brief SHA-256 message digest
|
||||
//! \sa <a href="http://www.weidai.com/scan-mirror/md.html#SHA-256">SHA-256</a>
|
||||
//! \since Crypto++ 4.0
|
||||
class CRYPTOPP_DLL SHA256 : public IteratedHashWithStaticTransform<word32, BigEndian, 64, 32, SHA256, 32, true>
|
||||
{
|
||||
public:
|
||||
|
|
@ -41,7 +47,10 @@ public:
|
|||
CRYPTOPP_CONSTEXPR static const char * CRYPTOPP_API StaticAlgorithmName() {return "SHA-256";}
|
||||
};
|
||||
|
||||
//! implements the SHA-224 standard
|
||||
//! \class SHA224
|
||||
//! \brief SHA-224 message digest
|
||||
//! \sa <a href="http://www.weidai.com/scan-mirror/md.html#SHA-224">SHA-224</a>
|
||||
//! \since Crypto++ 4.0
|
||||
class CRYPTOPP_DLL SHA224 : public IteratedHashWithStaticTransform<word32, BigEndian, 64, 32, SHA224, 28, true>
|
||||
{
|
||||
public:
|
||||
|
|
@ -53,7 +62,10 @@ public:
|
|||
CRYPTOPP_CONSTEXPR static const char * CRYPTOPP_API StaticAlgorithmName() {return "SHA-224";}
|
||||
};
|
||||
|
||||
//! implements the SHA-512 standard
|
||||
//! \class SHA512
|
||||
//! \brief SHA-512 message digest
|
||||
//! \sa <a href="http://www.weidai.com/scan-mirror/md.html#SHA-512">SHA-512</a>
|
||||
//! \since Crypto++ 4.0
|
||||
class CRYPTOPP_DLL SHA512 : public IteratedHashWithStaticTransform<word64, BigEndian, 128, 64, SHA512, 64, (CRYPTOPP_BOOL_X86|CRYPTOPP_BOOL_X32)>
|
||||
{
|
||||
public:
|
||||
|
|
@ -62,7 +74,10 @@ public:
|
|||
CRYPTOPP_CONSTEXPR static const char * CRYPTOPP_API StaticAlgorithmName() {return "SHA-512";}
|
||||
};
|
||||
|
||||
//! implements the SHA-384 standard
|
||||
//! \class SHA384
|
||||
//! \brief SHA-384 message digest
|
||||
//! \sa <a href="http://www.weidai.com/scan-mirror/md.html#SHA-384">SHA-384</a>
|
||||
//! \since Crypto++ 4.0
|
||||
class CRYPTOPP_DLL SHA384 : public IteratedHashWithStaticTransform<word64, BigEndian, 128, 64, SHA384, 48, (CRYPTOPP_BOOL_X86|CRYPTOPP_BOOL_X32)>
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
3
wake.h
3
wake.h
|
|
@ -15,6 +15,7 @@ NAMESPACE_BEGIN(CryptoPP)
|
|||
//! \class WAKE_OFB_Info
|
||||
//! \brief WAKE stream cipher information
|
||||
//! \tparam B Endianess of the stream cipher
|
||||
//! \since Crypto++ 1.0
|
||||
template <class B = BigEndian>
|
||||
struct WAKE_OFB_Info : public FixedKeyLength<32>
|
||||
{
|
||||
|
|
@ -34,6 +35,7 @@ protected:
|
|||
//! \class WAKE_Policy
|
||||
//! \brief WAKE stream cipher operation
|
||||
//! \tparam B Endianess of the stream cipher
|
||||
//! \since Crypto++ 1.0
|
||||
template <class B = BigEndian>
|
||||
class CRYPTOPP_NO_VTABLE WAKE_Policy : public AdditiveCipherConcretePolicy<word32, 1, 64>, protected WAKE_Base
|
||||
{
|
||||
|
|
@ -47,6 +49,7 @@ protected:
|
|||
//! \class WAKE_OFB
|
||||
//! \brief WAKE stream cipher
|
||||
//! \tparam B Endianess of the stream cipher
|
||||
//! \since Crypto++ 1.0
|
||||
template <class B = BigEndian>
|
||||
struct WAKE_OFB : public WAKE_OFB_Info<B>, public SymmetricCipherDocumentation
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,7 +12,9 @@
|
|||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
//! \class LowFirstBitWriter
|
||||
//! \brief Encoding table writer
|
||||
//! \since Crypto++ 1.0
|
||||
class LowFirstBitWriter : public Filter
|
||||
{
|
||||
public:
|
||||
|
|
@ -36,6 +38,8 @@ protected:
|
|||
};
|
||||
|
||||
//! \class HuffmanEncoder
|
||||
//! \brief Huffman Encoder
|
||||
//! \since Crypto++ 1.0
|
||||
class HuffmanEncoder
|
||||
{
|
||||
public:
|
||||
|
|
@ -70,6 +74,7 @@ public:
|
|||
|
||||
//! \class Deflator
|
||||
//! \brief DEFLATE compressor (RFC 1951)
|
||||
//! \since Crypto++ 1.0
|
||||
class Deflator : public LowFirstBitWriter
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
12
zinflate.h
12
zinflate.h
|
|
@ -8,7 +8,8 @@
|
|||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
//! _
|
||||
//! \class LowFirstBitReader
|
||||
//! \since Crypto++ 1.0
|
||||
class LowFirstBitReader
|
||||
{
|
||||
public:
|
||||
|
|
@ -29,7 +30,9 @@ private:
|
|||
|
||||
struct CodeLessThan;
|
||||
|
||||
//! Huffman Decoder
|
||||
//! \class HuffmanDecoder
|
||||
//! \brief Huffman Decoder
|
||||
//! \since Crypto++ 1.0
|
||||
class HuffmanDecoder
|
||||
{
|
||||
public:
|
||||
|
|
@ -83,8 +86,9 @@ private:
|
|||
mutable std::vector<LookupEntry, AllocatorWithCleanup<LookupEntry> > m_cache;
|
||||
};
|
||||
|
||||
//! DEFLATE (RFC 1951) decompressor
|
||||
|
||||
//! \class Inflator
|
||||
//! \brief DEFLATE decompressor (RFC 1951)
|
||||
//! \since Crypto++ 1.0
|
||||
class Inflator : public AutoSignaling<Filter>
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
Loading…
Reference in New Issue