Home
last modified time | relevance | path

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

12

/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/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/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()
Decc_sign_hash.c39 prng_state *prng, int wprng, ecc_key *key) in ecc_sign_hash() argument
74 if ((err = ecc_make_key_ex(prng, wprng, &pubkey, key->dp)) != CRYPT_OK) { in ecc_sign_hash()
Decc_encrypt_key.c40 prng_state *prng, int wprng, int hash, in ecc_encrypt_key() argument
67 if ((err = ecc_make_key_ex(prng, wprng, &pubkey, key->dp)) != CRYPT_OK) { in ecc_encrypt_key()
/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()
Drsa_make_key.c29 int rsa_make_key(prng_state *prng, int wprng, int size, long e, rsa_key *key) in rsa_make_key() argument
58 if ((err = rand_prime( p, size/2, prng, wprng)) != CRYPT_OK) { goto errkey; } in rsa_make_key()
65 if ((err = rand_prime( q, size/2, prng, wprng)) != CRYPT_OK) { goto errkey; } in rsa_make_key()
Drsa_sign_hash.c37 prng_state *prng, int prng_idx, in rsa_sign_hash_ex() argument
77 if ((err = pkcs_1_pss_encode(in, inlen, saltlen, prng, prng_idx, in rsa_sign_hash_ex()
/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()
Ddsa_encrypt_key.c34 prng_state *prng, int wprng, int hash, in dsa_encrypt_key() argument
80 if (prng_descriptor[wprng].read(expt, x, prng) != x) { in dsa_encrypt_key()
/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/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/demos/
Dencrypt.c104 prng_state prng; in main() local
198 if ((errno = rng_make_prng(128, find_prng("yarrow"), &prng, NULL)) != CRYPT_OK) { in main()
204 x = yarrow_read(IV,ivsize,&prng); in main()

12