Skip to content

Commit 565fa5f

Browse files
committed
Use backend method to check if ML-DSA is supported
Signed-off-by: Facundo Tuesca <facundo.tuesca@trailofbits.com>
1 parent bc2be77 commit 565fa5f

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

docs/conf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@
5151
]
5252

5353
doctest_global_setup = """
54-
from cryptography.hazmat.bindings._rust import openssl as _rust_openssl
55-
SKIP_MLDSA = not _rust_openssl.CRYPTOGRAPHY_IS_AWSLC
54+
from cryptography.hazmat.backends.openssl.backend import backend as _backend
5655
"""
5756

5857
if spelling is not None:

docs/hazmat/primitives/asymmetric/mldsa.rst

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

1414
.. doctest::
15-
:skipif: SKIP_MLDSA
15+
:skipif: not _backend.mldsa_supported()
1616

1717
>>> from cryptography.hazmat.primitives.asymmetric.mldsa import MlDsa65PrivateKey
1818
>>> private_key = MlDsa65PrivateKey.generate()
@@ -28,7 +28,7 @@ The context can be up to 255 bytes and is used to differentiate signatures in
2828
different contexts or protocols.
2929

3030
.. doctest::
31-
:skipif: SKIP_MLDSA
31+
:skipif: not _backend.mldsa_supported()
3232

3333
>>> from cryptography.hazmat.primitives.asymmetric.mldsa import MlDsa65PrivateKey
3434
>>> private_key = MlDsa65PrivateKey.generate()
@@ -69,7 +69,7 @@ Key interfaces
6969
not supported by the backend ``cryptography`` is using.
7070

7171
.. doctest::
72-
:skipif: SKIP_MLDSA
72+
:skipif: not _backend.mldsa_supported()
7373

7474
>>> from cryptography.hazmat.primitives.asymmetric import mldsa
7575
>>> private_key = mldsa.MlDsa65PrivateKey.generate()
@@ -158,7 +158,7 @@ Key interfaces
158158
not supported by the backend ``cryptography`` is using.
159159

160160
.. doctest::
161-
:skipif: SKIP_MLDSA
161+
:skipif: not _backend.mldsa_supported()
162162

163163
>>> from cryptography.hazmat.primitives import serialization
164164
>>> from cryptography.hazmat.primitives.asymmetric import mldsa

0 commit comments

Comments
 (0)