CRYSTALS

Cryptographic Suite for Algebraic Lattices

Software

Public git repository

The primary source to obtain the Dilithium software is the public GitHub repository. To download and build the software, follow the following steps:

git clone https://github.com/pq-crystals/dilithium.git
cd dilithium/ref && make
cd ../avx2 && make

In each of the subdirectories ref/ and avx2/ this will build the following binaries:

  • PQCgenKAT_sign2
  • PQCgenKAT_sign3
  • PQCgenKAT_sign5
  • PQCgenKAT_sign2aes
  • PQCgenKAT_sign3aes
  • PQCgenKAT_sign5aes
  • test/test_vectors2
  • test/test_vectors3
  • test/test_vectors5
  • test/test_vectors2aes
  • test/test_vectors3aes
  • test/test_vectors5aes
  • test/test_dilithium2
  • test/test_dilithium3
  • test/test_dilithium5
  • test/test_dilithium2aes
  • test/test_dilithium3aes
  • test/test_dilithium5aes

The substrings in {"2", "3", "5", "2aes", "3aes", "5aes"} specify the Dilithium parameter set; the functionality of the binaries is as follows:

  • PQCgenKAT_sign is the KAT generation program provided by NIST. It computes the known answer tests with deterministically generated keys and signatures and writes them to the files PQCsignKAT_$(CRYPTO_SECRETKEYBYTES).{req,rsp}. The official known answer tests are included in the KAT/ folder of the submission package.
  • test_vectors prints deterministically generated test vectors for several intermediate values occurring in the Dilithium algorithms. This binary is meant to help to ensure compatibility of different independent implementations.
  • test_dilithium tests 10000 times to generate keys, sign a random message of 59 bytes and verify the signature. It will abort with an error message and return -1 if there is an error. Otherwise it will return 0 and print the size of public key, secret key, and signature.

Third-party implementations

In the following list we collect links to third-party implementations of Dilithium. These implementations are not maintained by the CRYSTALS team; please contact the authors for any issues with those implementations.