Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ci:
repos:
# Python hooks
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.13.3
rev: v0.14.8
hooks:
- id: ruff-check
args: [--fix]
Expand All @@ -31,7 +31,7 @@ repos:

# RestructuredText hooks
- repo: https://github.com/LilSpazJoekp/docstrfmt
rev: v1.11.1
rev: v2.0.0
hooks:
- id: docstrfmt
language_version: python3
Expand Down
15 changes: 9 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ascon-verilog Documentation
===========================
#############################
ascon-verilog Documentation
#############################

.. image:: https://github.com/CharrierTim/ascon-verilog/actions/workflows/build-test.yml/badge.svg
:target: https://github.com/CharrierTim/ascon-verilog/actions/workflows/build-test.yml
Expand All @@ -11,8 +12,9 @@ ascon-verilog Documentation

Read the documentation online: https://charriertim.github.io/ascon-verilog/

Introduction
------------
**************
Introduction
**************

This project provides synthesizable implementations of the Ascon 128 algorithm in both
SystemVerilog and VHDL, using open-source tools. You can choose between two equivalent
Expand All @@ -33,8 +35,9 @@ The project is organized as follows:
This project is an improvement of a project I did during my studies at the `École des
Mines de Saint-Étienne`_.

Installation
------------
**************
Installation
**************

To get started with the project, follow the installation instructions provided in the
`Getting Started`_ guide.
Expand Down
28 changes: 16 additions & 12 deletions docs/source/files/ascon.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
Ascon Implementation
====================
######################
Ascon Implementation
######################

This page contains some details about the SystemVerilog implementation of Ascon128.

Most of the information is taken from the **Ascon-based lightweight cryptography
standards for constrained devices** report :cite:`FIPS800-232`.

Architecture
------------
**************
Architecture
**************

The main goal of this project is to provide a synthesizable implementation of the
Ascon128 algorithm for data encryption.
Expand Down Expand Up @@ -35,8 +37,9 @@ Following Figure shows the timing diagram of this implementation.
:alt: Ascon128 Timing Diagram
:target: ../_static/ascon/ascon128-timing-diagram.svg

Glossary
--------
**********
Glossary
**********

.. list-table::
:widths: 25 75
Expand Down Expand Up @@ -77,8 +80,9 @@ Glossary
The inputs to the Ascon128 algorithm are the plaintext, key, nonce and associated data.
The algorithm produces the ciphertext and tag as outputs.

Background
----------
************
Background
************

The block diagram of the Ascon128 encryption algorithm implemented in this project is
shown below.
Expand All @@ -90,7 +94,7 @@ shown below.
:target: ../_static/ascon/ascon128-encryption.svg

Permutation :math:`p^6` and :math:`p^{12}`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
==========================================

The core of Ascon128's cryptographic strength lies in its permutation functions
:math:`p^6` and :math:`p^{12}`. These functions transform the 320-bit state :math:`S`
Expand All @@ -117,7 +121,7 @@ The complete permutation can be expressed as:
\end{cases}

The Constant-Addition Layer :math:`p_C`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
=======================================

The constant addition layer :math:`p_C` is responsible for adding round-specific
constants to the state. It performs the following
Expand Down Expand Up @@ -174,7 +178,7 @@ The constant :math:`c_r` is defined as:
- 0000000000000000004b

The Substitution Layer :math:`p_S`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
==================================

The substitution layer :math:`p_S` updates the state :math:`S` with 64 parallel
applications of the 5-bit substitution box SBOX using a lookup table. The substitution
Expand Down Expand Up @@ -272,7 +276,7 @@ Note that 5-bit inputs are represented in hexadecimal, (e.g., :math:`x=1` corres
(0, 0, 0, 0, 1)).

The Linear Diffusion Layer :math:`p_L`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
======================================

The linear diffusion layer :math:`p_L` provides diffusion within each 64-bit word of the
state. It is defined as:
Expand Down
19 changes: 11 additions & 8 deletions docs/source/files/bench/addition_layer.rst
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
Bench: Addition Layer
=====================
#######################
Bench: Addition Layer
#######################

This module contains the documentation for the addition layer model and testbench.

Addition Layer Model
--------------------
**********************
Addition Layer Model
**********************

addition_layer_model.py
~~~~~~~~~~~~~~~~~~~~~~~
=======================

.. automodule:: addition_layer_model
:members:
:synopsis: Model for the addition layer.

Test Addition Layer
-------------------
*********************
Test Addition Layer
*********************

test_addition_layer.py
~~~~~~~~~~~~~~~~~~~~~~
======================

.. automodule:: test_addition_layer
:members:
Expand Down
19 changes: 11 additions & 8 deletions docs/source/files/bench/ascon.rst
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
Bench: Ascon
============
##############
Bench: Ascon
##############

This module contains the documentation for the Top level Ascon model and testbench.

Ascon Model
-----------
*************
Ascon Model
*************

ascon_model.py
~~~~~~~~~~~~~~
==============

.. automodule:: ascon_model
:members:
:synopsis: Model for the Ascon.

Test Ascon
----------
************
Test Ascon
************

test_ascon.py
~~~~~~~~~~~~~
=============

.. automodule:: test_ascon
:members:
Expand Down
5 changes: 3 additions & 2 deletions docs/source/files/bench/cocotb_utils.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Bench: cocotb_utils
===================
#####################
Bench: cocotb_utils
#####################

This module contains the documentation for the cocotb utilities. Those are functions and
classes that are used in the cocotb testbenches.
Expand Down
19 changes: 11 additions & 8 deletions docs/source/files/bench/diffusion_layer.rst
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
Bench: Diffusion Layer
======================
########################
Bench: Diffusion Layer
########################

This module contains the documentation for the diffusion layer model and testbench.

Diffusion Layer Model
---------------------
***********************
Diffusion Layer Model
***********************

diffusion_layer_model.py
~~~~~~~~~~~~~~~~~~~~~~~~
========================

.. automodule:: diffusion_layer_model
:members:
:undoc-members:
:exclude-members: _*
:synopsis: Model for the diffusion layer.

Test Diffusion Layer
--------------------
**********************
Test Diffusion Layer
**********************

test_diffusion_layer.py
~~~~~~~~~~~~~~~~~~~~~~~
=======================

.. automodule:: test_diffusion_layer
:members:
Expand Down
19 changes: 11 additions & 8 deletions docs/source/files/bench/permutation.rst
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
Bench: Permutation
==================
####################
Bench: Permutation
####################

This module contains the documentation for the Permutation model and testbench.

Permutation Model
-----------------
*******************
Permutation Model
*******************

permutation_model.py
~~~~~~~~~~~~~~~~~~~~
====================

.. automodule:: permutation_model
:members:
:synopsis: Model for the permutation.

Test Permutation
----------------
******************
Test Permutation
******************

test_permutation.py
~~~~~~~~~~~~~~~~~~~
===================

.. automodule:: test_permutation
:members:
Expand Down
23 changes: 13 additions & 10 deletions docs/source/files/bench/substitution_layer.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
Bench: Sbox and Substitution Layer
==================================
####################################
Bench: Sbox and Substitution Layer
####################################

This module contains the documentation for the Substitution Layer, S-Box and the
testbenches.

Sbox
----
******
Sbox
******

Model
~~~~~
=====

.. automodule:: sbox_model
:members:
Expand All @@ -17,18 +19,19 @@ Model
:synopsis: Model for the S-Box.

Testbench
~~~~~~~~~
=========

.. automodule:: test_sbox
:members:
:show-inheritance:
:synopsis: Test for the S-Box.

Substitution Layer
------------------
********************
Substitution Layer
********************

Model
~~~~~
=====

.. automodule:: substitution_layer_model
:members:
Expand All @@ -38,7 +41,7 @@ Model
:synopsis: Model for the substitution layer.

Testbench
~~~~~~~~~
=========

.. automodule:: test_substitution_layer
:members:
Expand Down
23 changes: 13 additions & 10 deletions docs/source/files/bench/xor_layers.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
Bench: Xor Begin and Xor End Layers
===================================
#####################################
Bench: Xor Begin and Xor End Layers
#####################################

This module contains the documentation for the Xor Begin and Xor End Layers and the
testbenches.

Xor Begin
---------
***********
Xor Begin
***********

Model
~~~~~
=====

.. automodule:: xor_begin_model
:members:
Expand All @@ -17,18 +19,19 @@ Model
:synopsis: Model for the Xor Begin Layer.

Testbench
~~~~~~~~~
=========

.. automodule:: test_xor_begin
:members:
:show-inheritance:
:synopsis: Test for the Xor Begin Layer.

Xor End
-------
*********
Xor End
*********

Model
~~~~~
=====

.. automodule:: xor_end_model
:members:
Expand All @@ -37,7 +40,7 @@ Model
:synopsis: Model for the Xor End Layer.

Testbench
~~~~~~~~~
=========

.. automodule:: test_xor_end
:members:
Expand Down
Loading
Loading