Home
last modified time | relevance | path

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

/external/rappor/client/javatest/com/google/android/rappor/
DHmacDrbgTest.java38 HmacDrbg drbg = new HmacDrbg(Bytes.concat(entropy, nonce), null); in testHmacDrbgNistCase0() local
40 drbg.nextBytes(out1); in testHmacDrbgNistCase0()
42 drbg.nextBytes(out2); in testHmacDrbgNistCase0()
57 HmacDrbg drbg = new HmacDrbg(Bytes.concat(entropy, nonce), null); in testHmacDrbgNistCase1() local
59 drbg.nextBytes(out1); in testHmacDrbgNistCase1()
61 drbg.nextBytes(out2); in testHmacDrbgNistCase1()
76 HmacDrbg drbg = new HmacDrbg(Bytes.concat(entropy, nonce), null); in testHmacDrbgNistCase2() local
78 drbg.nextBytes(out1); in testHmacDrbgNistCase2()
80 drbg.nextBytes(out2); in testHmacDrbgNistCase2()
95 HmacDrbg drbg = new HmacDrbg(Bytes.concat(entropy, nonce), null); in testHmacDrbgNistCase3() local
[all …]
/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 …]
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()
270 if (!CTR_DRBG_init(&state->drbg, seed, NULL, 0)) { in RAND_bytes_with_additional_data()
304 if (!CTR_DRBG_reseed(&state->drbg, seed, NULL, 0)) { in RAND_bytes_with_additional_data()
321 if (!CTR_DRBG_generate(&state->drbg, out, todo, additional_data, in RAND_bytes_with_additional_data()
335 CTR_DRBG_clear(&state->drbg); in RAND_bytes_with_additional_data()
Dinternal.h63 OPENSSL_EXPORT int CTR_DRBG_init(CTR_DRBG_STATE *drbg,
71 OPENSSL_EXPORT int CTR_DRBG_reseed(CTR_DRBG_STATE *drbg,
80 OPENSSL_EXPORT int CTR_DRBG_generate(CTR_DRBG_STATE *drbg, uint8_t *out,
86 OPENSSL_EXPORT void CTR_DRBG_clear(CTR_DRBG_STATE *drbg);
/external/boringssl/src/crypto/fipsmodule/self_check/
Dself_check.c555 CTR_DRBG_STATE drbg; in BORINGSSL_self_test() local
556 if (!CTR_DRBG_init(&drbg, kDRBGEntropy, kDRBGPersonalization, in BORINGSSL_self_test()
558 !CTR_DRBG_generate(&drbg, output, sizeof(kDRBGOutput), kDRBGAD, in BORINGSSL_self_test()
562 !CTR_DRBG_reseed(&drbg, kDRBGEntropy2, kDRBGAD, sizeof(kDRBGAD)) || in BORINGSSL_self_test()
563 !CTR_DRBG_generate(&drbg, output, sizeof(kDRBGReseedOutput), kDRBGAD, in BORINGSSL_self_test()
570 CTR_DRBG_clear(&drbg); in BORINGSSL_self_test()
574 if (!check_test(&kZeroDRBG, &drbg, sizeof(drbg), "DRBG Clear KAT")) { in BORINGSSL_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()
/external/rappor/client/java/com/google/android/rappor/
DEncoder.java546 HmacDrbg drbg = new HmacDrbg(userSecret, personalizationString); in computePermanentRandomizedResponse() local
547 byte[] pseudorandomStream = drbg.nextBytes(numBits); in computePermanentRandomizedResponse()