This commit is contained in:
Igor Pavlov
2016-05-23 00:00:00 +00:00
committed by Kornel Lesiński
parent bec3b479dc
commit 1eddf527ca
25 changed files with 86 additions and 74 deletions

View File

@@ -11,8 +11,8 @@ namespace NRar3 {
CDecoder::CDecoder():
CAesCbcDecoder(kAesKeySize),
_thereIsSalt(false),
_needCalc(true),
_rar350Mode(false)
_needCalc(true)
// _rar350Mode(false)
{
for (unsigned i = 0; i < sizeof(_salt); i++)
_salt[i] = 0;
@@ -111,9 +111,9 @@ void CDecoder::CalcKey()
UInt32 i;
for (i = 0; i < kNumRounds; i++)
{
sha.UpdateRar(buf, rawSize, _rar350Mode);
sha.UpdateRar(buf, rawSize /* , _rar350Mode */);
Byte pswNum[3] = { (Byte)i, (Byte)(i >> 8), (Byte)(i >> 16) };
sha.UpdateRar(pswNum, 3, _rar350Mode);
sha.UpdateRar(pswNum, 3 /* , _rar350Mode */);
if (i % (kNumRounds / 16) == 0)
{
NSha1::CContext shaTemp = sha;

View File

@@ -24,7 +24,7 @@ class CDecoder:
Byte _salt[8];
bool _thereIsSalt;
bool _needCalc;
bool _rar350Mode;
// bool _rar350Mode;
CByteBuffer _password;
@@ -44,7 +44,7 @@ public:
HRESULT SetDecoderProperties2(const Byte *data, UInt32 size);
CDecoder();
void SetRar350Mode(bool rar350Mode) { _rar350Mode = rar350Mode; }
// void SetRar350Mode(bool rar350Mode) { _rar350Mode = rar350Mode; }
};
}}

View File

@@ -28,7 +28,7 @@ class CContext: public CContextBase
{
public:
void Update(const Byte *data, size_t size) throw() { Sha1_Update(&_s, data, size); }
void UpdateRar(Byte *data, size_t size, bool rar350Mode) throw() { Sha1_Update_Rar(&_s, data, size, rar350Mode ? 1 : 0); }
void UpdateRar(Byte *data, size_t size /* , bool rar350Mode */) throw() { Sha1_Update_Rar(&_s, data, size /* , rar350Mode ? 1 : 0 */); }
void Final(Byte *digest) throw() { Sha1_Final(&_s, digest); }
};