Merge branch 'master' into hmqv

pull/263/head
Jeffrey Walton 2016-07-25 08:04:35 -04:00
commit 274bbf4a6e
4 changed files with 13 additions and 13 deletions

View File

@ -13,7 +13,7 @@
#ifndef CRYPTOPP_GENERATE_X64_MASM #ifndef CRYPTOPP_GENERATE_X64_MASM
// Clang 3.3 integrated assembler crash on Linux. MacPorts GCC compile error. SunCC crash under Sun Studio 12.5 and below. // Clang 3.3 integrated assembler crash on Linux. MacPorts GCC compile error. SunCC crash under Sun Studio 12.5 and below.
#if (defined(CRYPTOPP_LLVM_CLANG_VERSION) && (CRYPTOPP_LLVM_CLANG_VERSION < 30400)) || defined(CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER) || (__SUNPRO_CC <= 0x5140) #if (defined(CRYPTOPP_LLVM_CLANG_VERSION) && (CRYPTOPP_LLVM_CLANG_VERSION < 30400)) || defined(CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER) || (defined(__SUNPRO_CC) && __SUNPRO_CC <= 0x5140)
# undef CRYPTOPP_X86_ASM_AVAILABLE # undef CRYPTOPP_X86_ASM_AVAILABLE
# undef CRYPTOPP_X32_ASM_AVAILABLE # undef CRYPTOPP_X32_ASM_AVAILABLE
# undef CRYPTOPP_X64_ASM_AVAILABLE # undef CRYPTOPP_X64_ASM_AVAILABLE

View File

@ -94,7 +94,7 @@ struct HuffmanNode
: symbol(0), parent(0) {} : symbol(0), parent(0) {}
HuffmanNode(const HuffmanNode& rhs) HuffmanNode(const HuffmanNode& rhs)
: symbol(rhs.symbol), parent(rhs.parent) {} : symbol(rhs.symbol), parent(rhs.parent) {}
size_t symbol; size_t symbol;
union {size_t parent; unsigned depth, freq;}; union {size_t parent; unsigned depth, freq;};
}; };
@ -582,7 +582,7 @@ void Deflator::MatchFound(unsigned int distance, unsigned int length)
static const unsigned int lengthBases[] = static const unsigned int lengthBases[] =
{3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195, {3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,
227,258}; 227,258};
static const unsigned int distanceBases[30] = static const unsigned int distanceBases[30] =
{1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073, {1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,
4097,6145,8193,12289,16385,24577}; 4097,6145,8193,12289,16385,24577};
@ -601,10 +601,10 @@ void Deflator::MatchFound(unsigned int distance, unsigned int length)
m_blockLength += length; m_blockLength += length;
} }
inline unsigned int CodeLengthEncode(const unsigned int *begin, inline unsigned int CodeLengthEncode(const unsigned int *begin,
const unsigned int *end, const unsigned int *end,
const unsigned int *& p, const unsigned int *& p,
unsigned int &extraBits, unsigned int &extraBits,
unsigned int &extraBitsLength) unsigned int &extraBitsLength)
{ {
unsigned int v = *p; unsigned int v = *p;

View File

@ -44,12 +44,12 @@ public:
//! \brief Construct a HuffmanEncoder //! \brief Construct a HuffmanEncoder
HuffmanEncoder() {} HuffmanEncoder() {}
//! \brief Construct a HuffmanEncoder //! \brief Construct a HuffmanEncoder
//! \param codeBits a table of code bits //! \param codeBits a table of code bits
//! \param nCodes the number of codes in the table //! \param nCodes the number of codes in the table
HuffmanEncoder(const unsigned int *codeBits, unsigned int nCodes); HuffmanEncoder(const unsigned int *codeBits, unsigned int nCodes);
//! \brief Initialize or reinitialize this object //! \brief Initialize or reinitialize this object
//! \param codeBits a table of code bits //! \param codeBits a table of code bits
//! \param nCodes the number of codes in the table //! \param nCodes the number of codes in the table

View File

@ -1,7 +1,7 @@
// zinflate.cpp - written and placed in the public domain by Wei Dai // zinflate.cpp - written and placed in the public domain by Wei Dai
// This is a complete reimplementation of the DEFLATE decompression algorithm. // This is a complete reimplementation of the DEFLATE decompression algorithm.
// It should not be affected by any security vulnerabilities in the zlib // It should not be affected by any security vulnerabilities in the zlib
// compression library. In particular it is not affected by the double free bug // compression library. In particular it is not affected by the double free bug
// (http://www.kb.cert.org/vuls/id/368819). // (http://www.kb.cert.org/vuls/id/368819).
@ -123,7 +123,7 @@ void HuffmanDecoder::Initialize(const unsigned int *codeBits, unsigned int nCode
// compute a vector of <code, length, value> triples sorted by code // compute a vector of <code, length, value> triples sorted by code
m_codeToValue.resize(nCodes - blCount[0]); m_codeToValue.resize(nCodes - blCount[0]);
unsigned int j=0; unsigned int j=0;
for (i=0; i<nCodes; i++) for (i=0; i<nCodes; i++)
{ {
unsigned int len = codeBits[i]; unsigned int len = codeBits[i];
if (len != 0) if (len != 0)
@ -265,7 +265,7 @@ void Inflator::OutputString(const byte *string, size_t length)
} }
string += len; string += len;
length -= len; length -= len;
} }
} }
void Inflator::OutputPast(unsigned int length, unsigned int distance) void Inflator::OutputPast(unsigned int length, unsigned int distance)
@ -485,7 +485,7 @@ bool Inflator::DecodeBody()
const byte *block = m_inQueue.Spy(size); const byte *block = m_inQueue.Spy(size);
size = UnsignedMin(m_storedLen, size); size = UnsignedMin(m_storedLen, size);
assert(size <= 0xffff); assert(size <= 0xffff);
OutputString(block, size); OutputString(block, size);
m_inQueue.Skip(size); m_inQueue.Skip(size);
m_storedLen = m_storedLen - (word16)size; m_storedLen = m_storedLen - (word16)size;