Skip to content

This repository contains the developed and tested Keccak codes, both with and without countermeasures against side-channel attacks, as well as the libraries, scripts, and notebooks needed to perform first-, second-, and third-order TVLA.

Notifications You must be signed in to change notification settings

HWSec-CSIC/KECCAK_ASM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

KECCAK_ASM

FILES

  • firmware/mcu: Contains all the files relative to STM32 target execution.

    • /hal: Libraries and drivers for correct firmware execution. It has been modified from the version provided by ChipWhisperer, in order to enable interruptions, timers, etc.
    • /keccak_unmasked_NoOpt_ASSEMBLY: Unmasked Keccak source codes.
      • Keccak1600NoOpt.s: ASM unmasked Keccak permutation (ARM Cortex-M4)
      • KeccakFW.c: High-level framework
    • /keccak_masked_TIFirstOrder3shares_NoOpt_ASSEMBLY/no-remasking: Masked Keccak source codes (1st order Threshold Implementation - 3 shares).
      • Keccak1600NoOpt.s: ASM masked Keccak permutation (ARM Cortex-M4)
      • KeccakFW.c: High-level framework
  • jupyter/KECCAK_Notebooks: Contains the notebooks for using ChipWhisperer, capturing traces, and performing TVLA.

    • CW_Capture.ipynb: ChipWhisperer client for capturing and storing traces
    • TVLA.ipynb: Processes the traces stored with CW_Capture.ipynb for applying TVLA.

INSTALLATION

  1. Install ChipWhisperer 6.0.0 from https://chipwhisperer.readthedocs.io/en/latest/installation.html
  2. Copy firmware/mcu/ and jupyter/KECCAK_Notebooks/ and paste them into chipwhisperer/ folder. Replace all files.

HOW TO USE

CAPTURING TRACES

  1. Open the notebook jupyter/KECCAK_Notebooks/CW_Capture.ipynb
  2. Define your parameters in the first cell.
    • base_dir_traces: Path where will be created the experiment subfolder (defined by exp_name)
    • exp_name: Name of the subfolder that will be created inside the path base_dir_traces, and where will be stored all the traces collected for this experiment
    • lista_masking: List of implementations that will be executed. For example, if you want to execute two or more implementations sequentially.
    • lista_remasking: List of labels, associated to lista_remasking, that indicates if in the corresponding implementation you want to execute that with/without mask refreshing.
    • it_ini: ID number of the first set of 10 traces. For organizing traces.
    • it_fin: ID number of the last set of 10 traces. For organizing traces. Along with it_ini, it also defines the number of traces that is going to be captured.
    • n_iterations_complete_trace: Number of captures with 24000 samples in the same trace (applying the corresponding offset for starting the new capture just after the end of the previous one.

PERFORMING TVLA

  1. Open the notebook jupyter/KECCAK_Notebooks/TVLA.ipynb
  2. Define your parameters in the first cell.
    • ruta_base: Path of the experiment subfolder where all the traces of that experiment are stored (must be base_dir_traces + exp_name, using as reference the codes in CW_Capture.ipynb)
    • num_it : Number of captures with 24000 samples in the same trace (must have the same value that n_iterations_complete_trace, using as reference the codes in CW_Capture.ipynb)

About

This repository contains the developed and tested Keccak codes, both with and without countermeasures against side-channel attacks, as well as the libraries, scripts, and notebooks needed to perform first-, second-, and third-order TVLA.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages