Dilithium#
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.
Supported parameters#
Dilithium has three parameter sets: these are supported and defined by Paramset
.
Test a signing function#
- crypto_condor.primitives.Dilithium.test_sign(sign, parameter_set)#
Tests a function that signs with Dilithium.
Signs messages with the given function and compares to the expected signature.
Test a verifying function#
- crypto_condor.primitives.Dilithium.test_verify(verify, parameter_set)#
Tests a function that verifies Dilithium signatures.
Run a wrapper#
Note
Available wrappers are defined by Wrapper
.
- crypto_condor.primitives.Dilithium.run_wrapper(language, parameter_set, run_sign, run_verify)#
Runs the corresponding wrapper.
- Parameters:
- Returns:
A dictionary of results, one for sign, one for verify. The keys are
sign
andverify
.- Return type:
Protocols#
- protocol crypto_condor.primitives.Dilithium.Sign#
Represents a function that signs messages with Dilithium.
The function to test must conform to
__call__()
.Classes that implement this protocol must have the following methods / attributes:
- __call__(secret_key, message)#
Signs a message with Dilithium.
- Parameters:
secret_key (bytes) – The key to use for signing.
message (bytes) – The message to sign.
- Returns:
The signed message, i.e. the concatenation of the signature and message.
- Return type:
bytes
- protocol crypto_condor.primitives.Dilithium.Verify#
Represents a function that verifies Dilithium signatures.
The function to test must conform to
__call__()
.Classes that implement this protocol must have the following methods / attributes:
- __call__(public_key, signature, message)#
Verifies a Dilithium signature.
- Parameters:
public_key (bytes) – The public part of the key used to sign the message.
signature (bytes) – The signature to verify.
message (bytes) – The message that was signed.
- Returns:
True if the signature is valid for the given key and message.
- Return type:
bool