Simplified version of the ASCON128 encryption algorithm coded in SystemVerilog
This project focuses on the hardware implementation of the ASCON-128 algorithm, a finalist in the NIST competition for lightweight cryptographic algorithms. The ASCON-128 algorithm is designed for authenticated encryption and is particularly suitable for resource-constrained environments like the Internet of Things (IoT).
The ASCON-128 algorithm ensures both encryption and data authenticity through a series of steps:
-
Initialization: The algorithm initializes the state using a 64-bit initialization vector (IV), a 128-bit key (K), and a 128-bit nonce (N). This setup provides the initial state for subsequent operations.
-
Processing Associated Data: To guard against forgery, the algorithm processes any associated data. This step ensures that the associated data is bound to the ciphertext, preventing unauthorized modifications.
-
Encryption: The algorithm encrypts the plaintext in blocks of 64 bits. Each block undergoes multiple transformations:
- Substitution: Non-linear transformations alter the data bits.
- Permutation: Bit permutations rearrange the data bits.
- Addition: Addition operations modify the data with key and nonce.
- XOR Operations: XOR operations combine the data with previous state information.
-
Finalization: The algorithm generates a 128-bit tag that accompanies the ciphertext. This tag is used for verifying the authenticity and integrity of the encrypted data.
- /SRC/RTL: Contains the compiled files.
- /SRC/BENCH: Contains the test files.
- init_modelsim.txt: Initializes ModelSim with necessary commands.
- compil_ascon.txt: Compiles all commands in one execution.
To compile the code, use the compil_ascon.txt
file. In the SSH terminal, enter the following commands:
source init_modelsim.txt
source compil_ascon.txt