Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '7zip/Crypto/RarAES/sha1.h')
-rwxr-xr-x7zip/Crypto/RarAES/sha1.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/7zip/Crypto/RarAES/sha1.h b/7zip/Crypto/RarAES/sha1.h
index 295f4131..a7cf9a16 100755
--- a/7zip/Crypto/RarAES/sha1.h
+++ b/7zip/Crypto/RarAES/sha1.h
@@ -10,17 +10,22 @@
#define HW 5
+// Sha1 implementation in RAR before version 3.60 has bug:
+// it changes data bytes in some cases.
+// So this class supports both versions: normal_SHA and rar3Mode
+
struct CSHA1
{
UInt32 m_State[5];
UInt64 m_Count;
unsigned char _buffer[64];
- void Transform(const UInt32 data[16]);
- void WriteByteBlock();
+ void Transform(UInt32 data[16], bool returnRes = false);
+ void WriteByteBlock(bool returnRes = false);
+public:
void Init();
- void Update(const Byte *data, size_t size);
+ void Update(Byte *data, size_t size, bool rar350Mode = false);
void Final(Byte *digest);
};