SIde-Channel Analysis toolKit (SICAK)
Software toolkit for side-channel analysis
localcpa.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 LOCALCPA_H
30 #define LOCALCPA_H
31 
32 #include <QObject>
33 #include <QtPlugin>
34 #include "cpaengine.h"
35 #include "exceptions.hpp"
36 #include "ompcpa.hpp"
37 
45 class LocalCPA : public QObject, CpaEngine {
46 
47  Q_OBJECT
48  Q_PLUGIN_METADATA(IID "cz.cvut.fit.Sicak.CpaEngineInterface/1.0" FILE "localcpa.json")
49  Q_INTERFACES(CpaEngine)
50 
51 public:
52 
53  LocalCPA();
54  virtual ~LocalCPA() override;
55 
56  virtual QString getPluginName() override;
57  virtual QString getPluginInfo() override;
58 
59  virtual void init(int platform, int device, size_t noOfTraces, size_t samplesPerTrace, size_t noOfCandidates, const char * param) override;
60  virtual void deInit() override;
61 
62  virtual QString queryDevices() override;
63 
64  virtual void setConstTraces(bool constTraces = false) override;
65 
66  virtual UnivariateContext<double> createContext(const PowerTraces<int16_t> & powerTraces, const PowerPredictions<uint8_t> & powerPredictions) override;
67  virtual void mergeContexts(UnivariateContext<double> & firstAndOut, const UnivariateContext<double> & second) override;
68  virtual Matrix<double> finalizeContext(const UnivariateContext<double> & context) override;
69 
70 };
71 
72 #endif /* LOCALCPA_H */
73 
virtual void setConstTraces(bool constTraces=false) override
When constTraces is set, the engine assumes the PowerTraces object is same in every call to createCon...
Definition: localcpa.cpp:65
CPA computation plugin interface for use e.g. in stan.
virtual Matrix< double > finalizeContext(const UnivariateContext< double > &context) override
Compute correlation matrix based on given context.
Definition: localcpa.cpp:87
A class representing a Two-population Univariate Moment-based statistical context.
Definition: types_stat.hpp:43
This header file contains exceptions.
virtual QString queryDevices() override
Query for devices available.
Definition: localcpa.cpp:61
virtual UnivariateContext< double > createContext(const PowerTraces< int16_t > &powerTraces, const PowerPredictions< uint8_t > &powerPredictions) override
Create a CPA computation context based on given power traces and power predictions.
Definition: localcpa.cpp:70
virtual void mergeContexts(UnivariateContext< double > &firstAndOut, const UnivariateContext< double > &second) override
Merge the two CPA contexts, stores the result in the first of the contexts.
Definition: localcpa.cpp:81
CPA computation engine QT plugin interface.
Definition: cpaengine.h:43
CPA context computation SICAK CpaEngine plugin.
Definition: localcpa.h:45
virtual void init(int platform, int device, size_t noOfTraces, size_t samplesPerTrace, size_t noOfCandidates, const char *param) override
Initialize the CPA computation engine with specified parameters.
Definition: localcpa.cpp:47
A class representing a matrix, stored in the machine's free space.
Definition: types_basic.hpp:305
Implementation of CPA statistical algorithms as function templates for various SICAK plugins.
A class representing a Matrix with 'noOfTraces' power predictions, with 'noOfCandidates' key candidat...
Definition: types_power.hpp:82
virtual QString getPluginName() override
Plugin name.
Definition: localcpa.cpp:39
virtual QString getPluginInfo() override
Plugin info.
Definition: localcpa.cpp:43
A class representing a Matrix with 'noOfTraces' power traces, with 'samplesPerTrace' samples per powe...
Definition: types_power.hpp:44
virtual void deInit() override
Deinitialize the CPA engine.
Definition: localcpa.cpp:57