Welcome to the Hybrid Cache Implementation Repository! This repository contains the implementation of Kyber and Dilithium cryptographic algorithms, as well as AES, Keccak, and NTT-related kernels manually compiled to the instructions for Hybrid Cache. Please follow the instructions and guidelines mentioned below to ensure a smooth review process.
- Repository Structure
- Setup and Installation
- Running the Program
- License
- Acknowledgements
The repository is organized as follows:
algorithms/
: Contains the Kyber and Dilithium cryptographic algorithm implementationskyber/
: Contains the Kyber algorithm implementationdilithium/
: Contains the Dilithium algorithm implementation
kernels/
: Contains the kernel implementations for AES, Keccak, and NTT-related operationsAES/
: Contains the AES kernel implementations with different configurationskeccak/
: Contains the Keccak kernel implementationsNTT/
: Contains the NTT-related kernel implementations, such as Montgomery multiplication and NTT
Before running the program, ensure that you have the following prerequisites installed on your system:
- A C compiler
- A C++ compiler
- CMake (version 3.10 or later)
To run the project, follow these steps:
- Clone the repository to your local machine:
git clone https://github.com/Ssicayoon/hybrid-cache.git
After cloning the repository, follow these steps to run the program:
- Navigate to the root directory of the repository:
cd hybrid-cache
-
Navigate to the folder you want to run. Algorithms and kernels have two different flow of execution.
- To run the algorithms (e.g., Kyber, Dilithium), navigate to the
algorithms/kyber/ref
oralgorithms/dilithium/ref
folder:
# For other configurations, replace "kyber512" with "kyber768" or "kyber1024" cd algorithms/kyber/ref make test_kyber512 ./test_kyber512 # For other configurations, replace "dilithium2" with "dilithium3" or "dilithium5" or "dilithium2aes" or "dilithium3aes" or "dilithium5aes" cd algorithms/dilithium/ref make test/test_dilithium2 ./test/test_dilithium2
- The terminal shows the number of instructions and cycles with instructions stored in
output.txt
.
- To run the kernels (e.g., AES), navigate to the
kernels/AES
folder:
cd kernels/AES/AES128_ECB cc aes.c aes_test.c -o aes ./aes
- The terminal shows the number of instructions and cycles with instructions stored in
output.txt
.
- To run the algorithms (e.g., Kyber, Dilithium), navigate to the
-
Sample outputs of Kyber and Dilithium can be found in
algorithms/kyber/outputs
andalgorithms/dilithium/outputs
, respectively. We provide the sample instruction output of Kyber512 inalgorithms/kyber/outputs/test_kyber512_instructions.txt
. The sample outputs of kernels can be found in their respective folders.
This repository is licensed under the Apache License 2.0. Please see the LICENSE file for more details.
This repository is based on the following repositories: