Skip to content

Structure

Nicolai Mueller edited this page Aug 31, 2022 · 34 revisions

PROLEAD's structure consists of two directories.

  1. The inc folder contains all header files (.hpp) encompassing the function declarations.
  2. The src folder contains all source files (.cpp) encompassing the function definitions.

All files related to the evaluation of hardware circuits are stored in the Hardware subdirectories (inc/Hardware and inc/Hardware) while the Util subdirectory stores all files that declare and define generic functions.

PROLEAD

The PROLEAD file (src/PROLEAD.cpp) defines the main function of PROLEAD.

Definitions

The Definitions files (inc/Hardware/Definitions.hpp and src/Hardware/Definitions.cpp) define all structures of PROLEAD. We list all structures below:

OperationStruct - Defines one operation of the circuit.
CellTypeStruct - Defines the type of a hardware cell.
LibraryStruct - Defines the cell library.
CellStruct - Defines a hardware cell.
SignalStruct - Defines a signal.
CircuitStruct - Defines the full hardware circuit.
SettingsStruct - Defines the evaluation settings.
ProbesStruct - Defines a standard probe.
GlitchExtendedProbesStruct - Defines a glitch extension.
SharedDataStruct - Defines the shared data.
SimulationStruct - Defines the simulation parameters.
TableEntryStruct - Defines a distribution in form of a contingency table.
ProbePositionStruct - Defines a probe with timing.
ProbingSetStruct - Defines a probing set.
UniqueProbeStruct - Defines a unique probe for the compact mode.
TestStruct - Defines the test parameters.

Execute

The Execute files (inc/Hardware/Execute.hpp and src/Hardware/Execute.cpp) define the execution of PROLEAD based on a given set of command line parameters. These files implement the following functions:

Hardware::Execute

Executes PROLEAD based on a given set of command line parameters.

Parameters

CommandLineParameterStruct& Parameter - The command line parameters.

Return value

(none)

Prepare

The Prepare files (inc/Hardware/Prepare.hpp and src/Hardware/Prepare.cpp) define all functions for preparation before the actual evaluation takes place. These files implement the following functions:

Hardware::Prepare::All

Prepares everything for the evaluation.

Parameters

CommandLineParameterStruct& Parameter - The command line parameters.
Hardware::CircuitStruct& Circuit - The hardware circuit.
Hardware::LibraryStruct& Library - The circuit library.
Hardware::SettingsStruct& Settings - The evaluation settings.
Hardware::ProbesStruct& Probes - The probes.
Hardware::SimulationStruct& Simulation - The simulation settings.
Hardware::SharedDataStruct*& SharedData - The shared data.

Return value

(none)

Hardware::Prepare::MakeCircuitDepth

Computes the combinational depth (number of subsequent combaintionl gates) of all cells and signals.

Parameters

Hardware::CircuitStruct& Circuit - The hardware circuit.
Hardware::LibraryStruct& Library - The circuit library.

Return value

(none)

Hardware::Prepare::Probes

Places standard probes on all considered register inputs and primary outputs of the circuit.

Parameters

Hardware::CircuitStruct& Circuit - The hardware circuit.
Hardware::LibraryStruct& Library - The circuit library.
Hardware::SettingsStruct& Settings - The evaluation settings.
Hardware::ProbesStruct& Probes - The probes.

Return value

(none)

Hardware::Prepare::ExtendProbe

Extends a standard probe to a glitch-extended probe.

Parameters

Hardware::CircuitStruct* Circuit - The hardware circuit.
Hardware::LibraryStruct* Library - The circuit library.
Hardware::SettingsStruct* Settings - The evaluation settings.
int MainSignalIndex - The signal index of the standard probe.
int SignalIndex - The signal index of the current probe extension.
int* Buffer_int - The list of glitch-extensions.

Return value

(none)

Hardware::Prepare::Simulation

Prepares the simulation settings.

Parameters

Hardware::CircuitStruct& Circuit - The hardware circuit.
Hardware::SettingsStruct& Settings - The evaluation settings.
Hardware::ProbesStruct& Probes - The probes.
Hardware::SimulationStruct& Simulation - The simulation settings.
char* EvaluationResultFolderName - The name of the result directory.

Return value

(none)

Hardware::Prepare::SharedData

Prepares the shared data.

Parameters

Hardware::CircuitStruct* Circuit - The hardware circuit.
Hardware::SettingsStruct* Settings - The evaluation settings.
Hardware::SharedDataStruct* SharedData - The shared data.

Return value

(none)

Read

The Read files (inc/Hardware/Read.hpp and src/Hardware/Read.cpp) define all functions for reading files. These files implement the following functions:

Hardware::Read::NonCommentFromFile

Read from file by ignoring comments.

Parameters

FILE *FileHeader - The file to read.
char *Str - The parsed string.
const char *CommentSyntax - The comment syntax.

Return value

(none)

Hardware::Read::MakeFormulaForCellInLibrary

Creates formula for a cell.

Parameters

CellTypeStruct *CellType - The cell.

Return value

int - 0 = Passed, 1 = Failed.

Hardware::Read::LibraryFile

Read in the library file.

Parameters

char *LibraryFileName - The name of the library file.
char *LibraryName - The name of the library.
Hardware::LibraryStruct* Library - The parsed library.

Return value

(none)

Hardware::Read::DesignFile

Read in the design file.

Parameters

char *InputVerilogFileName - The name of the design file.
char *MainModuleName - The name of the top module.
LibraryStruct* Library - The library.
CircuitStruct* Circuit - The parsed circuit.

Return value

(none)

Hardware::Read::SettingsFile

Read in the settings file.

Parameters

char *InputSettingsFileName - The name of the settings file.
Hardware::SettingsStruct& Settings - The evaluation settings.
CircuitStruct* Circuit - The parsed circuit.

Return value

(none)

GenerateProbingSets

The GenerateProbingSets files (inc/Hardware/GenerateProbingSets.hpp and src/Hardware/GenerateProbingSets.cpp) define all functions for generating the probing sets for evaluation. These files implement the following functions:

Hardware::GenerateProbingSets::All

Does the generation of all required probing sets.

Parameters

Hardware::SettingsStruct& Settings - The evaluation settings.
Hardware::SimulationStruct& Simulation - The simulation settings.
Hardware::TestStruct& Test - The evaluation details.

Return value

(none)

Hardware::GenerateProbingSets::GenerateProbes

Generates a list of all considered standard probes and a second list with all considered glitch extensions.

Parameters

Hardware::SimulationStruct& Simulation - The simulation settings.
Hardware::TestStruct& Test - The evaluation details.

Return value

(none)

Hardware::GenerateProbingSets::InitializeMultivariateProbeCombinations

Prepares the combination of probes to multivariate probing sets.

Parameters

Hardware::SimulationStruct& Simulation - The simulation settings.
Hardware::TestStruct& Test - The evaluation details.
std::vector& Combination - The combination of probes.
std::vector& CombinationBitmask - The combination of probes as bitmask.

Return value

(none)

Hardware::GenerateProbingSets::InitializeUnivariateProbeCombinations

Prepares the combination of probes to univariate probing sets.

Parameters

Hardware::SimulationStruct& Simulation - The simulation settings.
std::vector& Combination - The combination of probes.
std::vector& CombinationBitmask - The combination of probes as bitmask.

Return value

(none)

Hardware::GenerateProbingSets::InDistance

Checks whether a probing set satisfies the distance bounds.

Parameters

Hardware::SettingsStruct& Settings - The evaluation settings.
Hardware::TestStruct& Test - The evaluation details.
std::vector& ProbingSet - A single probing set.

Return value

(none)

Hardware::GenerateProbingSets::Extend

Extend probing sets to glitch-extended probing sets.

Parameters

Hardware::SimulationStruct& Simulation - The simulation settings.
Hardware::TestStruct& Test - The evaluation details.

Return value

(none)

Hardware::GenerateProbingSets::RemoveDuplicatedProbes

Removes all duplicates (probes that occur twice or more) from the probing sets.

Parameters

Hardware::TestStruct& Test - The evaluation details.

Return value

(none)

Hardware::GenerateProbingSets::CoverWithOneProbingSet

Removes a set of probing sets with one probing set.

Parameters

Hardware::TestStruct& Test - The evaluation details.
unsigned int SetIndex - The index of the probing set for removing.
unsigned int Start - The index of the first probing set to remove.
unsigned int End - The index of the last probing set to remove.

Return value

(none)

Hardware::GenerateProbingSets::RemoveCoveredProbingSets

Removes a set of probing sets with another set of probing sets.

Parameters

Hardware::TestStruct& Test - The evaluation details.
unsigned int Start - The index of the first probing set to remove.
unsigned int End - The index of the last probing set to remove.

Return value

(none)

Hardware::GenerateProbingSets::RemoveDuplicatedProbingSets

Removes all probing sets which are fully covered by another probing set.

Parameters

Hardware::SettingsStruct& Settings - The evaluation settings.
Hardware::SimulationStruct& Simulation - The simulation settings.
Hardware::TestStruct& Test - The evaluation details.

Return value

(none)

Hardware::GenerateProbingSets::Remove

Decides whether a probing set must be removed.

Parameters

ProbingSetStruct& ProbingSet - The probing set.

Return value

(none)

Hardware::GenerateProbingSets::InitializeCompactDistributions

Initialize (pre-allocate) the distributions of all probing set in compact mode.

Parameters

Hardware::SettingsStruct& Settings - The evaluation settings.
Hardware::SimulationStruct& Simulation - The simulation settings.
Hardware::TestStruct& Test - The evaluation details.

Return value

(none)

Simulate

The Simulate files (inc/Hardware/Simulate.hpp and src/Hardware/Simulate.cpp) define all functions for the simulation procedure. These files implement the following functions:

Hardware::Simulate::EvaluateOperation

Simulates the result of a single operation.

Parameters

Hardware::OperationStruct Operation - The operation to evaluate.
uint64_t *Values - The input state.
char Intermediate - The intermediate state index.

Return value

(none)

Hardware::Simulate::All

Simulates the whole circuit.

Parameters

Hardware::CircuitStruct& Circuit - The hardware circuit.
Hardware::LibraryStruct& Library - The circuit library.
Hardware::SettingsStruct& Settings - The evaluation settings.
Hardware::SimulationStruct& Simulation - The simulation settings.
Hardware::SharedDataStruct* SharedData - The shared data.
int SimulationIndex - The simulation index.
boost::mt19937& ThreadRng - The PRNG.

Return value

(none)

Analyze

The Analyze files (inc/Hardware/Analyze.hpp and src/Hardware/Analyze.cpp) define the main functions for the leakage detection. These files implement the following functions:

Hardware::Analyze::All

Does the whole leakage detecttion.

Parameters

CommandLineParameterStruct& Parameter - The command line parameters.
Hardware::CircuitStruct& Circuit - The hardware circuit.
Hardware::LibraryStruct& Library - The circuit library.
Hardware::SettingsStruct& Settings - The evaluation settings.
Hardware::ProbesStruct& Probes - The probes.
Hardware::SimulationStruct& Simulation - The simulation settings.
Hardware::SharedDataStruct* SharedData - The shared data.
Hardware::TestStruct& Test - The evaluation details.

Return value

(none)

Hardware::Analyze::RobustProbingSecurity

Evaluates the robust probing security of the circuit.

Parameters

CommandLineParameterStruct& Parameter - The command line parameters.
Hardware::CircuitStruct& Circuit - The hardware circuit.
Hardware::LibraryStruct& Library - The circuit library.
Hardware::SettingsStruct& Settings - The evaluation settings.
Hardware::ProbesStruct& Probes - The probes.
Hardware::SimulationStruct& Simulation - The simulation settings.
Hardware::SharedDataStruct* SharedData - The shared data.
Hardware::TestStruct& Test - The evaluation details.

Return value

(none)

Hardware::Analyze::MultivariateRobustProbingSecurity

Evaluates multivariate robust probing security.

Parameters

CommandLineParameterStruct& Parameter - The command line parameters.
Hardware::CircuitStruct& Circuit - The hardware circuit.
Hardware::LibraryStruct& Library - The circuit library.
Hardware::SettingsStruct& Settings - The evaluation settings.
Hardware::ProbesStruct& Probes - The probes.
Hardware::SimulationStruct& Simulation - The simulation settings.
Hardware::SharedDataStruct* SharedData - The shared data.
Hardware::TestStruct& Test - The evaluation details.
timespec& StartTime - The starting time.

Return value

(none)

Hardware::Analyze::UnivariateRobustProbingSecurity

Evaluates univariate robust probing security.

Parameters

CommandLineParameterStruct& Parameter - The command line parameters.
Hardware::CircuitStruct& Circuit - The hardware circuit.
Hardware::LibraryStruct& Library - The circuit library.
Hardware::SettingsStruct& Settings - The evaluation settings.
Hardware::ProbesStruct& Probes - The probes.
Hardware::SimulationStruct& Simulation - The simulation settings.
Hardware::SharedDataStruct* SharedData - The shared data.
Hardware::TestStruct& Test - The evaluation details.
timespec& StartTime - The starting time.

Return value

(none)

Hardware::Analyze::RobustProbingSecurityForSomeProbingSets

Evaluates the robust probing security based on a subset of probing sets.

Parameters

CommandLineParameterStruct& Parameter - The command line parameters.
Hardware::CircuitStruct& Circuit - The hardware circuit.
Hardware::LibraryStruct& Library - The circuit library.
Hardware::SettingsStruct& Settings - The evaluation settings.
Hardware::ProbesStruct& Probes - The probes.
Hardware::SimulationStruct& Simulation - The simulation settings.
Hardware::SharedDataStruct* SharedData - The shared data.
Hardware::TestStruct& Test - The evaluation details.
timespec& StartTime - The starting time.
unsigned int ProbeStepIndex - The index of the subset of probing sets.

Return value

(none)

Test

The Test files (inc/Hardware/Test.hpp and src/Hardware/Test.cpp) define the main functions for the statistical testing procedure. These files implement the following functions:

Hardware::Test::All

Performes the statistical test procedure.

Parameters

Hardware::SettingsStruct& Settings - The evaluation settings.
Hardware::SimulationStruct& Simulation - The simulation settings.
Hardware::TestStruct& Test - The evaluation details.
char CompactDistributions - Compact/Normal Test.
unsigned int ProbeStepSize - Number of probing sets to consider.

Return value

(none)

Hardware::Test::CompactTest

Performs the test procedure in compact mode.

Parameters

Hardware::SimulationStruct& Simulation - The simulation settings.
Hardware::TestStruct& Test - The evaluation details.

Return value

(none)

Hardware::Test::CompactTableUpdate

Updates the distributions in compact mode.

Parameters

Hardware::SimulationStruct& Simulation - The simulation settings.
Hardware::TestStruct& Test - The evaluation details.
unsigned int SimulationIndex - The current simulation index.
std::vector& TempProbeValue - The temporary probe values.

Return value

(none)

Hardware::Test::NormalTest

Performs the test procedure in normal mode.

Parameters

Hardware::SettingsStruct& Settings - The evaluation settings.
Hardware::SimulationStruct& Simulation - The simulation settings.
Hardware::TestStruct& Test - The evaluation details.
unsigned int ProbeStepSize - Number of probing sets to consider.

Return value

(none)

Hardware::Test::NormalTableUpdate

Updates the distributions in normal mode.

Parameters

Hardware::SimulationStruct& Simulation - The simulation settings.
Hardware::TestStruct& Test - The evaluation details.
Hardware::ProbingSetStruct& ProbingSet - The probing set.
std::vectorHardware::TableEntryStruct& TableEntries - One contingency table entry.

Return value

(none)

Hardware::Test::SearchKey

Search for a specific value in a contingency table.

Parameters

std::vector<std::vector>& Table - The contingency table.
std::vector& Entry - The value to search.
unsigned int IgnoredEntries - The number of ignored entries.

Return value

int Position - The position of the value in the table or (-1) if the value does not exist in the table.

Hardware::Test::GTest

Computes the g-test.

Parameters

Hardware::SimulationStruct& Simulation - The simulation settings.
Hardware::ProbingSetStruct& ProbingSet - The probing set.
std::vector Frequency - Precomputed frequencies of the distribution.

Return value

(none)

Hardware::Test::GetGValue

Computes the g-value.

Parameters

Hardware::SimulationStruct& Simulation - The simulation settings.
Hardware::ProbingSetStruct& ProbingSet - The probing set.
std::vector Frequency - Precomputed frequencies of the distribution.
unsigned int TableSize - The number of entries in the table.
unsigned int& Df - The degree of freedom.

Return value

(none)

Hardware::Test::Traces

Computes the required number of traces to achieve a particular effect size.

Parameters

Hardware::SettingsStruct& Settings - The evaluation settings.
Hardware::SimulationStruct& Simulation - The simulation settings.
Hardware::ProbingSetStruct& ProbingSet - The probing set.

Return value

(none)

Print

The Print files (inc/Hardware/Print.hpp and src/Hardware/Print.cpp) define the all functions for printing results. These files implement the following functions:

Hardware::Print::Help

Prints the manual.

Parameters

(none)

Return value

(none)

Hardware::Print::CommandLineSettings

Prints the command line settings.

Parameters

CommandLineParameterStruct& Parameter - The command line parameters.

Return value

(none)

Hardware::Print::ProbeGenerationSettings

Prints initial information before the actual evaluation takes place.

Parameters

Hardware::SettingsStruct& Settings - The evaluation settings.
Hardware::SimulationStruct& Simulation - The simulation settings.
Hardware::TestStruct& Test - The evaluation details.

Return value

(none)

Hardware::Print::EvaluationSettings

Prints the header for evaluation results.

Parameters

Hardware::SimulationStruct& Simulation - The simulation settings.
Hardware::TestStruct& Test - The evaluation details.

Return value

(none)

Hardware::Print::MemoryConsumption

Prints the current memory consumption.

Parameters

(none)

Return value

(none)

Hardware::Print::EvaluationResults

Prints the results of the evaluation.

Parameters

Hardware::SettingsStruct& Settings - The evaluation settings.
Hardware::SimulationStruct& Simulation - The simulation settings.
Hardware::TestStruct& Test - The evaluation details.
double& DeletedAlpha - The maximum p-value of an already deleted probing set.
std::string& DeletedProbingSet - The deleted probing set.
double ElapsedTimePeriod - The elapsed time up to now.
unsigned int ProbeStepSize - The number of probing sets to evaluate.
unsigned int Space - The space to print the table.

Return value

(none)

Hardware::Print::Report

Prints all reports.

Parameters

Hardware::SettingsStruct& Settings - The evaluation settings.
Hardware::SimulationStruct& Simulation - The simulation settings.
Hardware::TestStruct& Test - The evaluation details.
unsigned int ProbeStepIndex - Number of the probing set block.
unsigned int ProbeStepSize - Number of considered probing sets.
unsigned int TableWidth - The width of the table.

Return value

(none)