Dilithium test vectors#

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.