Skip to content

Commit cd0e18a

Browse files
mkannwischerhanno-becker
authored andcommitted
Meet PQCP Project Documentation Standards
This commit adds the missing sections regarding ACVP testing and benchmarking to the README. With that addition we meet the standards set by the PQCP. Fixes #1289 Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
1 parent e9469bc commit cd0e18a

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed

BIBLIOGRAPHY.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
This file lists the citations made throughout the mlkem-native
88
source code and documentation.
99

10+
### `ACVP`
11+
12+
* Automated Cryptographic Validation Protocol (ACVP) Server
13+
* Author(s):
14+
- National Institute of Standards and Technology
15+
* URL: https://github.com/usnistgov/ACVP-Server
16+
* Referenced from:
17+
- [README.md](README.md)
18+
1019
### `AVX2_NTT`
1120

1221
* Faster AVX2 optimized NTT multiplication for Ring-LWE lattice cryptography.

BIBLIOGRAPHY.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
22

3+
- id: ACVP
4+
name: Automated Cryptographic Validation Protocol (ACVP) Server
5+
author: National Institute of Standards and Technology
6+
url: https://github.com/usnistgov/ACVP-Server
7+
38
- id: FIPS203
49
short: FIPS 203
510
name: "FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard"

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,49 @@ Our AArch64 assembly is developed using the [SLOTHY](https://github.com/slothy-o
9696
We write 'clean' assembly by hand and automate micro-optimizations (e.g. see the [clean](dev/aarch64_clean/src/ntt.S) vs [optimized](dev/aarch64_opt/src/ntt.S) AArch64 NTT).
9797
See [dev/README.md](dev/README.md) for more details.
9898

99+
## ACVP Testing
100+
101+
mlkem-native is tested against all official ACVP ML-KEM test vectors[^ACVP].
102+
103+
You can run ACVP tests using the [`tests`](./scripts/tests) script or the [ACVP client](./test/acvp_client.py) directly:
104+
105+
```bash
106+
# Using the tests script
107+
./scripts/tests acvp
108+
# Using a specific ACVP release
109+
./scripts/tests acvp --version v1.1.0.40
110+
111+
# Using the ACVP client directly
112+
python3 ./test/acvp_client.py
113+
python3 ./test/acvp_client.py --version v1.1.0.40
114+
115+
# Using specific ACVP test vector files (downloaded from the ACVP-Server)
116+
# python3 ./test/acvp_client.py -p {PROMPT}.json -e {EXPECTED_RESULT}.json
117+
# For example, assuming you have run the above
118+
python3 ./test/acvp_client.py \
119+
-p ./test/.acvp-data/v1.1.0.40/files/ML-KEM-keyGen-FIPS203/prompt.json \
120+
-e ./test/.acvp-data/v1.1.0.40/files/ML-KEM-keyGen-FIPS203/expectedResults.json
121+
```
122+
123+
## Benchmarking
124+
125+
You can measure performance, memory usage, and binary size using the [`tests`](./scripts/tests) script:
126+
127+
```bash
128+
# Speed benchmarks (-c selects cycle counter: NO, PMU, PERF, or MAC)
129+
# Note: PERF/MAC may require the -r flag to run benchmarking binaries using sudo
130+
./scripts/tests bench -c PMU
131+
./scripts/tests bench -c PERF -r
132+
133+
# Stack usage analysis
134+
./scripts/tests stack
135+
136+
# Binary size measurement
137+
./scripts/tests size
138+
```
139+
140+
For CI benchmark results and historical performance data, see the [benchmarking page](https://pq-code-package.github.io/mlkem-native/dev/bench/).
141+
99142
## Usage
100143

101144
If you want to use mlkem-native, import [mlkem](mlkem) into your project's source tree and build using your favourite build system. See [mlkem](mlkem) for more information, and
@@ -143,6 +186,7 @@ If you want to help us build mlkem-native, please reach out. You can contact the
143186
through the [PQCA Discord](https://discord.com/invite/xyVnwzfg5R). See also [CONTRIBUTING.md](CONTRIBUTING.md).
144187

145188
<!--- bibliography --->
189+
[^ACVP]: National Institute of Standards and Technology: Automated Cryptographic Validation Protocol (ACVP) Server, [https://github.com/usnistgov/ACVP-Server](https://github.com/usnistgov/ACVP-Server)
146190
[^FIPS202]: National Institute of Standards and Technology: FIPS202 SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions, [https://csrc.nist.gov/pubs/fips/202/final](https://csrc.nist.gov/pubs/fips/202/final)
147191
[^FIPS203]: National Institute of Standards and Technology: FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard, [https://csrc.nist.gov/pubs/fips/203/final](https://csrc.nist.gov/pubs/fips/203/final)
148192
[^HYBRID]: Becker, Kannwischer: Hybrid scalar/vector implementations of Keccak and SPHINCS+ on AArch64, [https://eprint.iacr.org/2022/1243](https://eprint.iacr.org/2022/1243)

0 commit comments

Comments
 (0)