diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2008-12-31 03:00:00 +0300 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:15:58 +0300 |
commit | 3a524e5ba2d7bb0c46e11502822f8093dd2ab0f4 (patch) | |
tree | b33da9cac0a5fc22a16bdf4de106c8a9eefd1465 /CPP/7zip/Crypto/Hash | |
parent | c1f1243a70558e86e14b1ea09dc287737378894b (diff) |
4.634.63
Diffstat (limited to 'CPP/7zip/Crypto/Hash')
-rwxr-xr-x | CPP/7zip/Crypto/Hash/HmacSha1.cpp | 109 | ||||
-rwxr-xr-x | CPP/7zip/Crypto/Hash/HmacSha1.h | 39 | ||||
-rwxr-xr-x | CPP/7zip/Crypto/Hash/Pbkdf2HmacSha1.cpp | 83 | ||||
-rwxr-xr-x | CPP/7zip/Crypto/Hash/Pbkdf2HmacSha1.h | 21 | ||||
-rwxr-xr-x | CPP/7zip/Crypto/Hash/RandGen.cpp | 109 | ||||
-rwxr-xr-x | CPP/7zip/Crypto/Hash/RandGen.h | 21 | ||||
-rwxr-xr-x | CPP/7zip/Crypto/Hash/Sha1.cpp | 213 | ||||
-rwxr-xr-x | CPP/7zip/Crypto/Hash/Sha1.h | 68 | ||||
-rwxr-xr-x | CPP/7zip/Crypto/Hash/StdAfx.h | 8 |
9 files changed, 0 insertions, 671 deletions
diff --git a/CPP/7zip/Crypto/Hash/HmacSha1.cpp b/CPP/7zip/Crypto/Hash/HmacSha1.cpp deleted file mode 100755 index a66d6271..00000000 --- a/CPP/7zip/Crypto/Hash/HmacSha1.cpp +++ /dev/null @@ -1,109 +0,0 @@ -// HmacSha1.cpp - -#include "StdAfx.h" - -#include "HmacSha1.h" - -namespace NCrypto { -namespace NSha1 { - -void CHmac::SetKey(const Byte *key, size_t keySize) -{ - Byte keyTemp[kBlockSize]; - size_t i; - for (i = 0; i < kBlockSize; i++) - keyTemp[i] = 0; - if(keySize > kBlockSize) - { - _sha.Init(); - _sha.Update(key, keySize); - _sha.Final(keyTemp); - keySize = kDigestSize; - } - else - for (i = 0; i < keySize; i++) - keyTemp[i] = key[i]; - for (i = 0; i < kBlockSize; i++) - keyTemp[i] ^= 0x36; - _sha.Init(); - _sha.Update(keyTemp, kBlockSize); - for (i = 0; i < kBlockSize; i++) - keyTemp[i] ^= 0x36 ^ 0x5C; - _sha2.Init(); - _sha2.Update(keyTemp, kBlockSize); -} - -void CHmac::Final(Byte *mac, size_t macSize) -{ - Byte digest[kDigestSize]; - _sha.Final(digest); - _sha2.Update(digest, kDigestSize); - _sha2.Final(digest); - for(size_t i = 0; i < macSize; i++) - mac[i] = digest[i]; -} - - -void CHmac32::SetKey(const Byte *key, size_t keySize) -{ - UInt32 keyTemp[kBlockSizeInWords]; - size_t i; - for (i = 0; i < kBlockSizeInWords; i++) - keyTemp[i] = 0; - if(keySize > kBlockSize) - { - CContext sha; - sha.Init(); - sha.Update(key, keySize); - Byte digest[kDigestSize]; - sha.Final(digest); - - for (int i = 0 ; i < kDigestSizeInWords; i++) - keyTemp[i] = - ((UInt32)(digest[i * 4 + 0]) << 24) | - ((UInt32)(digest[i * 4 + 1]) << 16) | - ((UInt32)(digest[i * 4 + 2]) << 8) | - ((UInt32)(digest[i * 4 + 3])); - keySize = kDigestSizeInWords; - } - else - for (size_t i = 0; i < keySize; i++) - keyTemp[i / 4] |= (key[i] << (24 - 8 * (i & 3))); - for (i = 0; i < kBlockSizeInWords; i++) - keyTemp[i] ^= 0x36363636; - _sha.Init(); - _sha.Update(keyTemp, kBlockSizeInWords); - for (i = 0; i < kBlockSizeInWords; i++) - keyTemp[i] ^= 0x36363636 ^ 0x5C5C5C5C; - _sha2.Init(); - _sha2.Update(keyTemp, kBlockSizeInWords); -} - -void CHmac32::Final(UInt32 *mac, size_t macSize) -{ - UInt32 digest[kDigestSizeInWords]; - _sha.Final(digest); - _sha2.Update(digest, kDigestSizeInWords); - _sha2.Final(digest); - for(size_t i = 0; i < macSize; i++) - mac[i] = digest[i]; -} - -void CHmac32::GetLoopXorDigest(UInt32 *mac, UInt32 numIteration) -{ - UInt32 block[kBlockSizeInWords]; - UInt32 block2[kBlockSizeInWords]; - _sha.PrepareBlock(block, kDigestSizeInWords); - _sha2.PrepareBlock(block2, kDigestSizeInWords); - for(unsigned int s = 0; s < kDigestSizeInWords; s++) - block[s] = mac[s]; - for(UInt32 i = 0; i < numIteration; i++) - { - _sha.GetBlockDigest(block, block2); - _sha2.GetBlockDigest(block2, block); - for (unsigned int s = 0; s < kDigestSizeInWords; s++) - mac[s] ^= block[s]; - } -} - -}} diff --git a/CPP/7zip/Crypto/Hash/HmacSha1.h b/CPP/7zip/Crypto/Hash/HmacSha1.h deleted file mode 100755 index bca5bcf8..00000000 --- a/CPP/7zip/Crypto/Hash/HmacSha1.h +++ /dev/null @@ -1,39 +0,0 @@ -// HmacSha1.h -// Implements HMAC-SHA-1 (RFC2104, FIPS-198) - -#ifndef _HMAC_H -#define _HMAC_H - -#include "Sha1.h" - -namespace NCrypto { -namespace NSha1 { - -// Use: SetKey(key, keySize); for () Update(data, size); Final(mac, macSize); - -class CHmac -{ - CContext _sha; - CContext _sha2; -public: - void SetKey(const Byte *key, size_t keySize); - void Update(const Byte *data, size_t dataSize) { _sha.Update(data, dataSize); } - void Final(Byte *mac, size_t macSize = kDigestSize); -}; - -class CHmac32 -{ - CContext32 _sha; - CContext32 _sha2; -public: - void SetKey(const Byte *key, size_t keySize); - void Update(const UInt32 *data, size_t dataSize) { _sha.Update(data, dataSize); } - void Final(UInt32 *mac, size_t macSize = kDigestSizeInWords); - - // It'sa for hmac function. in,out: mac[kDigestSizeInWords]. - void GetLoopXorDigest(UInt32 *mac, UInt32 numIteration); -}; - -}} - -#endif diff --git a/CPP/7zip/Crypto/Hash/Pbkdf2HmacSha1.cpp b/CPP/7zip/Crypto/Hash/Pbkdf2HmacSha1.cpp deleted file mode 100755 index cbbdec89..00000000 --- a/CPP/7zip/Crypto/Hash/Pbkdf2HmacSha1.cpp +++ /dev/null @@ -1,83 +0,0 @@ -// Pbkdf2HmacSha1.cpp - -#include "StdAfx.h" - -#include "HmacSha1.h" - -namespace NCrypto { -namespace NSha1 { - -void Pbkdf2Hmac(const Byte *pwd, size_t pwdSize, const Byte *salt, size_t saltSize, - UInt32 numIterations, Byte *key, size_t keySize) -{ - CHmac baseCtx; - baseCtx.SetKey(pwd, pwdSize); - for (UInt32 i = 1; keySize > 0; i++) - { - CHmac ctx = baseCtx; - ctx.Update(salt, saltSize); - Byte u[kDigestSize] = { (Byte)(i >> 24), (Byte)(i >> 16), (Byte)(i >> 8), (Byte)(i) }; - const unsigned int curSize = (keySize < kDigestSize) ? (unsigned int)keySize : kDigestSize; - ctx.Update(u, 4); - ctx.Final(u, kDigestSize); - - unsigned int s; - for (s = 0; s < curSize; s++) - key[s] = u[s]; - - for (UInt32 j = numIterations; j > 1; j--) - { - ctx = baseCtx; - ctx.Update(u, kDigestSize); - ctx.Final(u, kDigestSize); - for (s = 0; s < curSize; s++) - key[s] ^= u[s]; - } - - key += curSize; - keySize -= curSize; - } -} - -void Pbkdf2Hmac32(const Byte *pwd, size_t pwdSize, const UInt32 *salt, size_t saltSize, - UInt32 numIterations, UInt32 *key, size_t keySize) -{ - CHmac32 baseCtx; - baseCtx.SetKey(pwd, pwdSize); - for (UInt32 i = 1; keySize > 0; i++) - { - CHmac32 ctx = baseCtx; - ctx.Update(salt, saltSize); - UInt32 u[kDigestSizeInWords] = { i }; - const unsigned int curSize = (keySize < kDigestSizeInWords) ? (unsigned int)keySize : kDigestSizeInWords; - ctx.Update(u, 1); - ctx.Final(u, kDigestSizeInWords); - - // Speed-optimized code start - ctx = baseCtx; - ctx.GetLoopXorDigest(u, numIterations - 1); - // Speed-optimized code end - - unsigned int s; - for (s = 0; s < curSize; s++) - key[s] = u[s]; - - /* - // Default code start - for (UInt32 j = numIterations; j > 1; j--) - { - ctx = baseCtx; - ctx.Update(u, kDigestSizeInWords); - ctx.Final(u, kDigestSizeInWords); - for (s = 0; s < curSize; s++) - key[s] ^= u[s]; - } - // Default code end - */ - - key += curSize; - keySize -= curSize; - } -} - -}} diff --git a/CPP/7zip/Crypto/Hash/Pbkdf2HmacSha1.h b/CPP/7zip/Crypto/Hash/Pbkdf2HmacSha1.h deleted file mode 100755 index 68e85ee3..00000000 --- a/CPP/7zip/Crypto/Hash/Pbkdf2HmacSha1.h +++ /dev/null @@ -1,21 +0,0 @@ -// Pbkdf2HmacSha1.h -// Password-Based Key Derivation Function (RFC 2898, PKCS #5) based on HMAC-SHA-1 - -#ifndef __PBKDF2HMACSHA1_H -#define __PBKDF2HMACSHA1_H - -#include <stddef.h> -#include "../../../Common/Types.h" - -namespace NCrypto { -namespace NSha1 { - -void Pbkdf2Hmac(const Byte *pwd, size_t pwdSize, const Byte *salt, size_t saltSize, - UInt32 numIterations, Byte *key, size_t keySize); - -void Pbkdf2Hmac32(const Byte *pwd, size_t pwdSize, const UInt32 *salt, size_t saltSize, - UInt32 numIterations, UInt32 *key, size_t keySize); - -}} - -#endif diff --git a/CPP/7zip/Crypto/Hash/RandGen.cpp b/CPP/7zip/Crypto/Hash/RandGen.cpp deleted file mode 100755 index a030a0d2..00000000 --- a/CPP/7zip/Crypto/Hash/RandGen.cpp +++ /dev/null @@ -1,109 +0,0 @@ -// RandGen.cpp - -#include "StdAfx.h" - -#include <stdio.h> - -#include "Windows/Synchronization.h" - -#include "RandGen.h" - -#ifndef _WIN32 -#include <unistd.h> -#define USE_POSIX_TIME -#define USE_POSIX_TIME2 -#endif - -#ifdef USE_POSIX_TIME -#include <time.h> -#ifdef USE_POSIX_TIME2 -#include <sys/time.h> -#endif -#endif - -// This is not very good random number generator. -// Please use it only for salt. -// First generated data block depends from timer and processID. -// Other generated data blocks depend from previous state -// Maybe it's possible to restore original timer value from generated value. - -void CRandomGenerator::Init() -{ - NCrypto::NSha1::CContext hash; - hash.Init(); - - #ifdef _WIN32 - DWORD w = ::GetCurrentProcessId(); - hash.Update((const Byte *)&w, sizeof(w)); - w = ::GetCurrentThreadId(); - hash.Update((const Byte *)&w, sizeof(w)); - #else - pid_t pid = getpid(); - hash.Update((const Byte *)&pid, sizeof(pid)); - pid = getppid(); - hash.Update((const Byte *)&pid, sizeof(pid)); - #endif - - for (int i = 0; i < 1000; i++) - { - #ifdef _WIN32 - LARGE_INTEGER v; - if (::QueryPerformanceCounter(&v)) - hash.Update((const Byte *)&v.QuadPart, sizeof(v.QuadPart)); - #endif - - #ifdef USE_POSIX_TIME - #ifdef USE_POSIX_TIME2 - timeval v; - if (gettimeofday(&v, 0) == 0) - { - hash.Update((const Byte *)&v.tv_sec, sizeof(v.tv_sec)); - hash.Update((const Byte *)&v.tv_usec, sizeof(v.tv_usec)); - } - #endif - time_t v2 = time(NULL); - hash.Update((const Byte *)&v2, sizeof(v2)); - #endif - - DWORD tickCount = ::GetTickCount(); - hash.Update((const Byte *)&tickCount, sizeof(tickCount)); - - for (int j = 0; j < 100; j++) - { - hash.Final(_buff); - hash.Init(); - hash.Update(_buff, NCrypto::NSha1::kDigestSize); - } - } - hash.Final(_buff); - _needInit = false; -} - -static NWindows::NSynchronization::CCriticalSection g_CriticalSection; - -void CRandomGenerator::Generate(Byte *data, unsigned int size) -{ - g_CriticalSection.Enter(); - if (_needInit) - Init(); - while (size > 0) - { - NCrypto::NSha1::CContext hash; - - hash.Init(); - hash.Update(_buff, NCrypto::NSha1::kDigestSize); - hash.Final(_buff); - - hash.Init(); - UInt32 salt = 0xF672ABD1; - hash.Update((const Byte *)&salt, sizeof(salt)); - hash.Update(_buff, NCrypto::NSha1::kDigestSize); - Byte buff[NCrypto::NSha1::kDigestSize]; - hash.Final(buff); - for (unsigned int i = 0; i < NCrypto::NSha1::kDigestSize && size > 0; i++, size--) - *data++ = buff[i]; - } - g_CriticalSection.Leave(); -} - -CRandomGenerator g_RandomGenerator; diff --git a/CPP/7zip/Crypto/Hash/RandGen.h b/CPP/7zip/Crypto/Hash/RandGen.h deleted file mode 100755 index 3f06b26b..00000000 --- a/CPP/7zip/Crypto/Hash/RandGen.h +++ /dev/null @@ -1,21 +0,0 @@ -// RandGen.h - -#ifndef __RANDGEN_H -#define __RANDGEN_H - -#include "Sha1.h" - -class CRandomGenerator -{ - Byte _buff[NCrypto::NSha1::kDigestSize]; - bool _needInit; - - void Init(); -public: - CRandomGenerator(): _needInit(true) {}; - void Generate(Byte *data, unsigned size); -}; - -extern CRandomGenerator g_RandomGenerator; - -#endif diff --git a/CPP/7zip/Crypto/Hash/Sha1.cpp b/CPP/7zip/Crypto/Hash/Sha1.cpp deleted file mode 100755 index 2962c654..00000000 --- a/CPP/7zip/Crypto/Hash/Sha1.cpp +++ /dev/null @@ -1,213 +0,0 @@ -// Sha1.cpp -// This file is based on public domain -// Steve Reid and Wei Dai's code from Crypto++ - -#include "StdAfx.h" - -#include "Sha1.h" -extern "C" -{ -#include "../../../../C/RotateDefs.h" -} - -namespace NCrypto { -namespace NSha1 { - -// define it for speed optimization -// #define _SHA1_UNROLL - -static const unsigned int kNumW = - #ifdef _SHA1_UNROLL - 16; - #else - 80; - #endif - - -#define w0(i) (W[(i)] = data[(i)]) - -#ifdef _SHA1_UNROLL -#define w1(i) (W[(i)&15] = rotlFixed(W[((i)-3)&15] ^ W[((i)-8)&15] ^ W[((i)-14)&15] ^ W[((i)-16)&15], 1)) -#else -#define w1(i) (W[(i)] = rotlFixed(W[(i)-3] ^ W[(i)-8] ^ W[(i)-14] ^ W[(i)-16], 1)) -#endif - -#define f1(x,y,z) (z^(x&(y^z))) -#define f2(x,y,z) (x^y^z) -#define f3(x,y,z) ((x&y)|(z&(x|y))) -#define f4(x,y,z) (x^y^z) - -#define RK1(a,b,c,d,e,i, f, w, k) e += f(b,c,d) + w(i) + k + rotlFixed(a,5); b = rotlFixed(b,30); - -#define R0(a,b,c,d,e,i) RK1(a,b,c,d,e,i, f1, w0, 0x5A827999) -#define R1(a,b,c,d,e,i) RK1(a,b,c,d,e,i, f1, w1, 0x5A827999) -#define R2(a,b,c,d,e,i) RK1(a,b,c,d,e,i, f2, w1, 0x6ED9EBA1) -#define R3(a,b,c,d,e,i) RK1(a,b,c,d,e,i, f3, w1, 0x8F1BBCDC) -#define R4(a,b,c,d,e,i) RK1(a,b,c,d,e,i, f4, w1, 0xCA62C1D6) - -#define RX_1_4(rx1, rx4, i) rx1(a,b,c,d,e,i); rx4(e,a,b,c,d,i+1); rx4(d,e,a,b,c,i+2); rx4(c,d,e,a,b,i+3); rx4(b,c,d,e,a,i+4); -#define RX_5(rx, i) RX_1_4(rx, rx, i); - -void CContextBase::Init() -{ - _state[0] = 0x67452301; - _state[1] = 0xEFCDAB89; - _state[2] = 0x98BADCFE; - _state[3] = 0x10325476; - _state[4] = 0xC3D2E1F0; - _count = 0; -} - -void CContextBase::GetBlockDigest(UInt32 *data, UInt32 *destDigest, bool returnRes) -{ - UInt32 a, b, c, d, e; - UInt32 W[kNumW]; - - a = _state[0]; - b = _state[1]; - c = _state[2]; - d = _state[3]; - e = _state[4]; - #ifdef _SHA1_UNROLL - RX_5(R0, 0); RX_5(R0, 5); RX_5(R0, 10); - #else - int i; - for (i = 0; i < 15; i += 5) { RX_5(R0, i); } - #endif - - RX_1_4(R0, R1, 15); - - - #ifdef _SHA1_UNROLL - RX_5(R2, 20); RX_5(R2, 25); RX_5(R2, 30); RX_5(R2, 35); - RX_5(R3, 40); RX_5(R3, 45); RX_5(R3, 50); RX_5(R3, 55); - RX_5(R4, 60); RX_5(R4, 65); RX_5(R4, 70); RX_5(R4, 75); - #else - i = 20; - for (; i < 40; i += 5) { RX_5(R2, i); } - for (; i < 60; i += 5) { RX_5(R3, i); } - for (; i < 80; i += 5) { RX_5(R4, i); } - #endif - - destDigest[0] = _state[0] + a; - destDigest[1] = _state[1] + b; - destDigest[2] = _state[2] + c; - destDigest[3] = _state[3] + d; - destDigest[4] = _state[4] + e; - - if (returnRes) - for (int i = 0 ; i < 16; i++) - data[i] = W[kNumW - 16 + i]; - - // Wipe variables - // a = b = c = d = e = 0; -} - -void CContextBase::PrepareBlock(UInt32 *block, unsigned int size) const -{ - unsigned int curBufferPos = size & 0xF; - block[curBufferPos++] = 0x80000000; - while (curBufferPos != (16 - 2)) - block[curBufferPos++] = 0; - const UInt64 lenInBits = (_count << 9) + ((UInt64)size << 5); - block[curBufferPos++] = (UInt32)(lenInBits >> 32); - block[curBufferPos++] = (UInt32)(lenInBits); -} - -void CContext::Update(Byte *data, size_t size, bool rar350Mode) -{ - bool returnRes = false; - unsigned int curBufferPos = _count2; - while (size-- > 0) - { - int pos = (int)(curBufferPos & 3); - if (pos == 0) - _buffer[curBufferPos >> 2] = 0; - _buffer[curBufferPos >> 2] |= ((UInt32)*data++) << (8 * (3 - pos)); - if (++curBufferPos == kBlockSize) - { - curBufferPos = 0; - CContextBase::UpdateBlock(_buffer, returnRes); - if (returnRes) - for (int i = 0; i < kBlockSizeInWords; i++) - { - UInt32 d = _buffer[i]; - data[i * 4 + 0 - kBlockSize] = (Byte)(d); - data[i * 4 + 1 - kBlockSize] = (Byte)(d >> 8); - data[i * 4 + 2 - kBlockSize] = (Byte)(d >> 16); - data[i * 4 + 3 - kBlockSize] = (Byte)(d >> 24); - } - returnRes = rar350Mode; - } - } - _count2 = curBufferPos; -} - -void CContext::Final(Byte *digest) -{ - const UInt64 lenInBits = (_count << 9) + ((UInt64)_count2 << 3); - unsigned int curBufferPos = _count2; - int pos = (int)(curBufferPos & 3); - curBufferPos >>= 2; - if (pos == 0) - _buffer[curBufferPos] = 0; - _buffer[curBufferPos++] |= ((UInt32)0x80) << (8 * (3 - pos)); - - while (curBufferPos != (16 - 2)) - { - curBufferPos &= 0xF; - if (curBufferPos == 0) - UpdateBlock(); - _buffer[curBufferPos++] = 0; - } - _buffer[curBufferPos++] = (UInt32)(lenInBits >> 32); - _buffer[curBufferPos++] = (UInt32)(lenInBits); - UpdateBlock(); - - int i; - for (i = 0; i < kDigestSizeInWords; i++) - { - UInt32 state = _state[i] & 0xFFFFFFFF; - *digest++ = (Byte)(state >> 24); - *digest++ = (Byte)(state >> 16); - *digest++ = (Byte)(state >> 8); - *digest++ = (Byte)(state); - } - Init(); -} - -/////////////////////////// -// Words version - -void CContext32::Update(const UInt32 *data, size_t size) -{ - while (size-- > 0) - { - _buffer[_count2++] = *data++; - if (_count2 == kBlockSizeInWords) - { - _count2 = 0; - UpdateBlock(); - } - } -} - -void CContext32::Final(UInt32 *digest) -{ - const UInt64 lenInBits = (_count << 9) + ((UInt64)_count2 << 5); - unsigned int curBufferPos = _count2; - _buffer[curBufferPos++] = 0x80000000; - while (curBufferPos != (16 - 2)) - { - curBufferPos &= 0xF; - if (curBufferPos == 0) - UpdateBlock(); - _buffer[curBufferPos++] = 0; - } - _buffer[curBufferPos++] = (UInt32)(lenInBits >> 32); - _buffer[curBufferPos++] = (UInt32)(lenInBits); - GetBlockDigest(_buffer, digest); - Init(); -} - -}} diff --git a/CPP/7zip/Crypto/Hash/Sha1.h b/CPP/7zip/Crypto/Hash/Sha1.h deleted file mode 100755 index 8ad8675b..00000000 --- a/CPP/7zip/Crypto/Hash/Sha1.h +++ /dev/null @@ -1,68 +0,0 @@ -// Sha1.h -// This file is based on public domain -// Steve Reid and Wei Dai's code from Crypto++ - -#ifndef __SHA1_H -#define __SHA1_H - -#include <stddef.h> -#include "../../../Common/Types.h" - -// 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 - -namespace NCrypto { -namespace NSha1 { - -const unsigned int kBlockSize = 64; -const unsigned int kDigestSize = 20; - -const unsigned int kBlockSizeInWords = (kBlockSize >> 2); -const unsigned int kDigestSizeInWords = (kDigestSize >> 2); - -class CContextBase -{ -protected: - UInt32 _state[5]; - UInt64 _count; - void UpdateBlock(UInt32 *data, bool returnRes = false) - { - GetBlockDigest(data, _state, returnRes); - _count++; - } -public: - void Init(); - void GetBlockDigest(UInt32 *blockData, UInt32 *destDigest, bool returnRes = false); - // PrepareBlock can be used only when size <= 13. size in Words - void PrepareBlock(UInt32 *block, unsigned int size) const; -}; - -class CContextBase2: public CContextBase -{ -protected: - unsigned int _count2; - UInt32 _buffer[kBlockSizeInWords]; - void UpdateBlock() { CContextBase::UpdateBlock(_buffer); } -public: - void Init() { CContextBase::Init(); _count2 = 0; } -}; - -class CContext: public CContextBase2 -{ -public: - void Update(Byte *data, size_t size, bool rar350Mode = false); - void Update(const Byte *data, size_t size) { Update((Byte *)data, size, false); } - void Final(Byte *digest); -}; - -class CContext32: public CContextBase2 -{ -public: - void Update(const UInt32 *data, size_t size); - void Final(UInt32 *digest); -}; - -}} - -#endif diff --git a/CPP/7zip/Crypto/Hash/StdAfx.h b/CPP/7zip/Crypto/Hash/StdAfx.h deleted file mode 100755 index e7fb6986..00000000 --- a/CPP/7zip/Crypto/Hash/StdAfx.h +++ /dev/null @@ -1,8 +0,0 @@ -// StdAfx.h - -#ifndef __STDAFX_H -#define __STDAFX_H - -#include "../../../Common/MyWindows.h" - -#endif |