Skip to content

Commit

Permalink
Removed remaining CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY (Issue 369)
Browse files Browse the repository at this point in the history
  • Loading branch information
noloader committed Jan 27, 2017
1 parent d4c247a commit 79f3ab8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 57 deletions.
8 changes: 4 additions & 4 deletions config.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@

// ***************** Less Important Settings ***************

// Library version
// Library version macro. Since this macro is in a header, it reflects
// the version of the library the headers came from. It is not
// necessarily the version of the library built as a shared object if
// versions are inadvertently mixed and matched.
#define CRYPTOPP_VERSION 570

// Define this if you want to set a prefix for TestData/ and TestVectors/
Expand All @@ -72,9 +75,6 @@
# define CRYPTOPP_DATA_DIR ""
#endif

// define this to retain (as much as possible) old deprecated function and class names
// #define CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY

// Define this if you want or need the library's memcpy_s and memmove_s.
// See http://github.com/weidai11/cryptopp/issues/28.
// #if !defined(CRYPTOPP_WANT_SECURE_LIB)
Expand Down
53 changes: 0 additions & 53 deletions cryptlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,6 @@ struct CRYPTOPP_DLL DecodingResult
bool isValidCoding;
//! \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
};

//! \class NameValuePairs
Expand Down Expand Up @@ -1177,10 +1173,6 @@ 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

//! \class RandomNumberGenerator
//! \brief Interface for random number generators
//! \details The library provides a number of random number generators, from software based to hardware based generators.
Expand Down Expand Up @@ -1267,15 +1259,6 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE RandomNumberGenerator : public Algorithm
for (; begin != end; ++begin)
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

};

//! \brief Random Number Generator that does not produce random numbers
Expand Down Expand Up @@ -1566,11 +1549,6 @@ 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
//@}

//! \name RETRIEVAL OF ONE MESSAGE
//@{

Expand Down Expand Up @@ -1691,10 +1669,6 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE BufferedTransformation : public Algorithm,
//! \details The function returns the new position in the stream after transferring the bytes starting at the index.
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
//@}

//! \name RETRIEVAL OF MULTIPLE MESSAGES
Expand Down Expand Up @@ -2324,11 +2298,6 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_CryptoSystem
//! \details FixedMaxPlaintextLength(0 returns the maximum plaintext length given the fixed ciphertext
//! length, if one exists, otherwise return 0.
virtual size_t FixedMaxPlaintextLength() const {return 0;}

//#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
};

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

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

//! \class PK_SignatureScheme
//! \brief Interface for public-key signers and verifiers
//! \details This class provides an interface common to signers and verifiers for querying scheme properties
Expand Down Expand Up @@ -2713,11 +2676,6 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE SimpleKeyAgreementDomain : public KeyAgree
//! \pre <tt>COUNTOF(privateKey) == PrivateKeyLength()</tt>
//! \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
};

//! \brief Interface for domains of authenticated key agreement protocols
Expand Down Expand Up @@ -2811,11 +2769,6 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE AuthenticatedKeyAgreementDomain : public K
const byte *staticPrivateKey, const byte *ephemeralPrivateKey,
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
};

// interface for password authenticated key agreement protocols, not implemented yet
Expand Down Expand Up @@ -2961,12 +2914,6 @@ 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

NAMESPACE_END

#if CRYPTOPP_MSC_VERSION
Expand Down

0 comments on commit 79f3ab8

Please sign in to comment.