#include <QCoreApplication>
#include "qaesencryption.h"
#include <QCryptographicHash>
__AFL_FUZZ_INIT();
int main(int argc, char *argv[])
{
#ifdef __AFL_HAVE_MANUAL_CONTROL
__AFL_INIT();
#endif
QCoreApplication a(argc, argv);
while (__AFL_LOOP(10000)) {
QAESEncryption encryption(QAESEncryption::AES_128, QAESEncryption::ECB);
const char *c = reinterpret_cast<const char *>(argv);
QByteArray plainText(c);
QString key("your-string-key");
QString iv("your-IV-vector");
QByteArray hashKey = QCryptographicHash::hash(key.toLocal8Bit(), QCryptographicHash::Sha256);
QByteArray hashIV = QCryptographicHash::hash(iv.toLocal8Bit(), QCryptographicHash::Md5);
QByteArray encodedText = encryption.encode(plainText, hashKey, hashIV);
QByteArray decodedText = encryption.decode(encodedText, hashKey, hashIV);
}
return a.exec();
}