Run¶
Module for the “test wrapper” command.
- enum crypto_condor.cli.run.AesStrKeyLength(value)¶
Bases:
StrEnum
Workaround for using IntEnum with Typer.
Typer/Click don’t handle ints as choices from an enum, so mimic the real enum with str values and convert back when calling the function.
- Member Type:
str
Valid values are as follows:
- ALL = <AesStrKeyLength.ALL: '0'>¶
- AES128 = <AesStrKeyLength.AES128: '128'>¶
- AES192 = <AesStrKeyLength.AES192: '192'>¶
- AES256 = <AesStrKeyLength.AES256: '256'>¶
- crypto_condor.cli.run.aes(
- wrapper,
- compliance=True,
- resilience=False,
- filename='',
- no_save=False,
- debug=None,
Runs an AES wrapper.
- Parameters:
wrapper (Annotated[Path, <typer.models.ArgumentInfo object at 0x7f6693af7ad0>]) – The wrapper to test.
- Keyword Arguments:
compliance – Whether to use compliance test vectors.
resilience – Whether to use resilience test vectors.
filename – Name of the file to save results.
no_save – Do not save results or prompt the user.
debug – When saving the results to a file, whether to add the debug data.
- crypto_condor.cli.run.ecdsa(
- language,
- curve,
- hash_function,
- key_encoding=None,
- pubkey_encoding=None,
- pre_hashed=False,
- compliance=True,
- resilience=False,
- test_sign=True,
- test_verify=True,
- test_sign_then_verify=False,
- filename='',
- no_save=False,
- debug=None,
Runs an ECDSA wrapper.
- Parameters:
language (Annotated[Wrapper, <typer.models.ArgumentInfo object at 0x7f6693ff8c10>]) – The language of the wrapper.
curve (Annotated[Curve, <typer.models.ArgumentInfo object at 0x7f6693aa6490>]) – The elliptic curve to use.
hash_function (Annotated[Hash, <typer.models.ArgumentInfo object at 0x7f66922e9590>]) – The hash function to use.
key_encoding (Annotated[KeyEncoding | None, <typer.models.OptionInfo object at 0x7f66922e9750>]) – The encoding used for private keys.
pubkey_encoding (Annotated[PubKeyEncoding | None, <typer.models.OptionInfo object at 0x7f66922e9910>]) – The encoding used for public keys.
pre_hashed (Annotated[bool, <typer.models.OptionInfo object at 0x7f66922e99d0>]) – Whether the messages given to the implementation must be hashed first.
compliance (Annotated[bool, <typer.models.OptionInfo object at 0x7f6693acfd90>]) – Whether to use compliance test vectors.
resilience (Annotated[bool, <typer.models.OptionInfo object at 0x7f6693b4d510>]) – Whether to use resilience test vectors.
test_sign (Annotated[bool, <typer.models.OptionInfo object at 0x7f6693a66b50>]) – Whether to test the signing function.
test_verify (Annotated[bool, <typer.models.OptionInfo object at 0x7f6693cd9e10>]) – Whether to test the verifying function.
test_sign_then_verify (Annotated[bool, <typer.models.OptionInfo object at 0x7f66922e9a90>]) – Whether to test both functions by signing then verifying.
filename (Annotated[str, <typer.models.OptionInfo object at 0x7f6693ac5950>]) – Name of the file to save results.
no_save (Annotated[bool, <typer.models.OptionInfo object at 0x7f6693a06c90>]) – Do not save results or prompt the user.
debug (Annotated[bool | None, <typer.models.OptionInfo object at 0x7f6693a80210>]) – When saving the results to a file, whether to add the debug data.
Notes
compliance
andresilience
should not be False at the same time unlesstest_sign_then_verify
is used.test_sign
,test_verify
, andtest_sign_then_verify
should not be False at the same time.
- crypto_condor.cli.run.sha(
- wrapper,
- compliance=True,
- resilience=False,
- filename='',
- no_save=False,
- debug=None,
Runs a SHA wrapper.
- Parameters:
wrapper (Annotated[str, <typer.models.ArgumentInfo object at 0x7f66922e9d10>]) – The wrapper to test.
- Keyword Arguments:
compliance – Whether to use compliance test vectors.
resilience – Whether to use resilience test vectors.
filename – Name of the file to save results.
no_save – Do not save results or prompt the user.
debug – When saving the results to a file, whether to add the debug data.
- crypto_condor.cli.run.shake(
- wrapper,
- filename='',
- no_save=False,
- debug=None,
- compliance=True,
- resilience=False,
Runs a SHAKE wrapper.
- Parameters:
wrapper (Annotated[Path, <typer.models.ArgumentInfo object at 0x7f66922e9e90>]) – The wrapper to test.
- Keyword Arguments:
filename – Name of the file to save results.
no_save – Do not save results or prompt the user.
debug – When saving the results to a file, whether to add the debug data.
compliance – Whether to use compliance test vectors.
resilience – Whether to use resilience test vectors.
- crypto_condor.cli.run.rsassa(
- language,
- scheme,
- sha,
- mgf_sha=None,
- sign=True,
- verify=True,
- filename='',
- no_save=False,
- debug=None,
Runs an RSA wrapper.
- Parameters:
language (Annotated[Wrapper, <typer.models.ArgumentInfo object at 0x7f6693ff8c10>]) – The language of the wrapper to run.
scheme (Annotated[Scheme, <typer.models.ArgumentInfo object at 0x7f66922e9fd0>]) – The RSA scheme to test.
sha (Annotated[Hash, <typer.models.ArgumentInfo object at 0x7f66922ea0d0>]) – The SHA to use.
mgf_sha (Annotated[Hash | None, <typer.models.OptionInfo object at 0x7f66922ea290>]) – (RSASSA-PSS only) The SHA to use with MGF1.
sign (Annotated[bool, <typer.models.OptionInfo object at 0x7f6693a66b50>]) – Whether to test the signing function.
verify (Annotated[bool, <typer.models.OptionInfo object at 0x7f6693cd9e10>]) – Whether to test the verifying function.
filename (Annotated[str, <typer.models.OptionInfo object at 0x7f6693ac5950>]) – Name of the file to save results.
no_save (Annotated[bool, <typer.models.OptionInfo object at 0x7f6693a06c90>]) – Do not save results or prompt the user.
debug (Annotated[bool | None, <typer.models.OptionInfo object at 0x7f6693a80210>]) – When saving the results to a file, whether to add the debug data.
- crypto_condor.cli.run.rsaes(
- language,
- scheme,
- sha=None,
- mgf_sha=None,
- filename='',
- no_save=False,
- debug=None,
Runs a RSAES wrapper.
- Parameters:
language (Annotated[Wrapper, <typer.models.ArgumentInfo object at 0x7f6693ff8c10>]) – The language of the wrapper to run.
scheme (Annotated[Scheme, <typer.models.ArgumentInfo object at 0x7f66922ea310>]) – The RSA scheme to test.
sha (Annotated[Hash | None, <typer.models.OptionInfo object at 0x7f66922ea5d0>]) – The SHA to use in RSAES-OAEP.
mgf_sha (Annotated[Hash | None, <typer.models.OptionInfo object at 0x7f66922ea690>]) – The SHA to use with MGF1 in RSAES-OAEP.
filename (Annotated[str, <typer.models.OptionInfo object at 0x7f6693ac5950>]) – Name of the file to save results.
no_save (Annotated[bool, <typer.models.OptionInfo object at 0x7f6693a06c90>]) – Do not save results or prompt the user.
debug (Annotated[bool | None, <typer.models.OptionInfo object at 0x7f6693a80210>]) – When saving the results to a file, whether to add the debug data.
- crypto_condor.cli.run.chacha20(
- language,
- mode,
- resilience=True,
- encrypt=True,
- decrypt=True,
- filename='',
- no_save=False,
- debug=None,
Runs an ChaCha20 wrapper.
- Parameters:
language (Annotated[Wrapper, <typer.models.ArgumentInfo object at 0x7f6693ff8c10>]) – The language of the wrapper.
mode (Annotated[Mode, <typer.models.ArgumentInfo object at 0x7f6692787150>]) – The mode of operation.
resilience (Annotated[bool, <typer.models.OptionInfo object at 0x7f6693b4d510>]) – Whether to use resilience test vectors.
encrypt (Annotated[bool, <typer.models.OptionInfo object at 0x7f6693f732d0>]) – Whether to test encryption.
decrypt (Annotated[bool, <typer.models.OptionInfo object at 0x7f6693cc9110>]) – Whether to test decryption.
filename (Annotated[str, <typer.models.OptionInfo object at 0x7f6693ac5950>]) – Name of the file to save results.
no_save (Annotated[bool, <typer.models.OptionInfo object at 0x7f6693a06c90>]) – Do not save results or prompt the user.
debug (Annotated[bool | None, <typer.models.OptionInfo object at 0x7f6693a80210>]) – When saving the results to a file, whether to add the debug data.
Notes
encrypt and decrypt should not be False at the same time.
If resilience if False, no test can be done.
- crypto_condor.cli.run.hmac(
- wrapper,
- compliance=True,
- resilience=False,
- filename='',
- no_save=False,
- debug=None,
Runs an HMAC wrapper.
- crypto_condor.cli.run.ecdh(
- wrapper,
- compliance=True,
- resilience=False,
- filename='',
- no_save=False,
- debug=None,
Runs an ECDH wrapper.
- Parameters:
lang – The language of the wrapper.
curve – The elliptic curve to use.
wrapper (Annotated[Path, <typer.models.ArgumentInfo object at 0x7f66922eabd0>]) – The name of the wrapper, ECDH_wrapper.py by default.
compliance (Annotated[bool, <typer.models.OptionInfo object at 0x7f6693acfd90>]) – Whether to use compliance test vectors.
resilience (Annotated[bool, <typer.models.OptionInfo object at 0x7f6693b4d510>]) – Whether to use resilience test vectors.
filename (Annotated[str, <typer.models.OptionInfo object at 0x7f6693ac5950>]) – Name of the file to save results.
no_save (Annotated[bool, <typer.models.OptionInfo object at 0x7f6693a06c90>]) – Do not save results or prompt the user.
debug (Annotated[bool | None, <typer.models.OptionInfo object at 0x7f6693a80210>]) – When saving the results to a file, whether to add the debug data.
- crypto_condor.cli.run.mlkem(
- wrapper,
- compliance=True,
- resilience=False,
- filename='',
- no_save=False,
- debug=None,
Runs a ML-KEM wrapper.
- Parameters:
wrapper (Annotated[Path, <typer.models.ArgumentInfo object at 0x7f66922ead10>]) – The wrapper to test.
compliance (Annotated[bool, <typer.models.OptionInfo object at 0x7f6693acfd90>]) – Whether to use compliance test vectors.
resilience (Annotated[bool, <typer.models.OptionInfo object at 0x7f6693b4d510>]) – Whether to use resilience test vectors.
filename (Annotated[str, <typer.models.OptionInfo object at 0x7f6693ac5950>]) – Name of the file to save results.
no_save (Annotated[bool, <typer.models.OptionInfo object at 0x7f6693a06c90>]) – Do not save results or prompt the user.
debug (Annotated[bool | None, <typer.models.OptionInfo object at 0x7f6693a80210>]) – When saving the results to a file, whether to add the debug data.
- crypto_condor.cli.run.mldsa(
- wrapper,
- compliance=True,
- resilience=False,
- filename='',
- no_save=False,
- debug=None,
Runs a ML-DSA wrapper.
- Parameters:
wrapper (Annotated[Path, <typer.models.ArgumentInfo object at 0x7f66922eae50>]) – The wrapper to test.
compliance (Annotated[bool, <typer.models.OptionInfo object at 0x7f6693acfd90>]) – Whether to use compliance test vectors.
resilience (Annotated[bool, <typer.models.OptionInfo object at 0x7f6693b4d510>]) – Whether to use resilience test vectors.
filename (Annotated[str, <typer.models.OptionInfo object at 0x7f6693ac5950>]) – Name of the file to save results.
no_save (Annotated[bool, <typer.models.OptionInfo object at 0x7f6693a06c90>]) – Do not save results or prompt the user.
debug (Annotated[bool | None, <typer.models.OptionInfo object at 0x7f6693a80210>]) – When saving the results to a file, whether to add the debug data.