Home
last modified time | relevance | path

Searched refs:prng (Results 1 – 25 of 53) sorted by relevance

123

/external/dropbear/libtomcrypt/src/prngs/
Dyarrow.c38 int yarrow_start(prng_state *prng) in yarrow_start() argument
42 LTC_ARGCHK(prng != NULL); in yarrow_start()
47 prng->yarrow.cipher = register_cipher(&rijndael_enc_desc); in yarrow_start()
49 prng->yarrow.cipher = register_cipher(&aes_enc_desc); in yarrow_start()
51 prng->yarrow.cipher = register_cipher(&rijndael_desc); in yarrow_start()
53 prng->yarrow.cipher = register_cipher(&aes_desc); in yarrow_start()
56 prng->yarrow.cipher = register_cipher(&blowfish_desc); in yarrow_start()
58 prng->yarrow.cipher = register_cipher(&twofish_desc); in yarrow_start()
60 prng->yarrow.cipher = register_cipher(&rc6_desc); in yarrow_start()
62 prng->yarrow.cipher = register_cipher(&rc5_desc); in yarrow_start()
[all …]
Dfortuna.c53 static void fortuna_update_iv(prng_state *prng) in fortuna_update_iv() argument
58 IV = prng->fortuna.IV; in fortuna_update_iv()
66 static int fortuna_reseed(prng_state *prng) in fortuna_reseed() argument
72 ++prng->fortuna.reset_cnt; in fortuna_reseed()
76 if ((err = sha256_process(&md, prng->fortuna.K, 32)) != CRYPT_OK) { in fortuna_reseed()
82 if (x == 0 || ((prng->fortuna.reset_cnt >> (x-1)) & 1) == 0) { in fortuna_reseed()
84 if ((err = sha256_done(&prng->fortuna.pool[x], tmp)) != CRYPT_OK) { in fortuna_reseed()
94 if ((err = sha256_init(&prng->fortuna.pool[x])) != CRYPT_OK) { in fortuna_reseed()
104 if ((err = sha256_done(&md, prng->fortuna.K)) != CRYPT_OK) { in fortuna_reseed()
107 if ((err = rijndael_setup(prng->fortuna.K, 32, 0, &prng->fortuna.skey)) != CRYPT_OK) { in fortuna_reseed()
[all …]
Drc4.c38 int rc4_start(prng_state *prng) in rc4_start() argument
40 LTC_ARGCHK(prng != NULL); in rc4_start()
43 prng->rc4.x = 0; in rc4_start()
55 int rc4_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng) in rc4_add_entropy() argument
58 LTC_ARGCHK(prng != NULL); in rc4_add_entropy()
61 if (prng->rc4.x + inlen > 256) { in rc4_add_entropy()
62 if (prng->rc4.x == 256) { in rc4_add_entropy()
67 inlen = 256 - prng->rc4.x; in rc4_add_entropy()
72 prng->rc4.buf[prng->rc4.x++] = *in++; in rc4_add_entropy()
84 int rc4_ready(prng_state *prng) in rc4_ready() argument
[all …]
Dsober128.c109 int sober128_start(prng_state *prng) in sober128_start() argument
114 LTC_ARGCHK(prng != NULL); in sober128_start()
116 c = &(prng->sober128); in sober128_start()
207 int sober128_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng) in sober128_add_entropy() argument
213 LTC_ARGCHK(prng != NULL); in sober128_add_entropy()
214 c = &(prng->sober128); in sober128_add_entropy()
273 int sober128_ready(prng_state *prng) in sober128_ready() argument
275 return prng->sober128.set == 1 ? CRYPT_OK : CRYPT_ERROR; in sober128_ready()
289 unsigned long sober128_read(unsigned char *out, unsigned long outlen, prng_state *prng) in sober128_read() argument
295 LTC_ARGCHK(prng != NULL); in sober128_read()
[all …]
Dsprng.c43 int sprng_start(prng_state *prng) in sprng_start() argument
55 int sprng_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng) in sprng_add_entropy() argument
65 int sprng_ready(prng_state *prng) in sprng_ready() argument
77 unsigned long sprng_read(unsigned char *out, unsigned long outlen, prng_state *prng) in sprng_read() argument
88 int sprng_done(prng_state *prng) in sprng_done() argument
100 int sprng_export(unsigned char *out, unsigned long *outlen, prng_state *prng) in sprng_export() argument
115 int sprng_import(const unsigned char *in, unsigned long inlen, prng_state *prng) in sprng_import() argument
Drng_make_prng.c26 int rng_make_prng(int bits, int wprng, prng_state *prng, in rng_make_prng() argument
32 LTC_ARGCHK(prng != NULL); in rng_make_prng()
43 if ((err = prng_descriptor[wprng].start(prng)) != CRYPT_OK) { in rng_make_prng()
52 if ((err = prng_descriptor[wprng].add_entropy(buf, (unsigned long)bits, prng)) != CRYPT_OK) { in rng_make_prng()
56 if ((err = prng_descriptor[wprng].ready(prng)) != CRYPT_OK) { in rng_make_prng()
/external/dropbear/libtomcrypt/src/headers/
Dtomcrypt_prng.h76 int (*start)(prng_state *prng);
83 int (*add_entropy)(const unsigned char *in, unsigned long inlen, prng_state *prng);
88 int (*ready)(prng_state *prng);
95 unsigned long (*read)(unsigned char *out, unsigned long outlen, prng_state *prng);
100 int (*done)(prng_state *prng);
107 int (*pexport)(unsigned char *out, unsigned long *outlen, prng_state *prng);
114 int (*pimport)(const unsigned char *in, unsigned long inlen, prng_state *prng);
122 int yarrow_start(prng_state *prng);
123 int yarrow_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng);
124 int yarrow_ready(prng_state *prng);
[all …]
Dtomcrypt_pk.h8 int rand_prime(void *N, long len, prng_state *prng, int wprng);
39 int rsa_make_key(prng_state *prng, int wprng, int size, long e, rsa_key *key);
64 prng_state *prng, int prng_idx, int hash_idx, int padding, rsa_key *key);
75 prng_state *prng, int prng_idx,
120 int katja_make_key(prng_state *prng, int wprng, int size, katja_key *key);
132 prng_state *prng, int prng_idx, int hash_idx, katja_key *key);
216 int ecc_make_key(prng_state *prng, int wprng, int keysize, ecc_key *key);
217 int ecc_make_key_ex(prng_state *prng, int wprng, ecc_key *key, const ltc_ecc_set_type *dp);
233 prng_state *prng, int wprng, int hash,
242 prng_state *prng, int wprng, ecc_key *key);
[all …]
Dtomcrypt_pkcs.h31 prng_state *prng,
47 unsigned long modulus_bitlen, prng_state *prng,
58 unsigned long saltlen, prng_state *prng,
/external/pixman/test/
Dprng-test.c64 prng_t prng; in bench() local
67 prng_srand_r (&prng, 1234); in bench()
70 prng_randmemset_r (&prng, buf, BUFSIZE, 0); in bench()
77 prng_randmemset_r (&prng, buf + 1, BUFSIZE, 0); in bench()
85 prng_randmemset_r (&prng, buf, BUFSIZE, RANDMEMSET_MORE_00_AND_FF); in bench()
94 prng_randmemset_r (&prng, buf + 1, BUFSIZE, RANDMEMSET_MORE_00_AND_FF); in bench()
119 prng_t prng; in main() local
130 prng_srand_r (&prng, 0); in main()
131 assert (ranval (&x) == prng_rand_r (&prng)); in main()
135 prng_srand_r (&prng, seed); in main()
[all …]
Dutils-prng.c102 randmemset_internal (prng_t *prng, in randmemset_internal() argument
108 prng_t local_prng = *prng; in randmemset_internal()
261 *prng = local_prng; in randmemset_internal()
272 void prng_randmemset_r (prng_t *prng, in prng_randmemset_r() argument
282 randmemset_internal (prng, buf, size, 0, 0); in prng_randmemset_r()
284 randmemset_internal (prng, buf, size, RANDMEMSET_MORE_00_AND_FF, 0); in prng_randmemset_r()
286 randmemset_internal (prng, buf, size, flags, 0); in prng_randmemset_r()
292 randmemset_internal (prng, buf, size, 0, 1); in prng_randmemset_r()
294 randmemset_internal (prng, buf, size, RANDMEMSET_MORE_00_AND_FF, 1); in prng_randmemset_r()
296 randmemset_internal (prng, buf, size, flags, 1); in prng_randmemset_r()
DMakefile.sources3 prng-test \
41 utils-prng.c \
46 utils-prng.h \
/external/pixman/demos/
DMakefile.in76 ../test/utils.c ../test/utils.h ../test/utils-prng.c \
77 ../test/utils-prng.h
79 @HAVE_GTK_TRUE@ utils-prng.$(OBJEXT)
92 ../test/utils.c ../test/utils.h ../test/utils-prng.c \
93 ../test/utils-prng.h
102 ../test/utils.c ../test/utils.h ../test/utils-prng.c \
103 ../test/utils-prng.h
111 ../test/utils.c ../test/utils.h ../test/utils-prng.c \
112 ../test/utils-prng.h
122 ../test/utils-prng.c ../test/utils-prng.h
[all …]
/external/dropbear/libtomcrypt/src/misc/crypt/
Dcrypt_register_prng.c23 int register_prng(const struct ltc_prng_descriptor *prng) in register_prng() argument
27 LTC_ARGCHK(prng != NULL); in register_prng()
32 if (XMEMCMP(&prng_descriptor[x], prng, sizeof(struct ltc_prng_descriptor)) == 0) { in register_prng()
41 XMEMCPY(&prng_descriptor[x], prng, sizeof(struct ltc_prng_descriptor)); in register_prng()
Dcrypt_unregister_prng.c23 int unregister_prng(const struct ltc_prng_descriptor *prng) in unregister_prng() argument
27 LTC_ARGCHK(prng != NULL); in unregister_prng()
32 if (XMEMCMP(&prng_descriptor[x], prng, sizeof(struct ltc_prng_descriptor)) != 0) { in unregister_prng()
/external/dropbear/libtomcrypt/src/pk/pkcs1/
Dpkcs_1_v1_5_encode.c37 prng_state *prng, in pkcs_1_v1_5_encode() argument
77 if (prng_descriptor[prng_idx].read(ps, ps_len, prng) != ps_len) { in pkcs_1_v1_5_encode()
85 if (prng_descriptor[prng_idx].read(&ps[i], 1, prng) != 1) { in pkcs_1_v1_5_encode()
/external/dropbear/libtomcrypt/src/pk/rsa/
Drsa_encrypt_key.c38 prng_state *prng, int prng_idx, int hash_idx, int padding, rsa_key *key) in rsa_encrypt_key_ex() argument
80 lparamlen, modulus_bitlen, prng, prng_idx, hash_idx, in rsa_encrypt_key_ex()
88 modulus_bitlen, prng, prng_idx, in rsa_encrypt_key_ex()
/external/dropbear/libtomcrypt/src/pk/ecc/
Decc_make_key.c34 int ecc_make_key(prng_state *prng, int wprng, int keysize, ecc_key *key) in ecc_make_key() argument
45 err = ecc_make_key_ex(prng, wprng, key, &ltc_ecc_sets[x]); in ecc_make_key()
50 int ecc_make_key_ex(prng_state *prng, int wprng, ecc_key *key, const ltc_ecc_set_type *dp) in ecc_make_key_ex() argument
79 if (prng_descriptor[wprng].read(buf, (unsigned long)keysize, prng) != (unsigned long)keysize) { in ecc_make_key_ex()
/external/llvm/lib/Transforms/Utils/
DMetaRenamer.cpp70 PRNG prng; in runOnModule() local
71 prng.srand(randSeed); in runOnModule()
101 STy->setName((Twine("struct.") + metaNames[prng.rand() % in runOnModule()
112 FI->setName(metaNames[prng.rand() % array_lengthof(metaNames)]); in runOnModule()
/external/dropbear/libtomcrypt/src/pk/dsa/
Ddsa_sign_hash.c33 prng_state *prng, int wprng, dsa_key *key) in dsa_sign_hash_raw() argument
68 if (prng_descriptor[wprng].read(buf, key->qord, prng) != (unsigned long)key->qord) { in dsa_sign_hash_raw()
124 prng_state *prng, int wprng, dsa_key *key) in dsa_sign_hash() argument
138 if ((err = dsa_sign_hash_raw(in, inlen, r, s, prng, wprng, key)) != CRYPT_OK) { in dsa_sign_hash()
Ddsa_make_key.c29 int dsa_make_key(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key) in dsa_make_key() argument
62 …if ((err = rand_prime(key->q, group_size, prng, wprng)) != CRYPT_OK) { goto error; } in dsa_make_key()
68 …if (prng_descriptor[wprng].read(buf+1, modulus_size - group_size, prng) != (unsigned long)(modulus… in dsa_make_key()
108 if (prng_descriptor[wprng].read(buf, group_size, prng) != (unsigned long)group_size) { in dsa_make_key()
/external/dropbear/libtomcrypt/src/math/
Drand_prime.c20 int rand_prime(void *N, long len, prng_state *prng, int wprng) in rand_prime() argument
53 if (prng_descriptor[wprng].read(buf, len, prng) != (unsigned long)len) { in rand_prime()
/external/dropbear/libtomcrypt/src/pk/katja/
Dkatja_make_key.c28 int katja_make_key(prng_state *prng, int wprng, int size, katja_key *key) in katja_make_key() argument
52 if ((err = rand_prime(q, -size, prng, wprng)) != CRYPT_OK) { goto done; } in katja_make_key()
57 if ((err = rand_prime(p, size+1, prng, wprng)) != CRYPT_OK) { goto done; } in katja_make_key()
Dkatja_encrypt_key.c37 prng_state *prng, int prng_idx, int hash_idx, katja_key *key) in katja_encrypt_key() argument
74 lparamlen, modulus_bitlen, prng, prng_idx, hash_idx, in katja_encrypt_key()
/external/smack/src/org/xbill/DNS/
DUDPClient.java17 private static SecureRandom prng = new SecureRandom(); field in UDPClient
38 int n = prng.nextInt();
68 int port = prng.nextInt(EPHEMERAL_RANGE) + in bind_random()

123