SIde-Channel Analysis toolKit (SICAK)
Software toolkit for side-channel analysis
correv.h
Go to the documentation of this file.
1 /*
2 * SICAK - SIde-Channel Analysis toolKit
3 * Copyright (C) 2018 Petr Socha, FIT, CTU in Prague
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18 
29 #ifndef CORREV_H
30 #define CORREV_H
31 
32 #include <QObject>
33 #include <QCommandLineParser>
34 #include "cpacorreval.h"
35 #include "cpakeyeval.h"
36 
44 class CorrEv: public QObject {
45 
46 Q_OBJECT
47 
48 public:
49 
50  enum CommandLineParseResult {
51  CommandLineTaskPlanned,
52  CommandLineNOP,
53  CommandLineError,
54  CommandLineVersionRequested,
55  CommandLineHelpRequested,
56  CommandLineQueryRequested
57  };
58 
59  CorrEv(QObject *parent = 0) : QObject(parent), m_cpaCorrEval(""), m_cpaKeyEval(""), m_cpaCorrEvalPlugin(nullptr), m_cpaKeyEvalPlugin(nullptr), m_correlations(""), m_correlationsQCount(0), m_correlationsKCount(0), m_samplesPerTrace(0), m_param("") {}
60 
62  CommandLineParseResult parseCommandLineParams(QCommandLineParser & parser);
63 
64 protected:
65 
67  bool loadCorrEvalModule();
69  bool loadKeyEvalModule();
70 
71  QString m_cpaCorrEval;
72  QString m_cpaKeyEval;
73 
74  CpaCorrEval * m_cpaCorrEvalPlugin;
75  CpaKeyEval * m_cpaKeyEvalPlugin;
76 
77  QString m_correlations;
78  size_t m_correlationsQCount;
79  size_t m_correlationsKCount;
80  size_t m_samplesPerTrace;
81 
82  QString m_param;
83 
84 public slots:
85 
87  void queryPlugins();
89  void evaluate();
90 
91 signals:
92 
93  void finished();
94 
95 };
96 
97 #endif /* CORREV_H */
98 
bool loadKeyEvalModule()
Load the specified keyguess evaluation module.
Definition: correv.cpp:218
CPA keyguess evaluation QT plugin interface.
Definition: cpakeyeval.h:42
Correlation matrix evaluation plugin interface for use e.g. in correv.
void queryPlugins()
Query and print available plugins.
Definition: correv.cpp:124
void evaluate()
Run the correlation matrices evaluation and print the retrieved cipher key to the standard output.
Definition: correv.cpp:248
bool loadCorrEvalModule()
Load the specified correlation matrix evaluation module.
Definition: correv.cpp:188
Keyguess evaluation plugin interface for use e.g. in correv.
Class providing text-based UI front-end to CpaCorrEval and CpaKeyEval plug-in modules.
Definition: correv.h:44
CPA correlation matrix evaluation QT plugin interface.
Definition: cpacorreval.h:42
CommandLineParseResult parseCommandLineParams(QCommandLineParser &parser)
Parse parameters from the command line and configuration files and plan tasks for event loop accordin...
Definition: correv.cpp:46