diff --git a/lzma/C/7zArcIn.c b/lzma/C/7zArcIn.c index f1f4d51827..f74d0fad51 100644 --- a/lzma/C/7zArcIn.c +++ b/lzma/C/7zArcIn.c @@ -1,5 +1,5 @@ /* 7zArcIn.c -- 7z Input functions -2018-07-04 : Igor Pavlov : Public domain */ +2018-12-31 : Igor Pavlov : Public domain */ #include "Precomp.h" @@ -19,7 +19,7 @@ { MY_ALLOC(Byte, to, size, alloc); memcpy(to, from, size); } #define MY_ALLOC_ZE_AND_CPY(to, size, from, alloc) \ - { if ((size) == 0) p = NULL; else { MY_ALLOC_AND_CPY(to, size, from, alloc) } } + { if ((size) == 0) to = NULL; else { MY_ALLOC_AND_CPY(to, size, from, alloc) } } #define k7zMajorVersion 0 @@ -666,7 +666,7 @@ static SRes ReadUnpackInfo(CSzAr *p, MY_ALLOC(size_t, p->FoCodersOffsets, (size_t)numFolders + 1, alloc); MY_ALLOC(UInt32, p->FoStartPackStreamIndex, (size_t)numFolders + 1, alloc); MY_ALLOC(UInt32, p->FoToCoderUnpackSizes, (size_t)numFolders + 1, alloc); - MY_ALLOC(Byte, p->FoToMainUnpackSizeIndex, (size_t)numFolders, alloc); + MY_ALLOC_ZE(Byte, p->FoToMainUnpackSizeIndex, (size_t)numFolders, alloc); startBufPtr = sd.Data; diff --git a/lzma/C/7zDec.c b/lzma/C/7zDec.c index 2628a70f32..7c46352111 100644 --- a/lzma/C/7zDec.c +++ b/lzma/C/7zDec.c @@ -1,5 +1,5 @@ /* 7zDec.c -- Decoding from 7z folder -2018-07-04 : Igor Pavlov : Public domain */ +2019-02-02 : Igor Pavlov : Public domain */ #include "Precomp.h" @@ -156,7 +156,7 @@ static SRes SzDecodeLzma(const Byte *props, unsigned propsSize, UInt64 inSize, I { SizeT inProcessed = (SizeT)lookahead, dicPos = state.dicPos; ELzmaStatus status; - res = LzmaDec_DecodeToDic(&state, outSize, inBuf, &inProcessed, LZMA_FINISH_END, &status); + res = LzmaDec_DecodeToDic(&state, outSize, (const Byte *)inBuf, &inProcessed, LZMA_FINISH_END, &status); lookahead -= inProcessed; inSize -= inProcessed; if (res != SZ_OK) @@ -218,7 +218,7 @@ static SRes SzDecodeLzma2(const Byte *props, unsigned propsSize, UInt64 inSize, { SizeT inProcessed = (SizeT)lookahead, dicPos = state.decoder.dicPos; ELzmaStatus status; - res = Lzma2Dec_DecodeToDic(&state, outSize, inBuf, &inProcessed, LZMA_FINISH_END, &status); + res = Lzma2Dec_DecodeToDic(&state, outSize, (const Byte *)inBuf, &inProcessed, LZMA_FINISH_END, &status); lookahead -= inProcessed; inSize -= inProcessed; if (res != SZ_OK) diff --git a/lzma/C/7zVersion.h b/lzma/C/7zVersion.h index a486e424ff..c176823a4d 100644 --- a/lzma/C/7zVersion.h +++ b/lzma/C/7zVersion.h @@ -1,7 +1,7 @@ -#define MY_VER_MAJOR 18 -#define MY_VER_MINOR 06 +#define MY_VER_MAJOR 19 +#define MY_VER_MINOR 00 #define MY_VER_BUILD 0 -#define MY_VERSION_NUMBERS "18.06" +#define MY_VERSION_NUMBERS "19.00" #define MY_VERSION MY_VERSION_NUMBERS #ifdef MY_CPU_NAME @@ -10,7 +10,7 @@ #define MY_VERSION_CPU MY_VERSION #endif -#define MY_DATE "2018-12-30" +#define MY_DATE "2019-02-21" #undef MY_COPYRIGHT #undef MY_VERSION_COPYRIGHT_DATE #define MY_AUTHOR_NAME "Igor Pavlov" diff --git a/lzma/C/CpuArch.c b/lzma/C/CpuArch.c index 962eb780e3..02e482e088 100644 --- a/lzma/C/CpuArch.c +++ b/lzma/C/CpuArch.c @@ -1,5 +1,5 @@ /* CpuArch.c -- CPU specific code -2018-07-04: Igor Pavlov : Public domain */ +2018-02-18: Igor Pavlov : Public domain */ #include "Precomp.h" @@ -197,4 +197,22 @@ BoolInt CPU_Is_Aes_Supported() return (p.c >> 25) & 1; } +BoolInt CPU_IsSupported_PageGB() +{ + Cx86cpuid cpuid; + if (!x86cpuid_CheckAndRead(&cpuid)) + return False; + { + UInt32 d[4] = { 0 }; + MyCPUID(0x80000000, &d[0], &d[1], &d[2], &d[3]); + if (d[0] < 0x80000001) + return False; + } + { + UInt32 d[4] = { 0 }; + MyCPUID(0x80000001, &d[0], &d[1], &d[2], &d[3]); + return (d[3] >> 26) & 1; + } +} + #endif diff --git a/lzma/C/CpuArch.h b/lzma/C/CpuArch.h index fdc114b8f5..bd42938802 100644 --- a/lzma/C/CpuArch.h +++ b/lzma/C/CpuArch.h @@ -1,5 +1,5 @@ /* CpuArch.h -- CPU specific code -2018-07-04 : Igor Pavlov : Public domain */ +2018-02-18 : Igor Pavlov : Public domain */ #ifndef __CPU_ARCH_H #define __CPU_ARCH_H @@ -327,6 +327,7 @@ int x86cpuid_GetFirm(const Cx86cpuid *p); BoolInt CPU_Is_InOrder(); BoolInt CPU_Is_Aes_Supported(); +BoolInt CPU_IsSupported_PageGB(); #endif diff --git a/lzma/C/Lzma2Dec.c b/lzma/C/Lzma2Dec.c index b0af5b0fd3..4e138a4aef 100644 --- a/lzma/C/Lzma2Dec.c +++ b/lzma/C/Lzma2Dec.c @@ -1,5 +1,5 @@ /* Lzma2Dec.c -- LZMA2 Decoder -2018-07-04 : Igor Pavlov : Public domain */ +2019-02-02 : Igor Pavlov : Public domain */ /* #define SHOW_DEBUG_INFO */ @@ -314,15 +314,15 @@ ELzma2ParseStatus Lzma2Dec_Parse(CLzma2Dec *p, while (p->state != LZMA2_STATE_ERROR) { if (p->state == LZMA2_STATE_FINISHED) - return LZMA_STATUS_FINISHED_WITH_MARK; + return (ELzma2ParseStatus)LZMA_STATUS_FINISHED_WITH_MARK; if (outSize == 0 && !checkFinishBlock) - return LZMA_STATUS_NOT_FINISHED; + return (ELzma2ParseStatus)LZMA_STATUS_NOT_FINISHED; if (p->state != LZMA2_STATE_DATA && p->state != LZMA2_STATE_DATA_CONT) { if (*srcLen == inSize) - return LZMA_STATUS_NEEDS_MORE_INPUT; + return (ELzma2ParseStatus)LZMA_STATUS_NEEDS_MORE_INPUT; (*srcLen)++; p->state = Lzma2Dec_UpdateState(p, *src++); @@ -344,7 +344,7 @@ ELzma2ParseStatus Lzma2Dec_Parse(CLzma2Dec *p, // checkFinishBlock is true. So we expect that block must be finished, // We can return LZMA_STATUS_NOT_SPECIFIED or LZMA_STATUS_NOT_FINISHED here // break; - return LZMA_STATUS_NOT_FINISHED; + return (ELzma2ParseStatus)LZMA_STATUS_NOT_FINISHED; } if (p->state == LZMA2_STATE_DATA) @@ -354,7 +354,7 @@ ELzma2ParseStatus Lzma2Dec_Parse(CLzma2Dec *p, } if (outSize == 0) - return LZMA_STATUS_NOT_FINISHED; + return (ELzma2ParseStatus)LZMA_STATUS_NOT_FINISHED; { SizeT inCur = inSize - *srcLen; @@ -362,7 +362,7 @@ ELzma2ParseStatus Lzma2Dec_Parse(CLzma2Dec *p, if (LZMA2_IS_UNCOMPRESSED_STATE(p)) { if (inCur == 0) - return LZMA_STATUS_NEEDS_MORE_INPUT; + return (ELzma2ParseStatus)LZMA_STATUS_NEEDS_MORE_INPUT; if (inCur > p->unpackSize) inCur = p->unpackSize; if (inCur > outSize) @@ -381,7 +381,7 @@ ELzma2ParseStatus Lzma2Dec_Parse(CLzma2Dec *p, if (inCur == 0) { if (p->packSize != 0) - return LZMA_STATUS_NEEDS_MORE_INPUT; + return (ELzma2ParseStatus)LZMA_STATUS_NEEDS_MORE_INPUT; } else if (p->state == LZMA2_STATE_DATA) { @@ -418,7 +418,7 @@ ELzma2ParseStatus Lzma2Dec_Parse(CLzma2Dec *p, } p->state = LZMA2_STATE_ERROR; - return LZMA_STATUS_NOT_SPECIFIED; + return (ELzma2ParseStatus)LZMA_STATUS_NOT_SPECIFIED; } diff --git a/lzma/C/LzmaEnc.c b/lzma/C/LzmaEnc.c index d78dbe121f..46a0db000f 100644 --- a/lzma/C/LzmaEnc.c +++ b/lzma/C/LzmaEnc.c @@ -1,5 +1,5 @@ /* LzmaEnc.c -- LZMA Encoder -2018-12-29: Igor Pavlov : Public domain */ +2019-01-10: Igor Pavlov : Public domain */ #include "Precomp.h" @@ -1497,9 +1497,9 @@ static unsigned GetOptimum(CLzmaEnc *p, UInt32 position) // here we can allow skip_items in p->opt, if we don't check (nextOpt->price < kInfinityPrice) // 18.new.06 - if (nextOpt->price < kInfinityPrice + if ((nextOpt->price < kInfinityPrice // && !IsLitState(state) - && matchByte == curByte + && matchByte == curByte) || litPrice > nextOpt->price ) litPrice = 0; diff --git a/lzma/DOC/lzma-history.txt b/lzma/DOC/lzma-history.txt index 8049668567..48ee74813d 100644 --- a/lzma/DOC/lzma-history.txt +++ b/lzma/DOC/lzma-history.txt @@ -1,6 +1,14 @@ HISTORY of the LZMA SDK ----------------------- +19.00 2019-02-21 +------------------------- +- Encryption strength for 7z archives was increased: + the size of random initialization vector was increased from 64-bit to 128-bit, + and the pseudo-random number generator was improved. +- The bug in 7zIn.c code was fixed. + + 18.06 2018-12-30 ------------------------- - The speed for LZMA/LZMA2 compressing was increased by 3-10%, diff --git a/lzma/DOC/lzma-sdk.txt b/lzma/DOC/lzma-sdk.txt index 1679cb0d84..b0e14a2e29 100644 --- a/lzma/DOC/lzma-sdk.txt +++ b/lzma/DOC/lzma-sdk.txt @@ -1,4 +1,4 @@ -LZMA SDK 18.06 +LZMA SDK 19.00 -------------- LZMA SDK provides the documentation, samples, header files,