SIde-Channel Analysis toolKit (SICAK)
Software toolkit for side-channel analysis
stan.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 STAN_H
30 #define STAN_H
31 
32 #include <QObject>
33 #include <QCommandLineParser>
34 #include "cpaengine.h"
35 #include "ttestengine.h"
36 
44 class Stan: 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  Stan(QObject *parent = 0) : QObject(parent), m_id(""), m_platform(0), m_device(0), m_param(""), m_cpaEngine(nullptr), m_tTestEngine(nullptr), m_cpaModule(""), m_tTestModule(""), m_randomTraces(""), m_randomTracesCount(0), m_constantTraces(""), m_constantTracesCount(0), m_samplesPerTrace(0), m_predictions(""), m_predictionsSetsCount(0), m_predictionsCandidatesCount(0), m_contextA(""), m_contextB("") {}
60 
62  CommandLineParseResult parseCommandLineParams(QCommandLineParser & parser);
63 
64 protected:
65 
67  bool loadCpaModule();
69  bool loadTTestModule();
70 
71  QString m_id;
72  int m_platform;
73  int m_device;
74  QString m_param;
75 
76  CpaEngine * m_cpaEngine;
77  TTestEngine * m_tTestEngine;
78 
79  QString m_cpaModule;
80  QString m_tTestModule;
81 
82  QString m_randomTraces;
83  size_t m_randomTracesCount;
84 
85  QString m_constantTraces;
86  size_t m_constantTracesCount;
87 
88  size_t m_samplesPerTrace;
89 
90  QString m_predictions;
91  size_t m_predictionsSetsCount;
92  size_t m_predictionsCandidatesCount;
93 
94  QString m_contextA;
95  QString m_contextB;
96 
97 
98 public slots:
99 
101  void queryPlugins();
102 
104  void cpaCreate();
106  void cpaMerge();
108  void cpaFinalize();
109 
111  void tTestCreate();
113  void tTestMerge();
115  void tTestFinalize();
116 
117 signals:
118 
119  void finished();
120 
121 };
122 
123 #endif /* STAN_H */
124 
bool loadCpaModule()
Load the specified CPA computation module.
Definition: stan.cpp:352
CPA computation plugin interface for use e.g. in stan.
void tTestMerge()
Merge the existing t-test contexts and save it to file.
Definition: stan.cpp:1053
void cpaCreate()
Create a new CPA contexts and save them to file.
Definition: stan.cpp:410
void queryPlugins()
Query and print available plugins.
Definition: stan.cpp:287
CPA computation engine QT plugin interface.
Definition: cpaengine.h:43
t-test computation plugin interface for use e.g. in stan
t-test computation engine QT plugin interface
Definition: ttestengine.h:43
void tTestFinalize()
Finalize the existing t-test context and save the t-vals and degrees of freedom to file.
Definition: stan.cpp:1200
void tTestCreate()
Create a new t-test context and save it to file.
Definition: stan.cpp:885
void cpaFinalize()
Finalize the existing CPA context and save correlation matrices to file.
Definition: stan.cpp:746
void cpaMerge()
Merge the existing CPA contexts and save them to file.
Definition: stan.cpp:591
CommandLineParseResult parseCommandLineParams(QCommandLineParser &parser)
Parse parameters from the command line and configuration files and plan tasks for event loop accordin...
Definition: stan.cpp:46
Class providing text-based UI front-end to CpaEngine and TTestEngine plug-in modules.
Definition: stan.h:44
bool loadTTestModule()
Load the specified t-test computation module.
Definition: stan.cpp:381