~ubuntu-branches/ubuntu/vivid/unrar-nonfree/vivid

« back to all changes in this revision

Viewing changes to rijndael.hpp

  • Committer: Package Import Robot
  • Author(s): Martin Meredith
  • Date: 2015-02-03 12:58:01 UTC
  • mfrom: (1.1.18) (5.1.18 sid)
  • Revision ID: package-import@ubuntu.com-20150203125801-od6ev8cqy1er51vz
Tags: 1:5.2.5-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
class Rijndael
17
17
18
18
  private:
 
19
#ifdef USE_SSE
 
20
    void blockEncryptSSE(const byte *input,size_t numBlocks,byte *outBuffer);
 
21
    void blockDecryptSSE(const byte *input, size_t numBlocks, byte *outBuffer);
 
22
 
 
23
    bool AES_NI;
 
24
#endif
19
25
    void keySched(byte key[_MAX_KEY_COLUMNS][4]);
20
26
    void keyEncToDec();
21
 
    void encrypt(const byte a[16], byte b[16]);
22
 
    void decrypt(const byte a[16], byte b[16]);
23
27
    void GenerateTables();
24
28
 
 
29
    // RAR always uses CBC, but we may need to turn it off when calling
 
30
    // this code from other archive formats with CTR and other modes.
 
31
    bool     CBCMode;
 
32
    
25
33
    int      m_uRounds;
26
34
    byte     m_initVector[MAX_IV_SIZE];
27
35
    byte     m_expandedKey[_MAX_ROUNDS+1][4][4];
28
36
  public:
29
37
    Rijndael();
30
38
    void Init(bool Encrypt,const byte *key,uint keyLen,const byte *initVector);
31
 
    size_t blockEncrypt(const byte *input, size_t inputLen, byte *outBuffer);
32
 
    size_t blockDecrypt(const byte *input, size_t inputLen, byte *outBuffer);
 
39
    void blockEncrypt(const byte *input, size_t inputLen, byte *outBuffer);
 
40
    void blockDecrypt(const byte *input, size_t inputLen, byte *outBuffer);
 
41
    void SetCBCMode(bool Mode) {CBCMode=Mode;}
33
42
};
34
43
  
35
44
#endif // _RIJNDAEL_H_