Home
last modified time | relevance | path

Searched refs:drbg (Results 1 – 7 of 7) sorted by relevance

/external/boringssl/src/crypto/fipsmodule/rand/
Dctrdrbg.c30 int CTR_DRBG_init(CTR_DRBG_STATE *drbg, in CTR_DRBG_init() argument
60 drbg->ctr = aes_ctr_set_key(&drbg->ks, NULL, &drbg->block, seed_material, 32); in CTR_DRBG_init()
61 OPENSSL_memcpy(drbg->counter.bytes, seed_material + 32, 16); in CTR_DRBG_init()
62 drbg->reseed_counter = 1; in CTR_DRBG_init()
72 static void ctr32_add(CTR_DRBG_STATE *drbg, uint32_t n) { in ctr32_add() argument
73 drbg->counter.words[3] = in ctr32_add()
74 CRYPTO_bswap4(CRYPTO_bswap4(drbg->counter.words[3]) + n); in ctr32_add()
77 static int CTR_DRBG_update(CTR_DRBG_STATE *drbg, const uint8_t *data, in CTR_DRBG_update() argument
88 ctr32_add(drbg, 1); in CTR_DRBG_update()
89 drbg->block(drbg->counter.bytes, temp + i, &drbg->ks); in CTR_DRBG_update()
[all …]
Dctrdrbg_test.cc33 CTR_DRBG_STATE drbg; in TEST() local
34 ASSERT_TRUE(CTR_DRBG_init(&drbg, kSeed, nullptr, 0)); in TEST()
43 ASSERT_TRUE(CTR_DRBG_reseed(&drbg, kReseed, nullptr, 0)); in TEST()
46 ASSERT_TRUE(CTR_DRBG_generate(&drbg, out, sizeof(out), nullptr, 0)); in TEST()
47 ASSERT_TRUE(CTR_DRBG_generate(&drbg, out, sizeof(out), nullptr, 0)); in TEST()
60 CTR_DRBG_clear(&drbg); in TEST()
66 CTR_DRBG_STATE drbg; in TEST() local
67 ASSERT_TRUE(CTR_DRBG_init(&drbg, kSeed, nullptr, 0)); in TEST()
70 ASSERT_TRUE(CTR_DRBG_generate(&drbg, buf.get(), CTR_DRBG_MAX_GENERATE_LENGTH, in TEST()
83 CTR_DRBG_clear(&drbg); in TEST()
[all …]
Dinternal.h62 OPENSSL_EXPORT int CTR_DRBG_init(CTR_DRBG_STATE *drbg,
70 OPENSSL_EXPORT int CTR_DRBG_reseed(CTR_DRBG_STATE *drbg,
79 OPENSSL_EXPORT int CTR_DRBG_generate(CTR_DRBG_STATE *drbg, uint8_t *out,
85 OPENSSL_EXPORT void CTR_DRBG_clear(CTR_DRBG_STATE *drbg);
Drand.c59 CTR_DRBG_STATE drbg; member
89 CTR_DRBG_clear(&cur->drbg); in rand_thread_state_clear_all()
120 CTR_DRBG_clear(&state->drbg); in rand_thread_state_free()
279 if (!CTR_DRBG_init(&state->drbg, seed, NULL, 0)) { in RAND_bytes_with_additional_data()
313 if (!CTR_DRBG_reseed(&state->drbg, seed, NULL, 0)) { in RAND_bytes_with_additional_data()
330 if (!CTR_DRBG_generate(&state->drbg, out, todo, additional_data, in RAND_bytes_with_additional_data()
342 CTR_DRBG_clear(&state->drbg); in RAND_bytes_with_additional_data()
/external/boringssl/src/crypto/fipsmodule/
Dbcm.c645 CTR_DRBG_STATE drbg; in BORINGSSL_bcm_power_on_self_test() local
646 if (!CTR_DRBG_init(&drbg, kDRBGEntropy, kDRBGPersonalization, in BORINGSSL_bcm_power_on_self_test()
648 !CTR_DRBG_generate(&drbg, output, sizeof(kDRBGOutput), kDRBGAD, in BORINGSSL_bcm_power_on_self_test()
652 !CTR_DRBG_reseed(&drbg, kDRBGEntropy2, kDRBGAD, sizeof(kDRBGAD)) || in BORINGSSL_bcm_power_on_self_test()
653 !CTR_DRBG_generate(&drbg, output, sizeof(kDRBGReseedOutput), kDRBGAD, in BORINGSSL_bcm_power_on_self_test()
659 CTR_DRBG_clear(&drbg); in BORINGSSL_bcm_power_on_self_test()
663 if (!check_test(&kZeroDRBG, &drbg, sizeof(drbg), "DRBG Clear KAT")) { in BORINGSSL_bcm_power_on_self_test()
/external/boringssl/src/fipstools/
Dtest_fips.c236 CTR_DRBG_STATE drbg; in main() local
239 if (!CTR_DRBG_init(&drbg, kDRBGEntropy, kDRBGPersonalization, in main()
241 !CTR_DRBG_generate(&drbg, output, sizeof(output), kDRBGAD, in main()
243 !CTR_DRBG_reseed(&drbg, kDRBGEntropy2, kDRBGAD, sizeof(kDRBGAD)) || in main()
244 !CTR_DRBG_generate(&drbg, output, sizeof(output), kDRBGAD, in main()
251 CTR_DRBG_clear(&drbg); in main()
Dcavp_ctr_drbg_test.cc63 CTR_DRBG_STATE drbg; in TestCTRDRBG() local
64 CTR_DRBG_init(&drbg, entropy.data(), in TestCTRDRBG()
78 CTR_DRBG_generate(&drbg, out.data(), out.size(), in TestCTRDRBG()
80 CTR_DRBG_generate(&drbg, out.data(), out.size(), in TestCTRDRBG()