Skip to content

Commit d10c8cf

Browse files
committed
Skip ML-DSA-65 doctests when backend is not AWS-LC
Signed-off-by: Facundo Tuesca <facundo.tuesca@trailofbits.com>
1 parent fda75f8 commit d10c8cf

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

docs/conf.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@
5050
"sphinx_inline_tabs",
5151
]
5252

53+
doctest_global_setup = """
54+
from cryptography.hazmat.bindings._rust import openssl as _rust_openssl
55+
SKIP_MLDSA = not _rust_openssl.CRYPTOGRAPHY_IS_AWSLC
56+
"""
57+
5358
if spelling is not None:
5459
extensions.append("sphinxcontrib.spelling")
5560

docs/hazmat/primitives/asymmetric/mldsa.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Signing & Verification
1212
~~~~~~~~~~~~~~~~~~~~~~~
1313

1414
.. doctest::
15+
:skipif: SKIP_MLDSA
1516

1617
>>> from cryptography.hazmat.primitives.asymmetric.mldsa import MlDsa65PrivateKey
1718
>>> private_key = MlDsa65PrivateKey.generate()
@@ -27,6 +28,7 @@ The context can be up to 255 bytes and is used to differentiate signatures in
2728
different contexts or protocols.
2829

2930
.. doctest::
31+
:skipif: SKIP_MLDSA
3032

3133
>>> from cryptography.hazmat.primitives.asymmetric.mldsa import MlDsa65PrivateKey
3234
>>> private_key = MlDsa65PrivateKey.generate()
@@ -67,6 +69,7 @@ Key interfaces
6769
not supported by the backend ``cryptography`` is using.
6870

6971
.. doctest::
72+
:skipif: SKIP_MLDSA
7073

7174
>>> from cryptography.hazmat.primitives.asymmetric import mldsa
7275
>>> private_key = mldsa.MlDsa65PrivateKey.generate()
@@ -155,6 +158,7 @@ Key interfaces
155158
not supported by the backend ``cryptography`` is using.
156159

157160
.. doctest::
161+
:skipif: SKIP_MLDSA
158162

159163
>>> from cryptography.hazmat.primitives import serialization
160164
>>> from cryptography.hazmat.primitives.asymmetric import mldsa

0 commit comments

Comments
 (0)