Skip to content

Commit aad5f1b

Browse files
tests: Prepare to switch to SHA-256 as the default CTR_DRBG hash
Ensure that when we switch from SHA-512 to SHA-256 as the default CTR_DRBG hash, we still properly test CTR_DRBG with SHA-512. Signed-off-by: Ronald Cron <[email protected]>
1 parent 8fc000e commit aad5f1b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/scripts/components-configuration-crypto.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2353,6 +2353,18 @@ component_test_block_cipher_no_decrypt_aesce_armcc () {
23532353
not grep aesce_decrypt_block ${BUILTIN_SRC_PATH}/aesce.o
23542354
}
23552355

2356+
component_test_ctr_drbg_aes_256_sha_512 () {
2357+
msg "build: full + MBEDTLS_PSA_CRYPTO_RNG_HASH PSA_ALG_SHA_512 (ASan build)"
2358+
scripts/config.py full
2359+
scripts/config.py unset MBEDTLS_MEMORY_BUFFER_ALLOC_C
2360+
scripts/config.py set MBEDTLS_PSA_CRYPTO_RNG_HASH PSA_ALG_SHA_512
2361+
CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan .
2362+
make
2363+
2364+
msg "test: full + MBEDTLS_PSA_CRYPTO_RNG_HASH PSA_ALG_SHA_512 (ASan build)"
2365+
make test
2366+
}
2367+
23562368
component_test_ctr_drbg_aes_256_sha_256 () {
23572369
msg "build: full + MBEDTLS_PSA_CRYPTO_RNG_HASH PSA_ALG_SHA_256 (ASan build)"
23582370
scripts/config.py full
@@ -2370,6 +2382,7 @@ component_test_ctr_drbg_aes_128_sha_512 () {
23702382
scripts/config.py full
23712383
scripts/config.py unset MBEDTLS_MEMORY_BUFFER_ALLOC_C
23722384
scripts/config.py set MBEDTLS_PSA_CRYPTO_RNG_STRENGTH 128
2385+
scripts/config.py set MBEDTLS_PSA_CRYPTO_RNG_HASH PSA_ALG_SHA_512
23732386
CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan .
23742387
make
23752388

0 commit comments

Comments
 (0)