Skip to content

Commit

Permalink
Handle the SHA3 macros as mutually exclusive
Browse files Browse the repository at this point in the history
Signed-off-by: Gabor Mezei <[email protected]>
  • Loading branch information
gabor-mezei-arm committed Jan 13, 2025
1 parent 82c774d commit baa11a9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/scripts/depends.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,10 @@ def test(self, options):
'PSA_WANT_ALG_SHA_512': ['MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT',
'MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY',
'MBEDTLS_SHA512_C'],
# 'PSA_WANT_ALG_SHA3_224': ['MBEDTLS_SHA3_C'],
# 'PSA_WANT_ALG_SHA3_256': ['MBEDTLS_SHA3_C'],
# 'PSA_WANT_ALG_SHA3_384': ['MBEDTLS_SHA3_C'],
# 'PSA_WANT_ALG_SHA3_512': ['MBEDTLS_SHA3_C'],
'PSA_WANT_ALG_SHA3_224': ['MBEDTLS_SHA3_C'],
'PSA_WANT_ALG_SHA3_256': ['MBEDTLS_SHA3_C'],
'PSA_WANT_ALG_SHA3_384': ['MBEDTLS_SHA3_C'],
'PSA_WANT_ALG_SHA3_512': ['MBEDTLS_SHA3_C'],
}

# If an option is tested in an exclusive test, alter the following defines.
Expand Down Expand Up @@ -630,8 +630,11 @@ def __init__(self, options, conf):
# across various modules, but it depends on either SHA256 or SHA512.
# As a consequence an "exclusive" test of anything other than SHA256
# or SHA512 with MBEDTLS_ENTROPY_C enabled is not possible.
# Note for update: when MBEDTLS_SHA3_C is removed the mutual_exclusion
# argument must be removed.
'hashes': DualDomain(hash_symbols, build_and_test,
exclude=r'PSA_WANT_ALG_(?!SHA_(256|512))',
mutual_exclusion=[r'PSA_WANT_ALG_SHA3_']),

# Key exchange types.
'kex': ExclusiveDomain(key_exchange_symbols, build_and_test),
Expand Down

0 comments on commit baa11a9

Please sign in to comment.