Dilithium test vectors#
Caution
Currently, crypto-condor uses test vectors for version 3.1 of Dilithium, which is the latest release of the reference implementation. This version differs slightly from the one submitted to the third round of the NIST competition. It also differs from the draft for ML-DSA, the NIST standard. The test vectors are not compatible between versions.
As 3.1 is the latest release, we do not intend to support version 3. Regarding ML-DSA, it is currently a draft, so it is subject to change, and NIST hasn’t released test vectors for it. Once the final version is published with accompanying vectors it will integrated into crypto-condor.
Test vectors for CRYSTALS-Dilithium.
- exception crypto_condor.vectors.Dilithium.DilithiumVectorsError#
Bases:
Exception
Exception for errors when loading vectors.
- class crypto_condor.vectors.Dilithium.DilithiumVectors(parameter_set, tests)#
Bases:
object
A class to load Dilithium test vectors.
Do not instantiate directly, use
load()
instead.- Parameters:
parameter_set (Paramset) – The parameter set of the vectors.
tests (list[DilithiumNistTest]) – A list of the test vectors for the given parameter set.
Example
Using
load()
to load the test vectors:>>> from crypto_condor.vectors.Dilithium import DilithiumVectors, Paramset >>> vectors = DilithiumVectors.load(Paramset.DILITHIUM2)
- classmethod load(parameter_set)#
Loads Dilithium test vectors.
- Parameters:
parameter_set (Paramset) – The parameter set of the vectors to load.
- Returns:
An instance of
DilithiumVectors
with the corresponding test vectors.- Raises:
FileNotFoundError – If the test vectors file was not found. This should not occur, as the vectors are bundled in the package.
DilithiumVectorsError – If an error occurred while importing the file.
- enum crypto_condor.vectors.Dilithium.Paramset(value)#
Bases:
StrEnum
Available parameter sets.
- Member Type:
str
Valid values are as follows:
- DILITHIUM2 = <Paramset.DILITHIUM2: 'Dilithium2'>#
- DILITHIUM3 = <Paramset.DILITHIUM3: 'Dilithium3'>#
- DILITHIUM5 = <Paramset.DILITHIUM5: 'Dilithium5'>#
The
Enum
and its members also have the following methods:- property pk_size#
The size of the public key.
- property sk_size#
The size of the secret key.
- property sig_size#
The size of the signature.