1 --- rijndael.cpp.orig 2014-06-10 17:14:06 UTC
4 ***************************************************************************/
10 #include <wmmintrin.h>
16 +#endif // OPENSSL_AES
18 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
27 +#endif // OPENSSL_AES
28 CBCMode = true; // Always true for RAR.
32 void Rijndael::Init(bool Encrypt,const byte *key,uint keyLen,const byte * initVector)
35 + const EVP_CIPHER *cipher;
39 + cipher = EVP_aes_128_cbc();
42 + cipher = EVP_aes_192_cbc();
45 + cipher = EVP_aes_256_cbc();
49 + EVP_CIPHER_CTX_init(&ctx);
50 + EVP_CipherInit_ex(&ctx, cipher, NULL, key, initVector, Encrypt);
51 + EVP_CIPHER_CTX_set_padding(&ctx, 0);
54 // Check SSE here instead of constructor, so if object is a part of some
55 // structure memset'ed before use, this variable is not lost.
60 +#endif // OPENSSL_AES
70 + EVP_CipherUpdate(&ctx, outBuffer, &outLen, input, inputLen);
73 size_t numBlocks=inputLen/16;
79 memcpy(m_initVector,iv,16);
81 +#endif // OPENSSL_AES
91 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
93 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
95 U1[b][0]=U2[b][1]=U3[b][2]=U4[b][3]=T5[i][0]=T6[i][1]=T7[i][2]=T8[i][3]=FFmul0e(b);
99 +#endif // OPENSSL_AES
102 static void TestRijndael();