File: test_suite_random.data

package info (click to toggle)
edk2 2025.02-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 271,704 kB
  • sloc: ansic: 2,109,987; asm: 263,832; perl: 227,730; python: 149,919; sh: 34,967; cpp: 21,813; makefile: 3,282; xml: 806; pascal: 721; lisp: 35; ruby: 16; sed: 6; tcl: 4
file content (55 lines) | stat: -rw-r--r-- 1,952 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Generate random twice with CTR_DRBG
random_twice_with_ctr_drbg:

Generate random twice with HMAC_DRBG(SHA-1)
depends_on:MBEDTLS_SHA1_C
random_twice_with_hmac_drbg:MBEDTLS_MD_SHA1

Generate random twice with HMAC_DRBG(SHA-256)
depends_on:MBEDTLS_SHA256_C
random_twice_with_hmac_drbg:MBEDTLS_MD_SHA256

Generate random twice with HMAC_DRBG(SHA-512)
depends_on:MBEDTLS_SHA512_C
random_twice_with_hmac_drbg:MBEDTLS_MD_SHA512

Generate random twice with PSA classic wrapper
random_twice_with_psa_from_classic:

Generate random twice with PSA API
random_twice_with_psa_from_psa:

# This bad-usage test case currently crashes in the default configuration
# because CTR_DRBG crashes when given an unseeded context. This is arguably
# a good thing because it prevents misuse of mbedtls_psa_get_random().
#PSA classic wrapper: PSA not active
#mbedtls_psa_get_random_no_init:

PSA classic wrapper: 0 bytes
mbedtls_psa_get_random_length:0

PSA classic wrapper: 1 byte
mbedtls_psa_get_random_length:1

PSA classic wrapper: 256 bytes
mbedtls_psa_get_random_length:256

# An external RNG is supposed to handle arbitrary request lengths. Test it
# with something larger than any RNG call made by Mbed TLS itself expects.
# CTR_DRBG and HMAC_DRBG have their own maximum request lengths which may
# be lower than the value chosen here and are tested separately.
PSA classic wrapper: external RNG large
depends_on:MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG
mbedtls_psa_get_random_length:1024

PSA classic wrapper: CTR_DRBG max
depends_on:!MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG:MBEDTLS_CTR_DRBG_C
mbedtls_psa_get_random_length:MBEDTLS_CTR_DRBG_MAX_REQUEST

PSA classic wrapper: HMAC_DRBG max
depends_on:!MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG:!MBEDTLS_CTR_DRBG_C:MBEDTLS_HMAC_DRBG_C
mbedtls_psa_get_random_length:MBEDTLS_HMAC_DRBG_MAX_REQUEST

PSA classic wrapper: ECDSA signature (SECP256R1)
depends_on:MBEDTLS_ECP_DP_SECP256R1_ENABLED
mbedtls_psa_get_random_ecdsa_sign:MBEDTLS_ECP_DP_SECP256R1