diff options
Diffstat (limited to 'CPP/7zip/Crypto/Zip/ZipCrypto.cpp')
-rwxr-xr-x | CPP/7zip/Crypto/Zip/ZipCrypto.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/CPP/7zip/Crypto/Zip/ZipCrypto.cpp b/CPP/7zip/Crypto/Zip/ZipCrypto.cpp index 79f0953c..7389ba25 100755 --- a/CPP/7zip/Crypto/Zip/ZipCrypto.cpp +++ b/CPP/7zip/Crypto/Zip/ZipCrypto.cpp @@ -3,22 +3,20 @@ #include "StdAfx.h" #include "ZipCipher.h" -#include "../../../Common/CRC.h" +extern "C" +{ +#include "../../../../C/7zCrc.h" +} namespace NCrypto { namespace NZip { -static inline UInt32 ZipCRC32(UInt32 c, Byte b) -{ - return CCRC::Table[(c ^ b) & 0xFF] ^ (c >> 8); -} - void CCipher::UpdateKeys(Byte b) { - Keys[0] = ZipCRC32(Keys[0], b); + Keys[0] = CRC_UPDATE_BYTE(Keys[0], b); Keys[1] += Keys[0] & 0xff; Keys[1] = Keys[1] * 134775813L + 1; - Keys[2] = ZipCRC32(Keys[2], (Byte)(Keys[1] >> 24)); + Keys[2] = CRC_UPDATE_BYTE(Keys[2], (Byte)(Keys[1] >> 24)); } void CCipher::SetPassword(const Byte *password, UInt32 passwordLength) |