Skip to content

Commit

Permalink
Commented typedef guarded by CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
Browse files Browse the repository at this point in the history
The typedefs were only commented so folks could search for a missing symbol, like Crypto++ 4.0 PK_FixedLengthEncryptor or PK_FixedLengthDecryptor
This is a distinct change from CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
  • Loading branch information
noloader committed Dec 3, 2016
1 parent f06c968 commit bded4d3
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 43 deletions.
72 changes: 36 additions & 36 deletions cryptlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,9 @@ struct CRYPTOPP_DLL DecodingResult
//! \brief Recovered message length if isValidCoding is true, undefined otherwise
size_t messageLength;

#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
operator size_t() const {return isValidCoding ? messageLength : 0;}
#endif
//#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
//operator size_t() const {return isValidCoding ? messageLength : 0;}
//#endif
};

//! \class NameValuePairs
Expand Down Expand Up @@ -1177,9 +1177,9 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE AuthenticatedSymmetricCipher : public Mess
{CRYPTOPP_UNUSED(headerLength); CRYPTOPP_UNUSED(messageLength); CRYPTOPP_UNUSED(footerLength);}
};

#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
typedef SymmetricCipher StreamCipher;
#endif
//#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
//typedef SymmetricCipher StreamCipher;
//#endif

//! \class RandomNumberGenerator
//! \brief Interface for random number generators
Expand Down Expand Up @@ -1268,13 +1268,13 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE RandomNumberGenerator : public Algorithm
std::iter_swap(begin, begin + GenerateWord32(0, end-begin-1));
}

#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
byte GetByte() {return GenerateByte();}
unsigned int GetBit() {return GenerateBit();}
word32 GetLong(word32 a=0, word32 b=0xffffffffL) {return GenerateWord32(a, b);}
word16 GetShort(word16 a=0, word16 b=0xffff) {return (word16)GenerateWord32(a, b);}
void GetBlock(byte *output, size_t size) {GenerateBlock(output, size);}
#endif
//#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
//byte GetByte() {return GenerateByte();}
//unsigned int GetBit() {return GenerateBit();}
//word32 GetLong(word32 a=0, word32 b=0xffffffffL) {return GenerateWord32(a, b);}
//word16 GetShort(word16 a=0, word16 b=0xffff) {return (word16)GenerateWord32(a, b);}
//void GetBlock(byte *output, size_t size) {GenerateBlock(output, size);}
//#endif

};

Expand Down Expand Up @@ -1566,9 +1566,9 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE BufferedTransformation : public Algorithm,
virtual int GetAutoSignalPropagation() const {return 0;}
public:

#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
void Close() {MessageEnd();}
#endif
//#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
//void Close() {MessageEnd();}
//#endif
//@}

//! \name RETRIEVAL OF ONE MESSAGE
Expand Down Expand Up @@ -1692,9 +1692,9 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE BufferedTransformation : public Algorithm,
lword CopyRangeTo(BufferedTransformation &target, lword position, lword copyMax=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL) const
{lword i = position; CopyRangeTo2(target, i, i+copyMax, channel); return i-position;}

#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
unsigned long MaxRetrieveable() const {return MaxRetrievable();}
#endif
//#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
//unsigned long MaxRetrieveable() const {return MaxRetrievable();}
//#endif
//@}

//! \name RETRIEVAL OF MULTIPLE MESSAGES
Expand Down Expand Up @@ -2325,10 +2325,10 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_CryptoSystem
//! length, if one exists, otherwise return 0.
virtual size_t FixedMaxPlaintextLength() const {return 0;}

#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
//#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
//size_t MaxPlainTextLength(size_t cipherTextLength) const {return MaxPlaintextLength(cipherTextLength);}
//size_t CipherTextLength(size_t plainTextLength) const {return CiphertextLength(plainTextLength);}
#endif
//#endif
};

//! \class PK_Encryptor
Expand Down Expand Up @@ -2418,11 +2418,11 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_Decryptor : public PK_CryptoSystem, pub
{return Decrypt(rng, ciphertext, FixedCiphertextLength(), plaintext, parameters);}
};

#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
//#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
//typedef PK_CryptoSystem PK_FixedLengthCryptoSystem;
//typedef PK_Encryptor PK_FixedLengthEncryptor;
//typedef PK_Decryptor PK_FixedLengthDecryptor;
#endif
//#endif

//! \class PK_SignatureScheme
//! \brief Interface for public-key signers and verifiers
Expand Down Expand Up @@ -2713,10 +2713,10 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE SimpleKeyAgreementDomain : public KeyAgree
//! \pre <tt>COUNTOF(otherPublicKey) == PublicKeyLength()</tt>
virtual bool Agree(byte *agreedValue, const byte *privateKey, const byte *otherPublicKey, bool validateOtherPublicKey=true) const =0;

#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
bool ValidateDomainParameters(RandomNumberGenerator &rng) const
{return GetCryptoParameters().Validate(rng, 2);}
#endif
//#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
//bool ValidateDomainParameters(RandomNumberGenerator &rng) const
// {return GetCryptoParameters().Validate(rng, 2);}
//#endif
};

//! \brief Interface for domains of authenticated key agreement protocols
Expand Down Expand Up @@ -2811,10 +2811,10 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE AuthenticatedKeyAgreementDomain : public K
const byte *staticOtherPublicKey, const byte *ephemeralOtherPublicKey,
bool validateStaticOtherPublicKey=true) const =0;

#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
bool ValidateDomainParameters(RandomNumberGenerator &rng) const
{return GetCryptoParameters().Validate(rng, 2);}
#endif
//#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
// bool ValidateDomainParameters(RandomNumberGenerator &rng) const
// {return GetCryptoParameters().Validate(rng, 2);}
//#endif
};

// interface for password authenticated key agreement protocols, not implemented yet
Expand Down Expand Up @@ -2960,11 +2960,11 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE ASN1Object
virtual void BEREncode(BufferedTransformation &bt) const {DEREncode(bt);}
};

#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
typedef PK_SignatureScheme PK_SignatureSystem;
typedef SimpleKeyAgreementDomain PK_SimpleKeyAgreementDomain;
typedef AuthenticatedKeyAgreementDomain PK_AuthenticatedKeyAgreementDomain;
#endif
//#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
//typedef PK_SignatureScheme PK_SignatureSystem;
//typedef SimpleKeyAgreementDomain PK_SimpleKeyAgreementDomain;
//typedef AuthenticatedKeyAgreementDomain PK_AuthenticatedKeyAgreementDomain;
//#endif

NAMESPACE_END

Expand Down
10 changes: 5 additions & 5 deletions eccrypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ class DL_GroupParameters_EC : public DL_GroupParametersImpl<EcPrecomputation<EC>
bool operator==(const ThisClass &rhs) const
{return this->m_groupPrecomputation.GetCurve() == rhs.m_groupPrecomputation.GetCurve() && this->m_gpc.GetBase(this->m_groupPrecomputation) == rhs.m_gpc.GetBase(rhs.m_groupPrecomputation);}

#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
const Point& GetBasePoint() const {return this->GetSubgroupGenerator();}
const Integer& GetBasePointOrder() const {return this->GetSubgroupOrder();}
void LoadRecommendedParameters(const OID &oid) {Initialize(oid);}
#endif
//#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
//const Point& GetBasePoint() const {return this->GetSubgroupGenerator();}
//const Integer& GetBasePointOrder() const {return this->GetSubgroupOrder();}
//void LoadRecommendedParameters(const OID &oid) {Initialize(oid);}
//#endif

protected:
unsigned int FieldElementLength() const {return GetCurve().GetField().MaxElementByteLength();}
Expand Down
4 changes: 2 additions & 2 deletions modes.h
Original file line number Diff line number Diff line change
Expand Up @@ -462,12 +462,12 @@ struct CBC_CTS_Mode_ExternalCipher : public CipherModeDocumentation
typedef CipherModeFinalTemplate_ExternalCipher<CBC_CTS_Decryption> Decryption;
};

#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
//#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
//typedef CFB_Mode_ExternalCipher::Encryption CFBEncryption;
//typedef CFB_Mode_ExternalCipher::Decryption CFBDecryption;
//typedef OFB_Mode_ExternalCipher::Encryption OFB;
//typedef CTR_Mode_ExternalCipher::Encryption CounterMode;
#endif
//#endif

NAMESPACE_END

Expand Down

0 comments on commit bded4d3

Please sign in to comment.