diff options
author | Jeffrey Walton <noloader@gmail.com> | 2015-08-03 19:11:23 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2015-08-03 19:11:23 -0400 |
commit | 1e103c0e5b2a55bef4a3561b388c78dd5f8181ca (patch) | |
tree | bebc016cd4485c0668ad854047f270a7fb8937ac | |
parent | 7e6c9438da8787b6ea202dcaaea8aee0eff6e158 (diff) | |
download | cryptopp-git-1e103c0e5b2a55bef4a3561b388c78dd5f8181ca.tar.gz |
Completed cutover to unscoped auto_ptr (which will use Crypto++'s namespace version)
-rw-r--r-- | bench.cpp | 6 | ||||
-rw-r--r-- | datatest.cpp | 10 | ||||
-rw-r--r-- | default.cpp | 4 | ||||
-rw-r--r-- | eccrypto.cpp | 4 | ||||
-rw-r--r-- | filters.cpp | 4 | ||||
-rw-r--r-- | nbtheory.cpp | 2 | ||||
-rw-r--r-- | pubkey.h | 4 | ||||
-rw-r--r-- | wait.cpp | 4 |
8 files changed, 25 insertions, 13 deletions
@@ -4,6 +4,8 @@ #include "bench.h" #include "validate.h" +#include "stdcpp.h" +#include "smartptr.h" #include "aes.h" #include "blumshub.h" #include "files.h" @@ -191,7 +193,7 @@ void BenchMarkByName2(const char *factoryName, size_t keyLength = 0, const char else if (keyLength) name += " (" + IntToString(keyLength * 8) + "-bit key)"; - std::auto_ptr<T_FactoryOutput> obj(ObjectFactoryRegistry<T_FactoryOutput>::Registry().CreateObject(factoryName)); + auto_ptr<T_FactoryOutput> obj(ObjectFactoryRegistry<T_FactoryOutput>::Registry().CreateObject(factoryName)); if (!keyLength) keyLength = obj->DefaultKeyLength(); obj->SetKey(key, keyLength, CombinedNameValuePairs(params, MakeParameters(Name::IV(), ConstByteArrayParameter(key, obj->IVSize()), false))); @@ -213,7 +215,7 @@ void BenchMarkByNameKeyLess(const char *factoryName, const char *displayName=NUL if (displayName) name = displayName; - std::auto_ptr<T> obj(ObjectFactoryRegistry<T>::Registry().CreateObject(factoryName)); + auto_ptr<T> obj(ObjectFactoryRegistry<T>::Registry().CreateObject(factoryName)); BenchMark(name.c_str(), *obj, g_allocatedTime); } diff --git a/datatest.cpp b/datatest.cpp index 5595c4a1..14ae4cab 100644 --- a/datatest.cpp +++ b/datatest.cpp @@ -1,6 +1,8 @@ // datatest.cpp - written and placed in public domain by Wei Dai #include "config.h" +#include "stdcpp.h" +#include "smartptr.h" #include "integer.h" #include "factory.h" #include "filters.h" @@ -208,8 +210,8 @@ void TestSignatureScheme(TestData &v) std::string name = GetRequiredDatum(v, "Name"); std::string test = GetRequiredDatum(v, "Test"); - std::auto_ptr<PK_Signer> signer(ObjectFactoryRegistry<PK_Signer>::Registry().CreateObject(name.c_str())); - std::auto_ptr<PK_Verifier> verifier(ObjectFactoryRegistry<PK_Verifier>::Registry().CreateObject(name.c_str())); + auto_ptr<PK_Signer> signer(ObjectFactoryRegistry<PK_Signer>::Registry().CreateObject(name.c_str())); + auto_ptr<PK_Verifier> verifier(ObjectFactoryRegistry<PK_Verifier>::Registry().CreateObject(name.c_str())); TestDataNameValuePairs pairs(v); @@ -285,8 +287,8 @@ void TestAsymmetricCipher(TestData &v) std::string name = GetRequiredDatum(v, "Name"); std::string test = GetRequiredDatum(v, "Test"); - std::auto_ptr<PK_Encryptor> encryptor(ObjectFactoryRegistry<PK_Encryptor>::Registry().CreateObject(name.c_str())); - std::auto_ptr<PK_Decryptor> decryptor(ObjectFactoryRegistry<PK_Decryptor>::Registry().CreateObject(name.c_str())); + auto_ptr<PK_Encryptor> encryptor(ObjectFactoryRegistry<PK_Encryptor>::Registry().CreateObject(name.c_str())); + auto_ptr<PK_Decryptor> decryptor(ObjectFactoryRegistry<PK_Decryptor>::Registry().CreateObject(name.c_str())); std::string keyFormat = GetRequiredDatum(v, "KeyFormat"); diff --git a/default.cpp b/default.cpp index 8b389d09..b2443fad 100644 --- a/default.cpp +++ b/default.cpp @@ -1,8 +1,10 @@ // default.cpp - written and placed in the public domain by Wei Dai #include "pch.h" + #include "default.h" #include "stdcpp.h" +#include "smartptr.h" #include "queue.h" #include <time.h> @@ -179,7 +181,7 @@ void DefaultDecryptor::CheckKey(const byte *salt, const byte *keyCheck) GenerateKeyIV(m_passphrase, m_passphrase.size(), salt, SALTLENGTH, key, IV); m_cipher.SetKeyWithIV(key, key.size(), IV); - std::auto_ptr<StreamTransformationFilter> decryptor(new StreamTransformationFilter(m_cipher)); + auto_ptr<StreamTransformationFilter> decryptor(new StreamTransformationFilter(m_cipher)); decryptor->Put(keyCheck, BLOCKSIZE); decryptor->ForceNextPut(); diff --git a/eccrypto.cpp b/eccrypto.cpp index 99225e76..a531e2e2 100644 --- a/eccrypto.cpp +++ b/eccrypto.cpp @@ -5,6 +5,8 @@ #ifndef CRYPTOPP_IMPORTS #include "eccrypto.h" +#include "stdcpp.h" +#include "smartptr.h" #include "nbtheory.h" #include "oids.h" #include "hex.h" @@ -440,7 +442,7 @@ template <class EC> void DL_GroupParameters_EC<EC>::Initialize(const OID &oid) const EcRecommendedParameters<EllipticCurve> ¶m = *it; m_oid = oid; - std::auto_ptr<EllipticCurve> ec(param.NewEC()); + auto_ptr<EllipticCurve> ec(param.NewEC()); this->m_groupPrecomputation.SetCurve(*ec); StringSource ssG(param.g, true, new HexDecoder); diff --git a/filters.cpp b/filters.cpp index 2b9faea7..49d23970 100644 --- a/filters.cpp +++ b/filters.cpp @@ -5,6 +5,8 @@ #ifndef CRYPTOPP_IMPORTS #include "filters.h" +#include "stdcpp.h" +#include "smartptr.h" #include "mqueue.h" #include "fltrimpl.h" #include "argnames.h" @@ -500,7 +502,7 @@ void ProxyFilter::SetFilter(Filter *filter) if (filter) { OutputProxy *proxy; - std::auto_ptr<OutputProxy> temp(proxy = new OutputProxy(*this, false)); + auto_ptr<OutputProxy> temp(proxy = new OutputProxy(*this, false)); m_filter->TransferAllTo(*proxy); m_filter->Attach(temp.release()); } diff --git a/nbtheory.cpp b/nbtheory.cpp index 4e903801..980cf72e 100644 --- a/nbtheory.cpp +++ b/nbtheory.cpp @@ -31,7 +31,7 @@ struct NewPrimeTable { const unsigned int maxPrimeTableSize = 3511; - std::auto_ptr<std::vector<word16> > pPrimeTable(new std::vector<word16>); + auto_ptr<std::vector<word16> > pPrimeTable(new std::vector<word16>); std::vector<word16> &primeTable = *pPrimeTable; primeTable.reserve(maxPrimeTableSize); @@ -38,7 +38,7 @@ #include "eprecomp.h" #include "fips140.h" #include "argnames.h" -#include "stdcpp.h" +#include "smartptr.h" #include "trap.h" // VC60 workaround: this macro is defined in shlobj.h and conflicts with a template parameter used in this file @@ -1342,7 +1342,7 @@ class DL_SignerImpl : public DL_ObjectImpl<DL_SignerBase<typename SCHEME_OPTIONS public: PK_MessageAccumulator * NewSignatureAccumulator(RandomNumberGenerator &rng) const { - std::auto_ptr<PK_MessageAccumulatorBase> p(new PK_MessageAccumulatorImpl<CPP_TYPENAME SCHEME_OPTIONS::HashFunction>); + auto_ptr<PK_MessageAccumulatorBase> p(new PK_MessageAccumulatorImpl<CPP_TYPENAME SCHEME_OPTIONS::HashFunction>); this->RestartMessageAccumulator(rng, *p); return p.release(); } @@ -2,6 +2,8 @@ #include "pch.h" #include "wait.h" +#include "stdcpp.h" +#include "smartptr.h" #include "misc.h" #include "trap.h" @@ -145,7 +147,7 @@ void WaitObjectContainer::AddHandle(HANDLE handle, CallStack const& callStack) DWORD WINAPI WaitingThread(LPVOID lParam) { - std::auto_ptr<WaitingThreadData> pThread((WaitingThreadData *)lParam); + auto_ptr<WaitingThreadData> pThread((WaitingThreadData *)lParam); WaitingThreadData &thread = *pThread; std::vector<HANDLE> handles; |