2010-09-11 19:49:30 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2010 Felix Geyer <debfx@fobos.de>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 2 or (at your option)
|
|
|
|
* version 3 of the License.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef KEEPASSX_CRYPTO_H
|
|
|
|
#define KEEPASSX_CRYPTO_H
|
|
|
|
|
2014-06-15 11:17:40 +02:00
|
|
|
#include <QString>
|
|
|
|
|
2010-09-11 19:49:30 +02:00
|
|
|
class Crypto
|
|
|
|
{
|
|
|
|
public:
|
2014-06-15 11:17:40 +02:00
|
|
|
static bool init();
|
2011-11-20 10:24:12 +01:00
|
|
|
static bool initalized();
|
2014-06-15 11:17:40 +02:00
|
|
|
static bool backendSelfTest();
|
|
|
|
static QString errorString();
|
2015-10-10 17:02:43 +02:00
|
|
|
static QString backendVersion();
|
2010-09-11 19:49:30 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
Crypto();
|
2014-06-15 11:17:40 +02:00
|
|
|
static bool checkAlgorithms();
|
|
|
|
static bool selfTest();
|
2015-05-09 19:47:53 +02:00
|
|
|
static void raiseError(const QString& str);
|
|
|
|
static bool testSha256();
|
2015-05-10 00:02:08 +02:00
|
|
|
static bool testAes256Cbc();
|
|
|
|
static bool testAes256Ecb();
|
2015-05-09 19:47:53 +02:00
|
|
|
static bool testTwofish();
|
|
|
|
static bool testSalsa20();
|
2014-06-15 11:17:40 +02:00
|
|
|
|
2010-09-13 23:16:28 +02:00
|
|
|
static bool m_initalized;
|
2014-06-15 11:17:40 +02:00
|
|
|
static QString m_errorStr;
|
2015-10-10 17:02:43 +02:00
|
|
|
static QString m_backendVersion;
|
2010-09-11 19:49:30 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // KEEPASSX_CRYPTO_H
|