Prepend the mode of operation to showkey's output.
[quassel.git] / src / core / cipher.h
index 33a2bf8..2cd8086 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"));
+    explicit Cipher(QByteArray key, QString cipherType = QString("blowfish"));
     ~Cipher();
     QByteArray decrypt(QByteArray cipher);
     QByteArray decryptTopic(QByteArray cipher);
-    bool encrypt(QByteArraycipher);
+    bool encrypt(QByteArray &cipher);
     QByteArray initKeyExchange();
     QByteArray parseInitKeyX(QByteArray key);
     bool parseFinishKeyX(QByteArray key);
@@ -34,8 +34,9 @@ class Cipher
     bool setType(const QString &type);
     QString type() { return m_type; }
     static bool neededFeaturesAvailable();
+    inline bool usesCBC() { return m_cbc; }
 
-  private:
+private:
     //direction is true for encrypt, false for decrypt
     QByteArray blowfishCBC(QByteArray cipherText, bool direction);
     QByteArray blowfishECB(QByteArray cipherText, bool direction);
@@ -49,4 +50,6 @@ class Cipher
     QString m_type;
     bool m_cbc;
 };
+
+
 #endif // CIPHER_H