Cleared "no member named 'unique_ptr' in namespace 'std'" error under C++11 on OS X
parent
e5171450e2
commit
60291122ae
27
oaep.cpp
27
oaep.cpp
|
|
@ -20,12 +20,9 @@ size_t OAEP_Base::MaxUnpaddedLength(size_t paddedLength) const
|
||||||
void OAEP_Base::Pad(RandomNumberGenerator &rng, const byte *input, size_t inputLength, byte *oaepBlock, size_t oaepBlockLen, const NameValuePairs ¶meters) const
|
void OAEP_Base::Pad(RandomNumberGenerator &rng, const byte *input, size_t inputLength, byte *oaepBlock, size_t oaepBlockLen, const NameValuePairs ¶meters) const
|
||||||
{
|
{
|
||||||
CRYPTOPP_ASSERT (inputLength <= MaxUnpaddedLength(oaepBlockLen));
|
CRYPTOPP_ASSERT (inputLength <= MaxUnpaddedLength(oaepBlockLen));
|
||||||
|
|
||||||
#if defined(CRYPTOPP_CXX11)
|
using CryptoPP::auto_ptr;
|
||||||
std::unique_ptr<HashTransformation> pHash(NewHash());
|
auto_ptr<HashTransformation> pHash(NewHash());
|
||||||
#else
|
|
||||||
std::auto_ptr<HashTransformation> pHash(NewHash());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// convert from bit length to byte length
|
// convert from bit length to byte length
|
||||||
if (oaepBlockLen % 8 != 0)
|
if (oaepBlockLen % 8 != 0)
|
||||||
|
|
@ -48,13 +45,8 @@ void OAEP_Base::Pad(RandomNumberGenerator &rng, const byte *input, size_t inputL
|
||||||
memset(maskedDB+hLen, 0, dbLen-hLen-inputLength-1);
|
memset(maskedDB+hLen, 0, dbLen-hLen-inputLength-1);
|
||||||
maskedDB[dbLen-inputLength-1] = 0x01;
|
maskedDB[dbLen-inputLength-1] = 0x01;
|
||||||
memcpy(maskedDB+dbLen-inputLength, input, inputLength);
|
memcpy(maskedDB+dbLen-inputLength, input, inputLength);
|
||||||
|
|
||||||
#if defined(CRYPTOPP_CXX11)
|
|
||||||
std::unique_ptr<MaskGeneratingFunction> pMGF(NewMGF());
|
|
||||||
#else
|
|
||||||
std::auto_ptr<MaskGeneratingFunction> pMGF(NewMGF());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
auto_ptr<MaskGeneratingFunction> pMGF(NewMGF());
|
||||||
rng.GenerateBlock(maskedSeed, seedLen);
|
rng.GenerateBlock(maskedSeed, seedLen);
|
||||||
pMGF->GenerateAndMask(*pHash, maskedDB, dbLen, maskedSeed, seedLen);
|
pMGF->GenerateAndMask(*pHash, maskedDB, dbLen, maskedSeed, seedLen);
|
||||||
pMGF->GenerateAndMask(*pHash, maskedSeed, seedLen, maskedDB, dbLen);
|
pMGF->GenerateAndMask(*pHash, maskedSeed, seedLen, maskedDB, dbLen);
|
||||||
|
|
@ -64,11 +56,8 @@ DecodingResult OAEP_Base::Unpad(const byte *oaepBlock, size_t oaepBlockLen, byte
|
||||||
{
|
{
|
||||||
bool invalid = false;
|
bool invalid = false;
|
||||||
|
|
||||||
#if defined(CRYPTOPP_CXX11)
|
using CryptoPP::auto_ptr;
|
||||||
std::unique_ptr<HashTransformation> pHash(NewHash());
|
|
||||||
#else
|
|
||||||
std::auto_ptr<HashTransformation> pHash(NewHash());
|
std::auto_ptr<HashTransformation> pHash(NewHash());
|
||||||
#endif
|
|
||||||
|
|
||||||
// convert from bit length to byte length
|
// convert from bit length to byte length
|
||||||
if (oaepBlockLen % 8 != 0)
|
if (oaepBlockLen % 8 != 0)
|
||||||
|
|
@ -87,12 +76,8 @@ DecodingResult OAEP_Base::Unpad(const byte *oaepBlock, size_t oaepBlockLen, byte
|
||||||
byte *const maskedSeed = t;
|
byte *const maskedSeed = t;
|
||||||
byte *const maskedDB = t+seedLen;
|
byte *const maskedDB = t+seedLen;
|
||||||
|
|
||||||
#if defined(CRYPTOPP_CXX11)
|
|
||||||
std::unique_ptr<MaskGeneratingFunction> pMGF(NewMGF());
|
|
||||||
#else
|
|
||||||
std::auto_ptr<MaskGeneratingFunction> pMGF(NewMGF());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
std::auto_ptr<MaskGeneratingFunction> pMGF(NewMGF());
|
||||||
pMGF->GenerateAndMask(*pHash, maskedSeed, seedLen, maskedDB, dbLen);
|
pMGF->GenerateAndMask(*pHash, maskedSeed, seedLen, maskedDB, dbLen);
|
||||||
pMGF->GenerateAndMask(*pHash, maskedDB, dbLen, maskedSeed, seedLen);
|
pMGF->GenerateAndMask(*pHash, maskedDB, dbLen, maskedSeed, seedLen);
|
||||||
|
|
||||||
|
|
|
||||||
10
zinflate.cpp
10
zinflate.cpp
|
|
@ -587,12 +587,13 @@ struct NewFixedLiteralDecoder
|
||||||
{
|
{
|
||||||
HuffmanDecoder * operator()() const
|
HuffmanDecoder * operator()() const
|
||||||
{
|
{
|
||||||
|
using CryptoPP::auto_ptr;
|
||||||
unsigned int codeLengths[288];
|
unsigned int codeLengths[288];
|
||||||
std::fill(codeLengths + 0, codeLengths + 144, 8);
|
std::fill(codeLengths + 0, codeLengths + 144, 8);
|
||||||
std::fill(codeLengths + 144, codeLengths + 256, 9);
|
std::fill(codeLengths + 144, codeLengths + 256, 9);
|
||||||
std::fill(codeLengths + 256, codeLengths + 280, 7);
|
std::fill(codeLengths + 256, codeLengths + 280, 7);
|
||||||
std::fill(codeLengths + 280, codeLengths + 288, 8);
|
std::fill(codeLengths + 280, codeLengths + 288, 8);
|
||||||
std::auto_ptr<HuffmanDecoder> pDecoder(new HuffmanDecoder);
|
auto_ptr<HuffmanDecoder> pDecoder(new HuffmanDecoder);
|
||||||
pDecoder->Initialize(codeLengths, 288);
|
pDecoder->Initialize(codeLengths, 288);
|
||||||
return pDecoder.release();
|
return pDecoder.release();
|
||||||
}
|
}
|
||||||
|
|
@ -602,13 +603,10 @@ struct NewFixedDistanceDecoder
|
||||||
{
|
{
|
||||||
HuffmanDecoder * operator()() const
|
HuffmanDecoder * operator()() const
|
||||||
{
|
{
|
||||||
|
using CryptoPP::auto_ptr;
|
||||||
unsigned int codeLengths[32];
|
unsigned int codeLengths[32];
|
||||||
std::fill(codeLengths + 0, codeLengths + 32, 5U);
|
std::fill(codeLengths + 0, codeLengths + 32, 5U);
|
||||||
#if defined(CRYPTOPP_CXX11)
|
auto_ptr<HuffmanDecoder> pDecoder(new HuffmanDecoder);
|
||||||
std::unique_ptr<HuffmanDecoder> pDecoder(new HuffmanDecoder);
|
|
||||||
#else
|
|
||||||
std::auto_ptr<HuffmanDecoder> pDecoder(new HuffmanDecoder);
|
|
||||||
#endif
|
|
||||||
pDecoder->Initialize(codeLengths, 32);
|
pDecoder->Initialize(codeLengths, 32);
|
||||||
return pDecoder.release();
|
return pDecoder.release();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue