core: Remove slots from storage APIs
[quassel.git] / src / core / cipher.h
index 33a2bf8..01cf9dd 100644 (file)
 #ifndef CIPHER_H
 #define CIPHER_H
 
-#include<QtCrypto>
+#include <QtCrypto>
 
 class Cipher
 {
-  public:
+public:
     Cipher();
-    explicit Cipher(QByteArray key, QString cipherType=QString("blowfish"));
-    ~Cipher();
+    explicit Cipher(QByteArray key, QString cipherType = QString("blowfish"));
     QByteArray decrypt(QByteArray cipher);
     QByteArray decryptTopic(QByteArray cipher);
     bool encrypt(QByteArray& cipher);
@@ -31,12 +30,13 @@ class Cipher
     bool parseFinishKeyX(QByteArray key);
     bool setKey(QByteArray key);
     QByteArray key() { return m_key; }
-    bool setType(const QString &type);
+    bool setType(const QStringtype);
     QString type() { return m_type; }
     static bool neededFeaturesAvailable();
+    inline bool usesCBC() { return m_cbc; }
 
-  private:
-    //direction is true for encrypt, false for decrypt
+private:
+    // direction is true for encrypt, false for decrypt
     QByteArray blowfishCBC(QByteArray cipherText, bool direction);
     QByteArray blowfishECB(QByteArray cipherText, bool direction);
     QByteArray b64ToByte(QByteArray text);
@@ -49,4 +49,5 @@ class Cipher
     QString m_type;
     bool m_cbc;
 };
-#endif // CIPHER_H
+
+#endif  // CIPHER_H