This repository describes two frameworks which can be used for pre-Silicon power side-channel analysis of digital circuit designs (i.e., at the RTL or gate-level netlist stage): PLAN (Power attack Leakage ANalyzer) and FORTIFY.
- Muhammad Arsath K. F, Vinod Ganesan, Rahul Bodduna, Chester Rebeiro: PARAM: A Microprocessor Hardened for Power Side-Channel Attack Resistance. HOST 2020: 23-34
- A V Lakshmy, Chester Rebeiro, and Swarup Bhunia: FORTIFY: Analytical Pre-Silicon Side-Channel Characterization of Digital Designs. ASP-DAC 2022
-
Download and install Anaconda. Please refer to https://docs.anaconda.com/anaconda/install/linux/ (steps 1 – 10 under the section Installation).
-
Check that the following line has been added to
~/.bashrc
file:export PATH="/home/<user_name>/anaconda3/bin:$PATH"
(If not added, please add it manually, save and close the file. Restart the terminal for the changes to take effect.)
-
Check whether
conda
is properly installed by running:conda --version
conda update conda
-
Clone this repo on your local system:
git clone https://github.com/avlakshmy/power-side-channel-analysis.git
-
Create the environment (named
psca
) using theenvironment.yml
file in the root of the repo, by running the following command:conda env create -f environment.yml
This installs the Python modules required for the tools to run (
tqdm
,pyverilog
,z3-solver
,numpy
,scipy
,Verilog_VCD
,pandas
,matplotlib
). -
Activate the environment by running the command:
source activate psca
The above steps need to be performed once initially. However, the last step has to be run, i.e., the environment must be activated each time before running any of the tools.
Please refer to the plan/PLAN.md
and fortify/FORTIFY.md
files for a more detailed description of PLAN and FORTIFY, as well as instructions to run the scripts for both tools for different sample designs.
fortify/
: Code and results for FORTIFYstd_cell_lib/
: Verilog standard gate and module definitionsstd_gates.v
: Verilog standard gate definitions (required for parsing by FORTIFY)std_mods.v
: Verilog standard module definitions from Synopsys Design Compiler (SDC)
compare_fortify_with_plan.py
: Script that compares the results of FORTIFY with those of PLANFORTIFY.md
: Documentation about FORTIFYgenerate_z3.py
: Python script containing functions for generating logical expressions corresponding to each signal in the designgraph.py
: Python script defining a graph classmodule_maps.py
: Python script containing functions to convert the input design into a directed graph representation and extract the sub-circuit influenced by the reference signalrun_fortify.py
: Main script to run FORTIFYsig_prob.py
: Python script containing functions to recursively calculate the signal probability and conditional signal probabilities of a signal in the designutils.py
: Python script containing utility functions used during Verilog parsing
plan/
: Code files for PLANc17_simulate.sh
: Bash script to perform behavioral simulations of the Verilog file (../verilog_files/c17.v
)c432_simulate.sh
: Bash script to perform behavioral simulations of the Verilog file (../verilog_files/c432.v
)clean.sh
: Bash script to clean up temporary files generated during previous simulationsfa2_simulate.sh
: Bash script to perform behavioral simulations of the Verilog file (../verilog_files/fa2.v
)fa4_simulate.sh
: Bash script to perform behavioral simulations of the Verilog file (../verilog_files/fa4.v
)fa8_simulate.sh
: Bash script to perform behavioral simulations of the Verilog file (../verilog_files/fa8.v
)PLAN.md
: Documentation about PLANpresent_dec_1_simulate.sh
: Bash script to perform behavioral simulations of the Verilog file (../verilog_files/present_dec_1.v
)present_dec_2_simulate.sh
: Bash script to perform behavioral simulations of the Verilog file (../verilog_files/present_dec_2.v
)present_enc_1_simulate.sh
: Bash script to perform behavioral simulations of the Verilog file (../verilog_files/present_enc_1.v
)present_enc_2_simulate.sh
: Bash script to perform behavioral simulations of the Verilog file (../verilog_files/present_enc_2.v
)run_plan.py
: Main script to run PLAN
verilog_files/
: Directory to store Verilog files corresponding to designs to be analyzed using the toolsc17.v
: Verilog file corresponding to c17 ISCAS-85 benchmark combinational designc432.v
: Verilog file corresponding to c432 ISCAS-85 benchmark combinational designfa2.v
: Verilog file corresponding to 2-bit full adder designfa4.v
: Verilog file corresponding to 4-bit full adder designfa8.v
: Verilog file corresponding to 8-bit full adder designp2psoc.v
: Verilog file corresponding to P2P-SoC designpresent_dec_1.v
: Verilog file corresponding to PRESENT decryption (1 round) designpresent_dec_2.v
: Verilog file corresponding to PRESENT decryption (2 rounds) designpresent_enc_1.v
: Verilog file corresponding to PRESENT encryption (1 round) designpresent_enc_2.v
: Verilog file corresponding to PRESENT encryption (2 rounds) design
environment.yml
: Conda environment fileLICENSE.iitm
: License for the toolsREADME.md
: High-level overview of the tools
For any queries regarding the tools, please reach out to me (avlakshmy@gmail.com).