5#include <bits/stdc++.h>
8#define Max_Name_Length 10000
10#define FullOne 0xffffffffffffffff
11#define GroupInput 0x8000000000000000
12#define RandomInput 0x4000000000000000
13#define SameInput 0x2000000000000000
14#define GroupInMask 0xf000000000000000
16#define CellType_Gate 0
19#define Operation_AND 0
21#define Operation_XOR 2
22#define Operation_NOT 3
24#define SignalType_input 0
25#define SignalType_output 1
26#define SignalType_wire 2
28#define Task_find_module_type 0
29#define Task_find_module_name 1
30#define Task_find_open_bracket 2
31#define Task_find_point 3
32#define Task_find_IO_port 4
33#define Task_find_signal_name 5
34#define Task_find_close_bracket 6
35#define Task_find_comma 7
36#define Task_find_assign_signal_name1 8
37#define Task_find_equal 9
38#define Task_find_assign_signal_name2 10
unsigned char NumberOfCases
Hardware::OperationStruct * Operations
Defines a hardware circuit.
short MaxDepth
The maximum circuit depth.
int NumberOfRegs
The number of registers in the circuit.
Hardware::SignalStruct ** Signals
The circuit signals.
int ** CellsInDepth
The indices of cells with a specific depth.
int * Outputs
The indices of all primary output signals.
int * NumberOfCellsInDepth
The number of cells with a specific depth.
int * Gates
The indices of all gates.
Hardware::CellStruct ** Cells
The circuit cells.
int NumberOfCells
The number of cells in the circuit.
int NumberOfGates
The indices of all regs.
int NumberOfOutputs
Number of primary outputs.
int * Inputs
The indices of all primary input signals.
int NumberOfInputs
Number of primary inputs.
int NumberOfSignals
The total number of signals in the circuit.
Defines an already extended probe, i.e. a set of glitch extended probes.
int * Probes
A list of glitch-extended probes.
int NumberOfProbes
The number of glitch-extended probes.
int NumberOfCellTypes
The number of different cell types in the library.
Hardware::CellTypeStruct ** CellTypes
The different cell types in the library.
unsigned char * NumberOfOperandsInClause
unsigned char ** OperandsInClause
unsigned char NumberOfClauses
ProbePositionStruct(unsigned int, unsigned int)
Initializes a single probe with a specific position and clock cycle.
unsigned int Cycle
The clock cycle in which the signal driven by a wire is recorded.
ProbePositionStruct()
Initializes a new probe.
unsigned int Probe
The position of a probe, i.e. the probed signal, given by the index of the signal.
Defines a probing set, i.e. a set of standard probes with their corresponding glitch extensions.
Hardware::GlitchExtendedProbesStruct * GlitchExtendedProbes
A list of glitch-extensions per standard probe.
char ** ProbeName
A list of the standard probe names.
int NumberOfProbes
The number of standard probes.
int * Probes
A list of the standard probe indices.
bool Covers(Hardware::ProbingSetStruct &)
Checks if the probing set covers another probing set.
ProbingSetStruct(unsigned int)
Initializes a probing set with a single standard probe.
ProbingSetStruct(std::vector< unsigned int > &)
Initializes a probing set with a list of standard probes.
std::vector< unsigned int > Extension
The extensions of the standard probes, i.e. glitch- and transition-extended probes.
Util::ContingencyTableStruct ContingencyTable
The contingency table storing the occurences of values probed by the extended probes.
std::vector< unsigned int > Standard
The standard probes placed by an adversary.
int FindEntry(Util::TableEntryStruct &, unsigned int)
Checks if the contingency table contains a particular entry.
Defines the settings of the evaluation procedure.
int Max_No_ReportEntries
The maximum number of entries in the report.
char CompactDistributions
Decision whether the evaluation should be performed in compact or normal mode.
int ** OutputSignals
The simulated output signals (unshared).
int TestTransitional
Decision whether transitional leakage is included.
int TestMultivariate
Decision whether univariate or multivariate adversaries should be considered.
int ** Group_Values
The values assigned to the user-defined groups.
int NumberOfTestClockCycles
The number of clock cycles in which the adversary can place probes.
int InitialSim_NumberOfInputs
The number of inputs which are assigned to initialize the simulation.
int * TestClockCycles
The particular clock cycles the adversary can target.
char * ModuleName
The name of the top module.
int * EndSimCondition_Signals
The indices of the single-bit signals terminating the simulation.
int EndSim_NumberOfWaitCycles
Number of cycles to wait after each simulation.
uint64_t NumberOfStepSimulationsToWrite
The number of simulations before a report is written.
unsigned int ProbeStepSize
The number of probing sets to evaluate per execution step.
uint64_t NumberOfStepSimulations
The number of simulations before the simulations are evaluated.
int TestOrder
The security order to test.
char MinimizeProbeSets
Decision whether the number of probing sets should be minimized before the evaluation.
int EndSimCondition_NumberOfSignals
The bit width of the signal which terminates the simulation.
uint64_t ** InitialSim_Values
The signal values during the initialization cycles.
int InitialSim_NumberOfClockCycles
The number of clock cycles to initialize the simulation.
int ClockSignal
The index of the clock signal.
int NumberOfOutputSignals
The bit width of the shared output.
int NumberOfGroups
The number of user-defined groups.
uint64_t NumberOfSimulations
The total number of simulations.
int NumberOfGroupValues
The size of the group values, i.e. their bit length.
int Max_no_of_Threads
The maximum number of threads PROLEAD can use for parallelism.
int Max_No_ClockCycles
The maximum number of clock cycles to simulate.
int * MaxNumberOfSharesGroupValues
The number of shares per input bit.
int ** ExpectedOutputValues
The expected unshared output given by the user.
int * AlwaysRandomInputs
Indices of the fresh random input signals.
int NumberOfAlwaysRandomInputs
Number of fresh random inputs.
int EndSimCondition_ClockCycles
The number of clock cycles after which the simulation terminates.
int ** InitialSim_Inputs
The indices of the initialization signals.
int MaxDistanceMultivariet
The maximum distance in time, i.e. clock cycles, for multivariate adversaries.
char RemoveProbingSets
Decision whether probing sets achieving a sufficient confidence level should be removed.
int NumberOfOutputShares
The number of output shares.
uint64_t * EndSimCondition_Values
The values the signals have to reach to terminate the simulation.
Defines the shared state of a simulation.
uint64_t * LastInitialSimValues
uint64_t ** SelectedGroupValues
Defines all settings regarding simulations.
Hardware::GlitchExtendedProbesStruct * GlitchExtendedProbes
The glitch-extended probes belonging to the standard probes.
int * GlitchExtendedProbeIndex_of_Signal
uint64_t NumberOfStepSimulationsToWrite
The number of simulations after which reports are written.
int NumberOfProbes
The total number of standard probes.
uint64_t NumberOfProcessedSimulations
The number of currently processed simulations.
int * SelectedGroups
The chosen group for each simulation.
int NumberOfTestClockCycles
Number of clock cycles in which standard probes can record.
uint64_t NumberOfStepSimulations
The number of simulations per step. After each step the contingency tables are updated.
uint64_t NumberOfSimulations
The total number of simulations.
int NumberOfGroups
The number of user-defined groups.
int * SignalIndex_of_GlitchExtendedProbe
int NumberOfAllGlitchExtendedProbes
The total number of glitch-extended probes.
char ** ProbeName
The names of the standard probes, i.e. the name of the probed wire.
char *** ProbeValues
The simulated states of all wires during different simulations and clock cycles.
int NumberOfClockCycles
Number of clock cycles to simulate, i.e. the duration of one simulation.
char * EvaluationResultFolderName
Name and path of the generated reports.
int TestMultivariate
Decision regarding univariate and multivariate attackers.
int TestOrder
The security order to test.
int * TestClockCycles
The list of clock cycles to test.
int TestTransitional
Decision regarding transitional leakage.
char ** GlitchExtendedProbeName
The names of the glitch-extended probes, i.e. the name of the probed wire.
Defines all settings belonging to the test prodecure.
std::vector< std::vector< Util::TableEntryStruct > > TableEntries
A list of table entries which will be added to the contingency tables in normal mode.
Hardware::ProbePositionStruct GetExtendedProbe(unsigned int, unsigned int)
Gives a particular (glitch or transition)-extended probe inside a probing set.
int GetNumberOfStandardProbes(unsigned int)
Computes the number of standard probes in a probing set.
std::vector< Hardware::ProbePositionStruct > ExtendedProbes
A list of all glitch-extended probes.
std::vector< double > SumOverGroup
Stores the number of simulations per group.
Hardware::UniqueProbeStruct ** UniqueProbe
Hardware::ProbePositionStruct GetStandardProbe(Hardware::ProbingSetStruct &, unsigned int)
Gives a particular standard probe inside a probing set.
Hardware::ProbePositionStruct GetExtendedProbe(Hardware::ProbingSetStruct &, unsigned int)
Gives a particular (glitch or transition)-extended probe inside a probing set.
Hardware::ProbePositionStruct GetStandardProbe(unsigned int, unsigned int)
Gives a particular standard probe inside a probing set.
TestStruct(Hardware::SimulationStruct &)
Initializes the test settings.
std::vector< Hardware::ProbingSetStruct > ProbingSet
A list of all probing sets to evaluate.
std::vector< std::vector< int > > TempProbeValue
A list of table entries which will be added to the contingency tables in compact mode.
std::vector< Hardware::ProbePositionStruct > StandardProbes
A list of all standard probes.
Defines a unique probe for the compact mode.
unsigned int Probe
The position of a probe, i.e. the probed signal, given by the index of the signal.
unsigned int NumberOfProbeSets
The number of probing sets in which this standard probe occurs.
unsigned int Cycle
The clock cycle in which the signal driven by a wire is recorded.
unsigned int * ProbeSetIndexes
The indices of all probing sets in which this standard probe occurs.
Defines a contingency table.
Defines one entry of a contingency table.