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

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/thirdparty/unrar/rdwrfn.cpp')
-rw-r--r--src/thirdparty/unrar/rdwrfn.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/thirdparty/unrar/rdwrfn.cpp b/src/thirdparty/unrar/rdwrfn.cpp
index 50c715d3c..5d2598e40 100644
--- a/src/thirdparty/unrar/rdwrfn.cpp
+++ b/src/thirdparty/unrar/rdwrfn.cpp
@@ -2,6 +2,10 @@
ComprDataIO::ComprDataIO()
{
+#ifndef RAR_NOCRYPT
+ Crypt=new CryptData;
+ Decrypt=new CryptData;
+#endif
Init();
}
@@ -33,6 +37,13 @@ void ComprDataIO::Init()
}
+ComprDataIO::~ComprDataIO()
+{
+#ifndef RAR_NOCRYPT
+ delete Crypt;
+ delete Decrypt;
+#endif
+}
@@ -127,7 +138,7 @@ int ComprDataIO::UnpRead(byte *Addr,size_t Count)
ReadSize=TotalRead;
#ifndef RAR_NOCRYPT
if (Decryption)
- Decrypt.DecryptBlock(Addr,ReadSize);
+ Decrypt->DecryptBlock(Addr,ReadSize);
#endif
}
Wait();
@@ -269,13 +280,13 @@ void ComprDataIO::GetUnpackedData(byte **Data,size_t *Size)
void ComprDataIO::SetEncryption(bool Encrypt,CRYPT_METHOD Method,
SecPassword *Password,const byte *Salt,const byte *InitV,
- uint Lg2Cnt,byte *PswCheck,byte *HashKey)
+ uint Lg2Cnt,byte *HashKey,byte *PswCheck)
{
#ifndef RAR_NOCRYPT
if (Encrypt)
- Encryption=Crypt.SetCryptKeys(true,Method,Password,Salt,InitV,Lg2Cnt,HashKey,PswCheck);
+ Encryption=Crypt->SetCryptKeys(true,Method,Password,Salt,InitV,Lg2Cnt,HashKey,PswCheck);
else
- Decryption=Decrypt.SetCryptKeys(false,Method,Password,Salt,InitV,Lg2Cnt,HashKey,PswCheck);
+ Decryption=Decrypt->SetCryptKeys(false,Method,Password,Salt,InitV,Lg2Cnt,HashKey,PswCheck);
#endif
}
@@ -284,7 +295,7 @@ void ComprDataIO::SetEncryption(bool Encrypt,CRYPT_METHOD Method,
void ComprDataIO::SetAV15Encryption()
{
Decryption=true;
- Decrypt.SetAV15Encryption();
+ Decrypt->SetAV15Encryption();
}
#endif
@@ -293,7 +304,7 @@ void ComprDataIO::SetAV15Encryption()
void ComprDataIO::SetCmt13Encryption()
{
Decryption=true;
- Decrypt.SetCmt13Encryption();
+ Decrypt->SetCmt13Encryption();
}
#endif