1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-22 06:38:11 +00:00

UnRAR: Eliminate static var to make code thread-safe

This commit is contained in:
philsmd 2020-09-08 10:48:31 +02:00
parent c9c03dd191
commit 777c5339a0
No known key found for this signature in database
GPG Key ID: 4F25D016D9D6A8AF
2 changed files with 10 additions and 4 deletions

View File

@ -11,10 +11,11 @@
#include <wmmintrin.h>
#endif
static byte S[256],S5[256],rcon[30];
static byte T1[256][4],T2[256][4],T3[256][4],T4[256][4];
static byte T5[256][4],T6[256][4],T7[256][4],T8[256][4];
static byte U1[256][4],U2[256][4],U3[256][4],U4[256][4];
// not thread-safe ?
//static byte S[256],S5[256],rcon[30];
//static byte T1[256][4],T2[256][4],T3[256][4],T4[256][4];
//static byte T5[256][4],T6[256][4],T7[256][4],T8[256][4];
//static byte U1[256][4],U2[256][4],U3[256][4],U4[256][4];
inline void Xor128(void *dest,const void *arg1,const void *arg2)

View File

@ -33,6 +33,11 @@ class Rijndael
int m_uRounds;
byte m_initVector[MAX_IV_SIZE];
byte m_expandedKey[_MAX_ROUNDS+1][4][4];
byte S[256],S5[256],rcon[30];
byte T1[256][4],T2[256][4],T3[256][4],T4[256][4];
byte T5[256][4],T6[256][4],T7[256][4],T8[256][4];
byte U1[256][4],U2[256][4],U3[256][4],U4[256][4];
public:
Rijndael();
void Init(bool Encrypt,const byte *key,uint keyLen,const byte *initVector);