bricke / Qt-AES

Native Qt AES encryption class
The Unlicense
501 stars 187 forks source link

Can't run in 32bit Qt #35

Open iwxyi opened 3 years ago

iwxyi commented 3 years ago

It will crash in MinGW32

bricke commented 3 years ago

Any error log?

L0wperformer commented 2 years ago

for me it ran with MinGW32 but only when built using cmake

ImbellicusAnimo commented 2 years ago

Any error log?

I've tried to build and run the tests using the supplied pro file. Log output from running the tests:


Start testing of AesTest Config: Using QtTest library 5.12.3, Qt 5.12.3 (i386-little_endian-ilp32 shared (dynamic) debug build; by GCC 7.3.0) QDEBUG : AesTest::initTestCase() AESNI Enabled PASS : AesTest::initTestCase() A crash occurred in E:_workspaces\Qt-AES-master\debug\QAESEncryption.exe. Function time: 0ms Total time: 4ms

Exception address: 0x004017e1 Exception code : 0xc0000005

Stack: 1: ZN5QTest15toPrettyUnicodeEPKti() - 0x640026d6 2: UnhandledExceptionFilter() - 0x777a8e90 3: RtlGetFullPathName_UEx() - 0x77c58b30 4: RtlGetFullPathName_UEx() - 0x77c58b30

When i run in debug mode, it breaks in function "QByteArray QAESEncryption::expandKey(const QByteArray &key)" on the call "AES_128_Key_Expansion(uchar_key, ret);" in line 185.

File "qaesencryption.cpp": grafik

File "aesni-key-exp.h": grafik

When building and running through cmake all works fine.

ImbellicusAnimo commented 2 years ago

for me it ran with MinGW32 but only when built using cmake

Turns out, if built with cmake it's without aes_ni enabled.

bugaenko-cyber commented 10 months ago

Hello! The problem is on Qt 5.15.2 mingw32 and it doesn’t matter cmake or qmake, in Qt 5.15.2 x64, Qt 6.5.3 x64 everything works. In all cases the error is here tmp = _mm_xor_si128 (tmp,((__m128i*)key)[0]);

image

Start testing of AesTest Config: Using QtTest library 5.15.2, Qt 5.15.2 (i386-little_endian-ilp32 shared (dynamic) release build; by GCC 8.1.0), windows 10 QDEBUG : AesTest::initTestCase() AESNI Enabled PASS : AesTest::initTestCase() A crash occurred in C:\test\build-qaesencryption-Desktop_Qt_5_15_2_MinGW_32_bit-Debug\debug\QAESEncryption.exe. Function time: 0ms Total time: 3ms

Exception address: 0x0040292b Exception code : 0xc0000005

Stack: 1: ZN24QAbstractItemModelTester11qt_metacallEN11QMetaObject4CallEiPPv() - 0x6efe3f30 2: UnhandledExceptionFilter() - 0x755426b0 3: RtlCaptureStackContext() - 0x77318e30 4: RtlGetAppContainerNamedObjectPath() - 0x772f7b50