mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-08 14:07:00 -06:00
4.46 beta
This commit is contained in:
committed by
Kornel Lesiński
parent
a145bfc7cf
commit
c574fc0f4b
@@ -8,8 +8,6 @@
|
||||
namespace NCrypto {
|
||||
namespace NRar20 {
|
||||
|
||||
static const int kBufferSize = 1 << 17;
|
||||
|
||||
STDMETHODIMP CDecoder::CryptoSetPassword(const Byte *data, UInt32 size)
|
||||
{
|
||||
_coder.SetPassword(data, size);
|
||||
@@ -34,43 +32,4 @@ STDMETHODIMP_(UInt32) CDecoder::Filter(Byte *data, UInt32 size)
|
||||
return i;
|
||||
}
|
||||
|
||||
/*
|
||||
STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream,
|
||||
ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
|
||||
ICompressProgressInfo *progress)
|
||||
{
|
||||
UInt64 nowPos = 0;
|
||||
UInt32 bufferPos = 0;
|
||||
UInt32 processedSize;
|
||||
for (;;)
|
||||
{
|
||||
UInt32 size = kBufferSize - bufferPos;
|
||||
RINOK(inStream->Read(_buffer + bufferPos, size, &processedSize));
|
||||
|
||||
UInt32 anEndPos = bufferPos + processedSize;
|
||||
for (;bufferPos + 16 <= anEndPos; bufferPos += 16)
|
||||
_coder.DecryptBlock(_buffer + bufferPos);
|
||||
|
||||
if (bufferPos == 0)
|
||||
return S_OK;
|
||||
|
||||
if (outSize != NULL && nowPos + bufferPos > *outSize)
|
||||
bufferPos = UInt32(*outSize - nowPos);
|
||||
|
||||
RINOK(outStream->Write(_buffer, bufferPos, &processedSize));
|
||||
if (bufferPos != processedSize)
|
||||
return E_FAIL;
|
||||
|
||||
nowPos += processedSize;
|
||||
if (outSize != NULL && nowPos == *outSize)
|
||||
return S_OK;
|
||||
|
||||
int i = 0;
|
||||
while(bufferPos < anEndPos)
|
||||
_buffer[i++] = _buffer[bufferPos++];
|
||||
bufferPos = i;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user