unrarsrc  6.1.7
About: unrar extracts, views and tests the contents of archives created with the RAR archiver.
  Fossies Dox: unrarsrc-6.1.7.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

CryptData Class Reference

#include <crypt.hpp>

Collaboration diagram for CryptData:
[legend]

Classes

struct  KDF3CacheItem
 
struct  KDF5CacheItem
 

Public Member Functions

 CryptData ()
 
 ~CryptData ()
 
bool SetCryptKeys (bool Encrypt, CRYPT_METHOD Method, SecPassword *Password, const byte *Salt, const byte *InitV, uint Lg2Cnt, byte *HashKey, byte *PswCheck)
 
void SetAV15Encryption ()
 
void SetCmt13Encryption ()
 
void EncryptBlock (byte *Buf, size_t Size)
 
void DecryptBlock (byte *Buf, size_t Size)
 

Static Public Member Functions

static void SetSalt (byte *Salt, size_t SaltSize)
 

Private Member Functions

void SetKey13 (const char *Password)
 
void Decrypt13 (byte *Data, size_t Count)
 
void SetKey15 (const char *Password)
 
void Crypt15 (byte *Data, size_t Count)
 
void SetKey20 (const char *Password)
 
void Swap20 (byte *Ch1, byte *Ch2)
 
void UpdKeys20 (byte *Buf)
 
void EncryptBlock20 (byte *Buf)
 
void DecryptBlock20 (byte *Buf)
 
void SetKey30 (bool Encrypt, SecPassword *Password, const wchar *PwdW, const byte *Salt)
 
void SetKey50 (bool Encrypt, SecPassword *Password, const wchar *PwdW, const byte *Salt, const byte *InitV, uint Lg2Cnt, byte *HashKey, byte *PswCheck)
 

Private Attributes

KDF3CacheItem KDF3Cache [4]
 
uint KDF3CachePos
 
KDF5CacheItem KDF5Cache [4]
 
uint KDF5CachePos
 
CRYPT_METHOD Method
 
Rijndael rin
 
uint CRCTab [256]
 
byte SubstTable20 [256]
 
uint Key20 [4]
 
byte Key13 [3]
 
ushort Key15 [4]
 

Detailed Description

Definition at line 23 of file crypt.hpp.

Constructor & Destructor Documentation

◆ CryptData()

CryptData::CryptData ( )

Definition at line 11 of file crypt.cpp.

References CRCTab, CRYPT_NONE, KDF3Cache, KDF3CachePos, KDF5Cache, KDF5CachePos, and Method.

◆ ~CryptData()

CryptData::~CryptData ( )

Definition at line 22 of file crypt.cpp.

References cleandata(), KDF3Cache, and KDF5Cache.

Member Function Documentation

◆ Crypt15()

void CryptData::Crypt15 ( byte Data,
size_t  Count 
)
private

Definition at line 65 of file crypt1.cpp.

References CRCTab, Key15, and rotrs.

Referenced by DecryptBlock().

◆ Decrypt13()

void CryptData::Decrypt13 ( byte Data,
size_t  Count 
)
private

Definition at line 53 of file crypt1.cpp.

References Key13.

Referenced by DecryptBlock().

◆ DecryptBlock()

void CryptData::DecryptBlock ( byte Buf,
size_t  Size 
)

◆ DecryptBlock20()

void CryptData::DecryptBlock20 ( byte Buf)
private

Definition at line 88 of file crypt2.cpp.

References Key20, NROUNDS, RawGet4(), RawPut4(), rotls, substLong, and UpdKeys20().

Referenced by DecryptBlock().

◆ EncryptBlock()

void CryptData::EncryptBlock ( byte Buf,
size_t  Size 
)

◆ EncryptBlock20()

void CryptData::EncryptBlock20 ( byte Buf)
private

Definition at line 62 of file crypt2.cpp.

References Key20, NROUNDS, RawGet4(), RawPut4(), rotls, substLong, and UpdKeys20().

Referenced by SetKey20().

◆ SetAV15Encryption()

void CryptData::SetAV15Encryption ( )

Definition at line 33 of file crypt1.cpp.

References CRCTab, CRYPT_RAR15, InitCRC32(), Key15, and Method.

Referenced by ComprDataIO::SetAV15Encryption().

◆ SetCmt13Encryption()

void CryptData::SetCmt13Encryption ( )

Definition at line 44 of file crypt1.cpp.

References CRYPT_RAR13, Key13, and Method.

Referenced by ComprDataIO::SetCmt13Encryption().

◆ SetCryptKeys()

bool CryptData::SetCryptKeys ( bool  Encrypt,
CRYPT_METHOD  Method,
SecPassword Password,
const byte Salt,
const byte InitV,
uint  Lg2Cnt,
byte HashKey,
byte PswCheck 
)

◆ SetKey13()

void CryptData::SetKey13 ( const char *  Password)
private

Definition at line 3 of file crypt1.cpp.

References Key13, and rotls.

Referenced by SetCryptKeys().

◆ SetKey15()

void CryptData::SetKey15 ( const char *  Password)
private

Definition at line 17 of file crypt1.cpp.

References CRC32(), CRCTab, InitCRC32(), and Key15.

Referenced by SetCryptKeys().

◆ SetKey20()

void CryptData::SetKey20 ( const char *  Password)
private

◆ SetKey30()

void CryptData::SetKey30 ( bool  Encrypt,
SecPassword Password,
const wchar PwdW,
const byte Salt 
)
private

◆ SetKey50()

◆ SetSalt()

static void CryptData::SetSalt ( byte Salt,
size_t  SaltSize 
)
static

◆ Swap20()

void CryptData::Swap20 ( byte Ch1,
byte Ch2 
)
private

Definition at line 128 of file crypt2.cpp.

References Ch.

Referenced by SetKey20().

◆ UpdKeys20()

void CryptData::UpdKeys20 ( byte Buf)
private

Definition at line 116 of file crypt2.cpp.

References CRCTab, and Key20.

Referenced by DecryptBlock20(), and EncryptBlock20().

Member Data Documentation

◆ CRCTab

uint CryptData::CRCTab[256]
private

Definition at line 71 of file crypt.hpp.

Referenced by Crypt15(), CryptData(), SetAV15Encryption(), SetKey15(), SetKey20(), and UpdKeys20().

◆ KDF3Cache

KDF3CacheItem CryptData::KDF3Cache[4]
private

Definition at line 61 of file crypt.hpp.

Referenced by CryptData(), SetKey30(), and ~CryptData().

◆ KDF3CachePos

uint CryptData::KDF3CachePos
private

Definition at line 62 of file crypt.hpp.

Referenced by CryptData(), and SetKey30().

◆ KDF5Cache

KDF5CacheItem CryptData::KDF5Cache[4]
private

Definition at line 64 of file crypt.hpp.

Referenced by CryptData(), SetKey50(), and ~CryptData().

◆ KDF5CachePos

uint CryptData::KDF5CachePos
private

Definition at line 65 of file crypt.hpp.

Referenced by CryptData(), and SetKey50().

◆ Key13

byte CryptData::Key13[3]
private

Definition at line 76 of file crypt.hpp.

Referenced by Decrypt13(), SetCmt13Encryption(), and SetKey13().

◆ Key15

ushort CryptData::Key15[4]
private

Definition at line 77 of file crypt.hpp.

Referenced by Crypt15(), SetAV15Encryption(), and SetKey15().

◆ Key20

uint CryptData::Key20[4]
private

Definition at line 74 of file crypt.hpp.

Referenced by DecryptBlock20(), EncryptBlock20(), SetKey20(), and UpdKeys20().

◆ Method

CRYPT_METHOD CryptData::Method
private

◆ rin

Rijndael CryptData::rin
private

Definition at line 69 of file crypt.hpp.

Referenced by DecryptBlock(), SetKey30(), and SetKey50().

◆ SubstTable20

byte CryptData::SubstTable20[256]
private

Definition at line 73 of file crypt.hpp.

Referenced by SetKey20().


The documentation for this class was generated from the following files: