Home
last modified time | relevance | path

Searched refs:entropy (Results 1 – 25 of 67) sorted by relevance

123

/mbedtls-latest/tests/suites/
Dtest_suite_ctr_drbg.function2 #include "mbedtls/entropy.h"
33 int entropy_len_arg, data_t *entropy,
46 test_max_idx = entropy->len;
48 /* CTR_DRBG_Instantiate(entropy[:entropy->len], nonce, perso, <ignored>)
54 mbedtls_test_entropy_func, entropy->x,
63 /* CTR_DRBG_Reseed(entropy[idx:idx+entropy->len],
79 /* CTR_DRBG_Reseed(entropy[idx:idx+entropy->len],
154 void ctr_drbg_validate_no_reseed(data_t *add_init, data_t *entropy,
161 entropy->len, entropy,
170 void ctr_drbg_validate_pr(data_t *add_init, data_t *entropy,
[all …]
Dtest_suite_hmac_drbg.function39 entropy_ctx entropy;
50 entropy.len = sizeof(buf);
51 entropy.p = buf;
66 /* Init must use entropy */
67 TEST_ASSERT(mbedtls_hmac_drbg_seed(&ctx, md_info, mbedtls_test_entropy_func, &entropy,
69 /* default_entropy_len of entropy, plus half as much for the nonce */
71 TEST_EQUAL(sizeof(buf) - entropy.len, expected_consumed_entropy);
74 * 2 * reps so the next few calls should not use entropy */
80 TEST_EQUAL(sizeof(buf) - entropy.len, expected_consumed_entropy);
91 TEST_EQUAL(sizeof(buf) - entropy.len, expected_consumed_entropy);
[all …]
Dtest_suite_random.function8 #include "mbedtls/entropy.h"
24 mbedtls_entropy_context entropy;
37 mbedtls_entropy_init(&entropy);
40 mbedtls_entropy_func, &entropy,
45 mbedtls_entropy_free(&entropy);
48 mbedtls_entropy_init(&entropy);
51 mbedtls_entropy_func, &entropy,
56 mbedtls_entropy_free(&entropy);
63 mbedtls_entropy_free(&entropy);
75 mbedtls_entropy_context entropy;
[all …]
Dtest_suite_psa_crypto_init.data28 Custom entropy sources: all standard
31 # MBEDTLS_PSA_INJECT_ENTROPY means that a source of entropy (the seed file)
33 Custom entropy sources: none
37 Fake entropy: never returns anything
40 Fake entropy: less than the block size
43 Fake entropy: not enough for a nonce
47 Fake entropy: one block eventually
51 Fake entropy: one block in two steps
55 Fake entropy: more than one block in two steps
59 Fake entropy: two blocks eventually
Dtest_suite_hmac_drbg.misc.data1 HMAC_DRBG entropy usage SHA-1
5 HMAC_DRBG entropy usage SHA-224
9 HMAC_DRBG entropy usage SHA-256
13 HMAC_DRBG entropy usage SHA-384
17 HMAC_DRBG entropy usage SHA-512
21 HMAC_DRBG entropy usage SHA3-224
25 HMAC_DRBG entropy usage SHA3-256
29 HMAC_DRBG entropy usage SHA3-384
33 HMAC_DRBG entropy usage SHA3-512
Dtest_suite_entropy.function2 #include "mbedtls/entropy.h"
20 * Dummy entropy source
47 * Ability to clear entropy sources to allow testing with just predefined
48 * entropy sources. This function or tests depending on it might break if there
49 * are internal changes to how entropy sources are registered.
353 /* If the NV seed functionality is enabled, there are two entropy
401 /* If the NV seed functionality is enabled, there are two entropy
467 #error "Unsupported entropy accumulator"
477 unsigned char entropy[MBEDTLS_ENTROPY_BLOCK_SIZE];
483 memset(entropy, 0, MBEDTLS_ENTROPY_BLOCK_SIZE);
[all …]
Dtest_suite_psa_crypto_entropy.data28 PSA validate entropy injection: good, minimum size
31 PSA validate entropy injection: good, max size
34 PSA validate entropy injection: bad, too big
37 PSA validate entropy injection: bad, too small using MBEDTLS_ENTROPY_MIN_PLATFORM
40 PSA validate entropy injection: bad, too small using MBEDTLS_ENTROPY_BLOCK_SIZE
43 PSA validate entropy injection: before and after crypto_init
Dtest_suite_psa_crypto_init.function5 /* Some tests in this module configure entropy sources. */
8 #include "mbedtls/entropy.h"
33 /* PSA crypto uses the HMAC_DRBG module. It reads from the entropy source twice:
34 * once for the initial entropy and once for a nonce. The nonce length is
35 * half the entropy length. For SHA-256, SHA-384 or SHA-512, the
36 * entropy length is 256 per the documentation of mbedtls_hmac_drbg_seed(),
41 * to read from the entropy source twice: once for the initial entropy
83 /* This is a modified version of mbedtls_entropy_init() from entropy.c
84 * which chooses entropy sources dynamically. */
168 /* Bad state due to entropy sources already being setup in
/mbedtls-latest/programs/random/
Dgen_entropy.c32 mbedtls_entropy_context entropy; in main() local
45 mbedtls_entropy_init(&entropy); in main()
48 ret = mbedtls_entropy_func(&entropy, buf, sizeof(buf)); in main()
71 mbedtls_entropy_free(&entropy); in main()
Dgen_random_ctr_drbg.c36 mbedtls_entropy_context entropy; in main() local
51 mbedtls_entropy_init(&entropy); in main()
54 &entropy, in main()
103 mbedtls_entropy_free(&entropy); in main()
/mbedtls-latest/library/
Dpsa_crypto_random_impl.h71 mbedtls_entropy_context entropy; member
113 mbedtls_entropy_context *entropy, in mbedtls_psa_drbg_seed() argument
117 return mbedtls_ctr_drbg_seed(drbg_ctx, mbedtls_entropy_func, entropy, custom, len); in mbedtls_psa_drbg_seed()
120 return mbedtls_hmac_drbg_seed(drbg_ctx, md_info, mbedtls_entropy_func, entropy, custom, len); in mbedtls_psa_drbg_seed()
/mbedtls-latest/programs/pkey/
Dpk_decrypt.c45 mbedtls_entropy_context entropy; in main() local
53 mbedtls_entropy_init(&entropy); in main()
81 &entropy, (const unsigned char *) pers, in main()
137 mbedtls_entropy_free(&entropy); in main()
Dpk_encrypt.c44 mbedtls_entropy_context entropy; in main() local
51 mbedtls_entropy_init(&entropy); in main()
77 &entropy, (const unsigned char *) pers, in main()
138 mbedtls_entropy_free(&entropy); in main()
Dpk_sign.c42 mbedtls_entropy_context entropy; in main() local
50 mbedtls_entropy_init(&entropy); in main()
76 if ((ret = mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy, in main()
139 mbedtls_entropy_free(&entropy); in main()
Drsa_encrypt.c42 mbedtls_entropy_context entropy; in main() local
65 mbedtls_entropy_init(&entropy); in main()
68 &entropy, (const unsigned char *) pers, in main()
143 mbedtls_entropy_free(&entropy); in main()
Drsa_sign_pss.c43 mbedtls_entropy_context entropy; in main() local
51 mbedtls_entropy_init(&entropy); in main()
77 if ((ret = mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy, in main()
152 mbedtls_entropy_free(&entropy); in main()
Ddh_genprime.c50 mbedtls_entropy_context entropy; in main() local
60 mbedtls_entropy_init(&entropy); in main()
95 if ((ret = mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy, in main()
156 mbedtls_entropy_free(&entropy); in main()
Decdh_curve25519.c37 mbedtls_entropy_context entropy; in main() local
61 mbedtls_entropy_init(&entropy); in main()
63 &entropy, in main()
184 mbedtls_entropy_free(&entropy); in main()
Drsa_genkey.c45 mbedtls_entropy_context entropy; in main() local
61 mbedtls_entropy_init(&entropy); in main()
62 if ((ret = mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy, in main()
136 mbedtls_entropy_free(&entropy); in main()
Decdsa.c84 mbedtls_entropy_context entropy; in main() local
116 mbedtls_entropy_init(&entropy); in main()
117 if ((ret = mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy, in main()
215 mbedtls_entropy_free(&entropy); in main()
/mbedtls-latest/programs/fuzz/
Dfuzz_dtlsclient.c39 mbedtls_entropy_context entropy; in LLVMFuzzerTestOneInput() local
60 mbedtls_entropy_init(&entropy); in LLVMFuzzerTestOneInput()
70 if (mbedtls_ctr_drbg_seed(&ctr_drbg, dummy_entropy, &entropy, in LLVMFuzzerTestOneInput()
123 mbedtls_entropy_free(&entropy); in LLVMFuzzerTestOneInput()
Dfuzz_privkey.c22 mbedtls_entropy_context entropy; in LLVMFuzzerTestOneInput() local
30 mbedtls_entropy_init(&entropy); in LLVMFuzzerTestOneInput()
40 if (mbedtls_ctr_drbg_seed(&ctr_drbg, dummy_entropy, &entropy, in LLVMFuzzerTestOneInput()
92 mbedtls_entropy_free(&entropy); in LLVMFuzzerTestOneInput()
Dfuzz_client.c43 mbedtls_entropy_context entropy; in LLVMFuzzerTestOneInput() local
77 mbedtls_entropy_init(&entropy); in LLVMFuzzerTestOneInput()
86 if (mbedtls_ctr_drbg_seed(&ctr_drbg, dummy_entropy, &entropy, in LLVMFuzzerTestOneInput()
179 mbedtls_entropy_free(&entropy); in LLVMFuzzerTestOneInput()
/mbedtls-latest/docs/proposed/
Dpsa-driver-interface.md203 …). Separately, transparent and opaque drivers can have [entropy collection entry points](#entropy-…
820 A driver can declare an entropy source by providing a `"get_entropy"` entry point. This entry point…
831 * `flags`: a bit-mask of [entropy collection flags](#entropy-collection-flags).
832entropy that is present in the `output` buffer, in bits. This must be at least `1` on success. The…
833entropy of at least `*estimate_bits` bits. When the entropy is coming from a hardware peripheral, …
834 …ta with a low density of entropy; for example a peripheral that returns eight bytes of data with a…
836entropy may be located anywhere in the buffer, so the driver may write less than `output_size` byt…
840 * `PSA_SUCCESS`: success. The output buffer contains some entropy.
841entropy is available without blocking. This is only permitted if the `PSA_DRIVER_GET_ENTROPY_BLOCK…
842 * Other error codes indicate a transient or permanent failure of the entropy source.
[all …]
/mbedtls-latest/programs/ssl/
Dmini_client.c151 mbedtls_entropy_context entropy; in main() local
166 mbedtls_entropy_init(&entropy); in main()
176 if (mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy, in main()
264 mbedtls_entropy_free(&entropy); in main()

123