SIde-Channel Analysis toolKit (SICAK)
Software toolkit for side-channel analysis
cpaengine.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 CPAENGINE_H
30 #define CPAENGINE_H
31 
32 #include <QString>
33 #include "types_power.hpp"
34 #include "types_stat.hpp"
35 
43 class CpaEngine {
44 
45 public:
46 
47  virtual ~CpaEngine() {}
48 
50  virtual QString getPluginName() = 0;
52  virtual QString getPluginInfo() = 0;
53 
55  virtual void init(int platform, int device, size_t noOfTraces, size_t samplesPerTrace, size_t noOfCandidates, const char * param) = 0;
57  virtual void deInit() = 0;
58 
60  virtual QString queryDevices() = 0;
61 
63  virtual void setConstTraces(bool constTraces = false) = 0;
64 
66  virtual UnivariateContext<double> createContext(const PowerTraces<int16_t> & powerTraces, const PowerPredictions<uint8_t> & powerPredictions) = 0;
68  virtual void mergeContexts(UnivariateContext<double> & firstAndOut, const UnivariateContext<double> & second) = 0;
70  virtual Matrix<double> finalizeContext(const UnivariateContext<double> & context) = 0;
71 
72 };
73 
74 #define CpaEngine_iid "cz.cvut.fit.Sicak.CpaEngineInterface/1.0"
75 
76 Q_DECLARE_INTERFACE(CpaEngine, CpaEngine_iid)
77 
78 
79 #endif /* CPAENGINE_H */
virtual QString getPluginName()=0
Plugin name.
virtual void deInit()=0
Deinitialize the CPA engine.
A class representing a Two-population Univariate Moment-based statistical context.
Definition: types_stat.hpp:43
virtual void mergeContexts(UnivariateContext< double > &firstAndOut, const UnivariateContext< double > &second)=0
Merge the two CPA contexts, stores the result in the first of the contexts.
CPA computation engine QT plugin interface.
Definition: cpaengine.h:43
virtual void init(int platform, int device, size_t noOfTraces, size_t samplesPerTrace, size_t noOfCandidates, const char *param)=0
Initialize the CPA computation engine with specified parameters.
virtual QString getPluginInfo()=0
Plugin info.
virtual void setConstTraces(bool constTraces=false)=0
When constTraces is set, the engine assumes the PowerTraces object is same in every call to createCon...
This header file contains class templates of power traces and power consumption containers.
A class representing a matrix, stored in the machine's free space.
Definition: types_basic.hpp:305
virtual Matrix< double > finalizeContext(const UnivariateContext< double > &context)=0
Compute correlation matrix based on given context.
A class representing a Matrix with 'noOfTraces' power predictions, with 'noOfCandidates' key candidat...
Definition: types_power.hpp:82
virtual QString queryDevices()=0
Query for devices available.
This header file contains class templates of statistical computational contexts.
A class representing a Matrix with 'noOfTraces' power traces, with 'samplesPerTrace' samples per powe...
Definition: types_power.hpp:44
virtual UnivariateContext< double > createContext(const PowerTraces< int16_t > &powerTraces, const PowerPredictions< uint8_t > &powerPredictions)=0
Create a CPA computation context based on given power traces and power predictions.