bricke / Qt-AES

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

can't build on windows by vs2013 #2

Closed toby20130333 closed 7 years ago

toby20130333 commented 7 years ago

error C2536: “QAESEncryption::QAESEncryption::sbox”: 无法指定数组的显式初始值设定项 c:\qt\gitcode\qt-aes\debug../qaesencryption.h(83) : 参见“QAESEncryption::sbox”的声明 It's meaning cann't init this sbox array

bricke commented 7 years ago

Hello, unfortunately I do not have a Windows machine with VS to test it with, the sbox array is initialized in the header file as a classic uint8 array, do you have more info on the issue?

toby20130333 commented 7 years ago

I define it out of class it's OK.but some exception in my example

QAESEncryption encryption(QAESEncryption::AES_128, QAESEncryption::ECB); QByteArray plainText = QString("www.heilqt.com").toUtf8(); QByteArray encodedText = encryption.encode(plainText, plainText);//get exception message qDebug()<<"encodedText "<<encodedText; QByteArray decodedText = encryption.decode(encodedText, plainText); qDebug()<<"decodedText "<<decodedText;

bricke commented 7 years ago

You should pass a 128 bit key to encode.

toby20130333 commented 7 years ago

OK I got it,but this exception is not return some warning?

bricke commented 7 years ago

Not yet.

I'll add a warning.