| /src/crypto/external/apache2/openssl/dist/crypto/rand/ |
| rand_meth.c | 17 EVP_RAND_CTX *drbg = RAND_get0_primary(NULL); local 19 if (drbg == NULL || num <= 0) 22 return EVP_RAND_reseed(drbg, 0, NULL, 0, buf, num); 34 EVP_RAND_CTX *drbg = RAND_get0_primary(NULL); local 36 if (drbg == NULL) 39 return EVP_RAND_get_state(drbg) == EVP_RAND_STATE_READY ? 1 : 0; 45 EVP_RAND_CTX *drbg = RAND_get0_public(NULL); local 47 if (drbg == NULL) 50 return EVP_RAND_generate(drbg, out, count, 0, 0, NULL, 0);
|
| rand_lib.c | 34 * The three shared DRBG instances 36 * There are three shared DRBG instances: <primary>, <public>, and 46 * The <primary> DRBG 52 * The <primary> DRBG is a global instance which is accessed concurrently by 54 * DRBG instances during reseeding. 67 * The <public> DRBG 71 * The <public> secondary DRBG is thread-local, i.e., there is one instance 77 * The <private> DRBG 81 * The <private> secondary DRBG is thread-local, i.e., there is one 361 EVP_RAND_CTX *drbg; local 378 EVP_RAND_CTX *drbg; local [all...] |
| /src/crypto/external/bsd/openssl/dist/crypto/rand/ |
| rand_meth.c | 17 EVP_RAND_CTX *drbg = RAND_get0_primary(NULL); local 19 if (drbg == NULL || num <= 0) 22 return EVP_RAND_reseed(drbg, 0, NULL, 0, buf, num); 34 EVP_RAND_CTX *drbg = RAND_get0_primary(NULL); local 36 if (drbg == NULL) 39 return EVP_RAND_get_state(drbg) == EVP_RAND_STATE_READY ? 1 : 0; 45 EVP_RAND_CTX *drbg = RAND_get0_public(NULL); local 47 if (drbg == NULL) 50 return EVP_RAND_generate(drbg, out, count, 0, 0, NULL, 0);
|
| rand_lib.c | 247 EVP_RAND_CTX *drbg; local 257 drbg = RAND_get0_primary(NULL); 258 if (drbg != NULL && num > 0) 259 EVP_RAND_reseed(drbg, 0, NULL, 0, buf, num); 264 EVP_RAND_CTX *drbg; local 273 drbg = RAND_get0_primary(NULL); 274 if (drbg != NULL && num > 0) 277 EVP_RAND_reseed(drbg, 0, buf, num, NULL, 0); 280 EVP_RAND_reseed(drbg, 0, NULL, 0, buf, num); 323 * sure we're instantiated and use the private DRBG [all...] |
| /src/sys/kern/ |
| sys_getrandom.c | 62 struct nist_hash_drbg drbg; local 102 /* Instantiate the DRBG. */ 103 if (nist_hash_drbg_instantiate(&drbg, seed, sizeof seed, NULL, 0, 132 * the DRBG reseed interval, reseed. 134 if (nist_hash_drbg_generate(&drbg, buf, n, NULL, 0)) { 150 if (nist_hash_drbg_reseed(&drbg, seed, sizeof seed, 158 if (nist_hash_drbg_generate(&drbg, buf, n, NULL, 0))
|
| /src/crypto/external/bsd/openssl.old/dist/test/ |
| drbg_cavs_test.c | 34 static size_t kat_entropy(RAND_DRBG *drbg, unsigned char **pout, 38 TEST_CTX *t = (TEST_CTX *)RAND_DRBG_get_ex_data(drbg, app_data_index); 45 static size_t kat_nonce(RAND_DRBG *drbg, unsigned char **pout, 48 TEST_CTX *t = (TEST_CTX *)RAND_DRBG_get_ex_data(drbg, app_data_index); 68 RAND_DRBG *drbg = NULL; local 77 if (!TEST_ptr(drbg = RAND_DRBG_new(td->nid, flags, NULL))) 80 if (!TEST_true(RAND_DRBG_set_callbacks(drbg, kat_entropy, NULL, 90 RAND_DRBG_set_ex_data(drbg, app_data_index, &t); 96 if (!TEST_true(RAND_DRBG_instantiate(drbg, data->persstr, td->persstrlen)) 97 || !TEST_true(RAND_DRBG_generate(drbg, buff, td->retbyteslen, 0 127 RAND_DRBG *drbg = NULL; local 191 RAND_DRBG *drbg = NULL; local [all...] |
| drbgtest.c | 132 static size_t kat_entropy(RAND_DRBG *drbg, unsigned char **pout, 136 TEST_CTX *t = (TEST_CTX *)RAND_DRBG_get_ex_data(drbg, app_data_index); 143 static size_t kat_nonce(RAND_DRBG *drbg, unsigned char **pout, 146 TEST_CTX *t = (TEST_CTX *)RAND_DRBG_get_ex_data(drbg, app_data_index); 153 static int uninstantiate(RAND_DRBG *drbg) 155 int ret = drbg == NULL ? 1 : RAND_DRBG_uninstantiate(drbg); 166 RAND_DRBG *drbg = NULL; local 172 * Test without PR: Instantiate DRBG with test entropy, nonce and 175 if (!TEST_ptr(drbg = RAND_DRBG_new(td->nid, td->flags, NULL)) 289 RAND_DRBG *drbg = NULL; local 497 RAND_DRBG *drbg; member in struct:hook_ctx_st [all...] |
| /src/crypto/external/apache2/openssl/dist/providers/implementations/kdfs/ |
| hmacdrbg_kdf.c | 59 PROV_DRBG_HMAC *drbg = &ctx->base; local 62 EVP_MAC_CTX_free(drbg->ctx); 63 ossl_prov_digest_reset(&drbg->digest); 121 PROV_DRBG_HMAC *drbg = &ctx->base; local 131 || !ossl_drbg_hmac_init(drbg, ctx->entropy, ctx->entropylen, 137 return ossl_drbg_hmac_generate(drbg, out, outlen, NULL, 0); 143 PROV_DRBG_HMAC *drbg = &hmac->base; local 150 if (drbg->ctx == NULL) 152 name = EVP_MAC_get0_name(EVP_MAC_CTX_get0_mac(drbg->ctx)); 159 md = ossl_prov_digest_md(&drbg->digest) 181 PROV_DRBG_HMAC *drbg = &hmac->base; local [all...] |
| /src/crypto/external/bsd/openssl/dist/providers/implementations/rands/ |
| drbg_hmac.c | 84 * Updates the drbg objects Key(K) and Value(V) using the following algorithm: 94 static int drbg_hmac_update(PROV_DRBG *drbg, 99 PROV_DRBG_HMAC *hmac = (PROV_DRBG_HMAC *)drbg->data; 114 * This sets the drbg Key (K) to all zeros, and Value (V) to all 1's. 122 static int drbg_hmac_instantiate(PROV_DRBG *drbg, 127 PROV_DRBG_HMAC *hmac = (PROV_DRBG_HMAC *)drbg->data; 139 return drbg_hmac_update(drbg, ent, ent_len, nonce, nonce_len, pstr, 149 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 151 if (!ossl_prov_is_running() || !drbg_hmac_set_ctx_params(drbg, params)) 153 return ossl_prov_drbg_instantiate(drbg, strength, prediction_resistance 179 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 244 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 266 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 307 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 320 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local [all...] |
| drbg.c | 26 * Support framework for NIST SP 800-90A DRBG 34 * DRBG, where allocation of resources on something like an HSM is 38 /* NIST SP 800-90A DRBG recommends the use of a personalization string. */ 44 static int rand_drbg_restart(PROV_DRBG *drbg); 48 PROV_DRBG *drbg = vctx; local 50 if (drbg == NULL || drbg->lock == NULL) 52 return CRYPTO_THREAD_write_lock(drbg->lock); 57 PROV_DRBG *drbg = vctx; local 59 if (drbg != NULL && drbg->lock != NULL 149 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 327 void *drbg; member in struct:__anon1611 745 PROV_DRBG *drbg = vctx; local 784 PROV_DRBG *drbg; local [all...] |
| drbg_hash.c | 67 static int hash_df(PROV_DRBG *drbg, unsigned char *out, 73 PROV_DRBG_HASH *hash = (PROV_DRBG_HASH *)drbg->data; 79 size_t outlen = drbg->seedlen; 131 static int hash_df1(PROV_DRBG *drbg, unsigned char *out, 135 return hash_df(drbg, out, in_byte, in1, in1len, NULL, 0, NULL, 0); 142 * where dst size is drbg->seedlen, and inlen <= drbg->seedlen. 144 static int add_bytes(PROV_DRBG *drbg, unsigned char *dst, 152 assert(drbg->seedlen >= 1 && inlen >= 1 && inlen <= drbg->seedlen) 272 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 308 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 356 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 379 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 421 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 434 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local [all...] |
| drbg_ctr.c | 37 * The state of a DRBG AES-CTR. 56 * Implementation of NIST SP 800-90A CTR DRBG. 259 __owur static int ctr_update(PROV_DRBG *drbg, 264 PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data; 293 ctr_XOR(ctr, ctr->KX, drbg->seedlen); 305 static int drbg_ctr_instantiate(PROV_DRBG *drbg, 310 PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data; 321 if (!ctr_update(drbg, entropy, entropylen, pers, perslen, nonce, noncelen)) 332 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 334 if (!ossl_prov_is_running() || !drbg_ctr_set_ctx_params(drbg, params) 359 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 456 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 481 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 613 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 630 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local [all...] |
| /src/sys/crypto/nist_hash_drbg/ |
| nist_hash_drbg.c | 1077 struct nist_hash_drbg drbg, *D = &drbg; 1059 struct nist_hash_drbg drbg, *D = &drbg; local
|
| /src/crypto/external/apache2/openssl/dist/crypto/ |
| context.c | 32 void *drbg; member in struct:ossl_lib_ctx_st 121 ctx->drbg = ossl_rand_ctx_new(ctx); 122 if (ctx->drbg == NULL) 243 if (ctx->drbg != NULL) { 244 ossl_rand_ctx_free(ctx->drbg); 245 ctx->drbg = NULL; 532 /* early release of the DRBG in global default libctx */ 533 if (default_context_int.drbg != NULL) { 534 ossl_rand_ctx_free(default_context_int.drbg); 535 default_context_int.drbg = NULL [all...] |
| /src/crypto/external/apache2/openssl/dist/providers/implementations/rands/ |
| drbg_hash.c | 72 static int hash_df(PROV_DRBG *drbg, unsigned char *out, 78 PROV_DRBG_HASH *hash = (PROV_DRBG_HASH *)drbg->data; 84 size_t outlen = drbg->seedlen; 136 static int hash_df1(PROV_DRBG *drbg, unsigned char *out, 140 return hash_df(drbg, out, in_byte, in1, in1len, NULL, 0, NULL, 0); 147 * where dst size is drbg->seedlen, and inlen <= drbg->seedlen. 149 static int add_bytes(PROV_DRBG *drbg, unsigned char *dst, 157 assert(drbg->seedlen >= 1 && inlen >= 1 && inlen <= drbg->seedlen) 277 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 322 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 369 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 387 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 403 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 454 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 467 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 605 PROV_DRBG *drbg = (PROV_DRBG *)vctx; local [all...] |
| drbg_hmac.c | 81 * Updates the drbg objects Key(K) and Value(V) using the following algorithm: 109 * This sets the drbg Key (K) to all zeros, and Value (V) to all 1's. 135 static int drbg_hmac_instantiate(PROV_DRBG *drbg, 140 return ossl_drbg_hmac_init((PROV_DRBG_HMAC *)drbg->data, ent, ent_len, 150 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 153 if (drbg->lock != NULL && !CRYPTO_THREAD_write_lock(drbg->lock)) 157 || !drbg_hmac_set_ctx_params_locked(drbg, params)) 159 ret = ossl_prov_drbg_instantiate(drbg, strength, prediction_resistance, 162 if (drbg->lock != NULL 191 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 263 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 280 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 296 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 346 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 359 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 545 PROV_DRBG *drbg = (PROV_DRBG *)vctx; local [all...] |
| drbg.c | 27 * Support framework for NIST SP 800-90A DRBG 35 * DRBG, where allocation of resources on something like an HSM is 39 /* NIST SP 800-90A DRBG recommends the use of a personalization string. */ 45 static int rand_drbg_restart(PROV_DRBG *drbg); 51 * of whether drbg->lock is present or not. 63 static int ossl_drbg_lock_parent(PROV_DRBG *drbg) 65 void *parent = drbg->parent; 68 && drbg->parent_lock != NULL 69 && !drbg->parent_lock(parent)) { 76 static void ossl_drbg_unlock_parent(PROV_DRBG *drbg) 149 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 309 void *drbg; member in struct:__anon570 755 PROV_DRBG *drbg = vctx; local 793 PROV_DRBG *drbg; local [all...] |
| drbg_ctr.c | 43 * The state of a DRBG AES-CTR. 62 * Implementation of NIST SP 800-90A CTR DRBG. 266 __owur static int ctr_update(PROV_DRBG *drbg, 271 PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data; 300 ctr_XOR(ctr, ctr->KX, drbg->seedlen); 312 static int drbg_ctr_instantiate(PROV_DRBG *drbg, 317 PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data; 328 if (!ctr_update(drbg, entropy, entropylen, pers, perslen, nonce, noncelen)) 339 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 342 if (drbg->lock != NULL && !CRYPTO_THREAD_write_lock(drbg->lock) 375 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 471 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 491 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 507 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 647 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 664 PROV_DRBG *drbg = (PROV_DRBG *)vdrbg; local 808 PROV_DRBG *drbg = (PROV_DRBG *)vctx; local [all...] |
| /src/crypto/external/bsd/openssl/dist/providers/fips/ |
| self_test_kats.c | 256 EVP_RAND_CTX *test = NULL, *drbg = NULL; local 283 drbg = EVP_RAND_CTX_new(rand, test); 285 if (drbg == NULL) 288 strength = EVP_RAND_get_strength(drbg); 292 /* This is only used by HMAC-DRBG but it is ignored by the others */ 295 if (!EVP_RAND_CTX_set_params(drbg, drbg_params)) 307 if (!EVP_RAND_instantiate(drbg, strength, 0, t->persstr, t->persstrlen, 318 if (!EVP_RAND_generate(drbg, out, t->expectedlen, strength, 334 if (!EVP_RAND_generate(drbg, out, t->expectedlen, strength, 344 if (!EVP_RAND_uninstantiate(drbg)) [all...] |
| /src/crypto/external/bsd/openssl.old/dist/crypto/rand/ |
| drbg_lib.c | 20 * Support framework for NIST SP 800-90A DRBG 28 * DRBG, where allocation of resources on something like an HSM is 33 * The three shared DRBG instances 35 * There are three shared DRBG instances: <master>, <public>, and <private>. 39 * The <master> DRBG 45 * The <master> DRBG is a global instance which is accessed concurrently by 47 * DRBG instances during reseeding. 51 * The <public> DRBG 55 * The <public> DRBG is thread-local, i.e., there is one instance per thread. 59 * The <private> DRBG 191 RAND_DRBG *drbg = secure ? OPENSSL_secure_zalloc(sizeof(*drbg)) local 861 RAND_DRBG *drbg; local 937 RAND_DRBG *drbg; local 952 RAND_DRBG *drbg = RAND_DRBG_get0_public(); local 1002 RAND_DRBG *drbg = RAND_DRBG_get0_master(); local 1070 RAND_DRBG *drbg = RAND_DRBG_get0_master(); local 1100 RAND_DRBG *drbg; local 1121 RAND_DRBG *drbg; local [all...] |
| rand_lib.c | 120 * If the DRBG has a parent, then the required amount of entropy input 126 * If a random pool has been added to the DRBG using RAND_add(), then 129 size_t rand_drbg_get_entropy(RAND_DRBG *drbg, 138 if (drbg->parent != NULL && drbg->strength > drbg->parent->strength) { 141 * 10.1.2 to use a weaker DRBG as source 147 if (drbg->seed_pool != NULL) { 148 pool = drbg->seed_pool; 151 pool = rand_pool_new(entropy, drbg->secure, min_len, max_len) 396 RAND_DRBG *drbg = RAND_DRBG_get0_master(); local 928 RAND_DRBG *drbg; local [all...] |
| /src/crypto/external/apache2/openssl/dist/providers/fips/ |
| self_test_kats.c | 297 EVP_RAND_CTX *test = NULL, *drbg = NULL; local 324 drbg = EVP_RAND_CTX_new(rand, test); 326 if (drbg == NULL) 329 strength = EVP_RAND_get_strength(drbg); 333 /* This is only used by HMAC-DRBG but it is ignored by the others */ 335 if (!EVP_RAND_CTX_set_params(drbg, drbg_params)) 345 if (!EVP_RAND_instantiate(drbg, strength, 0, t->persstr, t->persstrlen, 355 if (!EVP_RAND_generate(drbg, out, t->expectedlen, strength, 370 if (!EVP_RAND_generate(drbg, out, t->expectedlen, strength, 380 if (!EVP_RAND_uninstantiate(drbg)) [all...] |
| /src/crypto/external/apache2/openssl/dist/test/ |
| drbgtest.c | 40 * DRBG generate wrappers 42 static int gen_bytes(EVP_RAND_CTX *drbg, unsigned char *buf, int num) 54 if (drbg != NULL) 55 return EVP_RAND_generate(drbg, buf, num, 0, 0, NULL, 0); 73 * DRBG query functions 75 static int state(EVP_RAND_CTX *drbg) 77 return EVP_RAND_get_state(drbg); 80 static unsigned int query_rand_uint(EVP_RAND_CTX *drbg, const char *name) 86 if (EVP_RAND_CTX_get_params(drbg, params)) 92 static unsigned int name(EVP_RAND_CTX *drbg) \ 782 EVP_RAND_CTX *drbg = NULL; local [all...] |
| /src/crypto/external/bsd/openssl/dist/test/ |
| drbgtest.c | 46 * DRBG generate wrappers 48 static int gen_bytes(EVP_RAND_CTX *drbg, unsigned char *buf, int num) 60 if (drbg != NULL) 61 return EVP_RAND_generate(drbg, buf, num, 0, 0, NULL, 0); 80 * DRBG query functions 82 static int state(EVP_RAND_CTX *drbg) 84 return EVP_RAND_get_state(drbg); 87 static unsigned int query_rand_uint(EVP_RAND_CTX *drbg, const char *name) 93 if (EVP_RAND_CTX_get_params(drbg, params)) 99 static unsigned int name(EVP_RAND_CTX *drbg) \ 792 EVP_RAND_CTX *drbg = NULL; local [all...] |
| /src/sys/arch/x86/x86/ |
| pmap.c | 1659 struct nist_hash_drbg drbg; local 1666 error = nist_hash_drbg_instantiate(&drbg, seed, sizeof(seed), 1671 error = nist_hash_drbg_generate(&drbg, randholep, sizeof(*randholep), 1675 error = nist_hash_drbg_generate(&drbg, randvap, sizeof(*randvap), 1680 explicit_memset(&drbg, 0, sizeof(drbg));
|