|
| 1 | +# Changelog |
| 2 | + |
| 3 | +All notable changes to this project will be documented in this file. |
| 4 | + |
| 5 | +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |
| 6 | +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.html). |
| 7 | + |
| 8 | +### Summary |
| 9 | +This version introduces modifications to the `ref` implementation for performance analysis and benchmarking purposes. The core cryptographic logic of the original Dilithium algorithm remains unchanged. All modifications are confined to the `ref` directory and supplementary testing scripts. |
| 10 | + |
| 11 | +### Added |
| 12 | +- **Performance Benchmarking Framework:** |
| 13 | + - Introduced a `timing_info_t` struct in `ref/sign.h` to capture execution time for key generation, signing, and verification steps. |
| 14 | + - Integrated `clock_gettime` with `CLOCK_MONOTONIC` in `ref/sign.c` to precisely measure the duration of `crypto_sign_keypair`, `crypto_sign_signature`, and `crypto_sign_verify`. This required adding `#include <time.h>` and defining `_POSIX_C_SOURCE`. |
| 15 | + - Added `print_timing_info()` function to display aggregated timing results. |
| 16 | +- **Automated Testing Support:** |
| 17 | + - Added `run_test` function prototype in `ref/sign.h` to facilitate running tests multiple times for stable performance metrics. |
| 18 | +- **CPU Usage Test Script:** |
| 19 | + - Added `ref/cpu_used_test.sh`, a utility script to measure the average CPU percentage consumed by the test executable over multiple runs. |
| 20 | +- **Sample Input File:** |
| 21 | + - Added `ref/test/input.txt` to provide a consistent sample input for testing and debugging. |
| 22 | + |
| 23 | +### Changed |
| 24 | +- **Disabled Debug Outputs:** |
| 25 | + - The extensive `printf` statements previously used for tracing the algorithm's flow in `ref/sign.c` have been disabled to allow for clean performance measurement. The original version with these outputs is preserved in `sign.c.old` for reference. |
| 26 | + - The temporary debug feature in `ref/test/test_dilithium.c` that wrote detailed outputs to `output.txt` has also been disabled. The test now only reads from `input.txt`. |
| 27 | +- **Code Formatting:** |
| 28 | + - Applied consistent code formatting (e.g., spacing, newlines) across multiple files in the `ref` directory to improve readability. |
| 29 | +- **Makefile Adjustments:** |
| 30 | + - Modified `ref/Makefile` to disable the compilation of `test_vectors` targets, streamlining the build process for performance testing. |
| 31 | + |
| 32 | +### Removed |
| 33 | +- (No features removed from the core implementation) |
| 34 | + |
| 35 | +### Acknowledgements |
| 36 | +This project is a fork of the official [pq-crystals/dilithium](https://github.com/pq-crystals/dilithium) repository. The modifications, available at [quannguyen247/dilithium-dev](https://github.com/quannguyen247/dilithium-dev), are focused on performance analysis and benchmarking. The core cryptographic logic of the original public domain implementation of CRYSTALS-Dilithium remains unchanged. |
0 commit comments