/external/dropbear/libtomcrypt/src/prngs/ |
yarrow.c | 15 Yarrow PRNG, Tom St Denis 34 Start the PRNG 35 @param prng [out] The PRNG state to initialize 38 int yarrow_start(prng_state *prng) 42 LTC_ARGCHK(prng != NULL); 47 prng->yarrow.cipher = register_cipher(&rijndael_enc_desc); 49 prng->yarrow.cipher = register_cipher(&aes_enc_desc); 51 prng->yarrow.cipher = register_cipher(&rijndael_desc); 53 prng->yarrow.cipher = register_cipher(&aes_desc) [all...] |
fortuna.c | 15 Fortuna PRNG, Tom St Denis 53 static void fortuna_update_iv(prng_state *prng) 58 IV = prng->fortuna.IV; 65 /* reseed the PRNG */ 66 static int fortuna_reseed(prng_state *prng) 72 ++prng->fortuna.reset_cnt; 76 if ((err = sha256_process(&md, prng->fortuna.K, 32)) != CRYPT_OK) { 82 if (x == 0 || ((prng->fortuna.reset_cnt >> (x-1)) & 1) == 0) { 84 if ((err = sha256_done(&prng->fortuna.pool[x], tmp)) != CRYPT_OK) { 94 if ((err = sha256_init(&prng->fortuna.pool[x])) != CRYPT_OK) [all...] |
rc4.c | 15 RC4 PRNG, Tom St Denis 34 Start the PRNG 35 @param prng [out] The PRNG state to initialize 38 int rc4_start(prng_state *prng) 40 LTC_ARGCHK(prng != NULL); 43 prng->rc4.x = 0; 49 Add entropy to the PRNG state 52 @param prng PRNG state to updat [all...] |
rng_make_prng.c | 15 portable way to get secure random bits to feed a PRNG (Tom St Denis) 19 Create a PRNG from a RNG 21 @param wprng Index of which PRNG to setup 22 @param prng [out] PRNG state to initialize 26 int rng_make_prng(int bits, int wprng, prng_state *prng, 32 LTC_ARGCHK(prng != NULL); 43 if ((err = prng_descriptor[wprng].start(prng)) != CRYPT_OK) { 52 if ((err = prng_descriptor[wprng].add_entropy(buf, (unsigned long)bits, prng)) != CRYPT_OK) { 56 if ((err = prng_descriptor[wprng].ready(prng)) != CRYPT_OK) [all...] |
sprng.c | 15 Secure PRNG, Tom St Denis 18 /* A secure PRNG using the RNG functions. Basically this is a 19 * wrapper that allows you to use a secure RNG as a PRNG 39 Start the PRNG 40 @param prng [out] The PRNG state to initialize 43 int sprng_start(prng_state *prng) 49 Add entropy to the PRNG state 52 @param prng PRNG state to updat [all...] |
sober128.c | 105 Start the PRNG 106 @param prng [out] The PRNG state to initialize 109 int sober128_start(prng_state *prng) 114 LTC_ARGCHK(prng != NULL); 116 c = &(prng->sober128); 201 Add entropy to the PRNG state 204 @param prng PRNG state to update 207 int sober128_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng) [all...] |
/external/dropbear/libtomcrypt/src/headers/ |
tomcrypt_prng.h | 1 /* ---- PRNG Stuff ---- */ 66 /** PRNG descriptor */ 68 /** Name of the PRNG */ 72 /** Start a PRNG state 73 @param prng [out] The state to initialize 76 int (*start)(prng_state *prng); 77 /** Add entropy to the PRNG 80 @param prng The PRNG state 83 int (*add_entropy)(const unsigned char *in, unsigned long inlen, prng_state *prng); [all...] |
tomcrypt_pkcs.h | 31 prng_state *prng, 47 unsigned long modulus_bitlen, prng_state *prng, 58 unsigned long saltlen, prng_state *prng,
|
tomcrypt_pk.h | 8 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...] |
/external/dropbear/libtomcrypt/src/misc/crypt/ |
crypt_register_prng.c | 15 Register a PRNG, Tom St Denis 19 Register a PRNG with the descriptor table 20 @param prng The PRNG you wish to register 23 int register_prng(const struct ltc_prng_descriptor *prng) 27 LTC_ARGCHK(prng != NULL); 32 if (XMEMCMP(&prng_descriptor[x], prng, sizeof(struct ltc_prng_descriptor)) == 0) { 41 XMEMCPY(&prng_descriptor[x], prng, sizeof(struct ltc_prng_descriptor));
|
crypt_unregister_prng.c | 15 Unregister a PRNG, Tom St Denis 19 Unregister a PRNG from the descriptor table 20 @param prng The PRNG descriptor to remove 23 int unregister_prng(const struct ltc_prng_descriptor *prng) 27 LTC_ARGCHK(prng != NULL); 32 if (XMEMCMP(&prng_descriptor[x], prng, sizeof(struct ltc_prng_descriptor)) != 0) {
|
/external/dropbear/libtomcrypt/src/math/ |
rand_prime.c | 20 int rand_prime(void *N, long len, prng_state *prng, int wprng) 40 /* valid PRNG? Better be! */ 53 if (prng_descriptor[wprng].read(buf, len, prng) != (unsigned long)len) {
|
/external/dropbear/libtomcrypt/src/pk/katja/ |
katja_encrypt_key.c | 28 @param prng An active PRNG 29 @param prng_idx The index of the desired prng 37 prng_state *prng, int prng_idx, int hash_idx, katja_key *key) 47 /* valid prng and hash ? */ 74 lparamlen, modulus_bitlen, prng, prng_idx, hash_idx,
|
katja_make_key.c | 22 @param prng An active PRNG state 23 @param wprng The index of the PRNG desired 28 int katja_make_key(prng_state *prng, int wprng, int size, katja_key *key) 52 if ((err = rand_prime(q, -size, prng, wprng)) != CRYPT_OK) { goto done; } 57 if ((err = rand_prime(p, size+1, prng, wprng)) != CRYPT_OK) { goto done; }
|
/external/dropbear/libtomcrypt/src/pk/pkcs1/ |
pkcs_1_v1_5_encode.c | 26 * \param prng An active PRNG state (only for LTC_PKCS_1_EME) 27 * \param prng_idx The index of the PRNG desired (only for LTC_PKCS_1_EME) 37 prng_state *prng, 52 if (block_type == LTC_PKCS_1_EME) { /* encryption padding, we need a valid PRNG */ 77 if (prng_descriptor[prng_idx].read(ps, ps_len, prng) != ps_len) { 85 if (prng_descriptor[prng_idx].read(&ps[i], 1, prng) != 1) {
|
/external/dropbear/libtomcrypt/src/pk/rsa/ |
rsa_encrypt_key.c | 28 @param prng An active PRNG 29 @param prng_idx The index of the desired prng 38 prng_state *prng, int prng_idx, int hash_idx, int padding, rsa_key *key) 54 /* valid prng? */ 80 lparamlen, modulus_bitlen, prng, prng_idx, hash_idx, 88 modulus_bitlen, prng, prng_idx,
|
rsa_sign_hash.c | 27 @param prng An active PRNG state 28 @param prng_idx The index of the PRNG desired 37 prng_state *prng, int prng_idx, 55 /* valid prng and hash ? */ 77 if ((err = pkcs_1_pss_encode(in, inlen, saltlen, prng, prng_idx,
|
rsa_make_key.c | 22 @param prng An active PRNG state 23 @param wprng The index of the PRNG desired 29 int rsa_make_key(prng_state *prng, int wprng, int size, long e, rsa_key *key) 58 if ((err = rand_prime( p, size/2, prng, wprng)) != CRYPT_OK) { goto errkey; } 65 if ((err = rand_prime( q, size/2, prng, wprng)) != CRYPT_OK) { goto errkey; }
|
/external/dropbear/libtomcrypt/src/pk/ecc/ |
ecc_make_key.c | 28 @param prng An active PRNG state 29 @param wprng The index of the PRNG you wish to use 34 int ecc_make_key(prng_state *prng, int wprng, int keysize, ecc_key *key) 45 err = ecc_make_key_ex(prng, wprng, key, <c_ecc_sets[x]); 50 int ecc_make_key_ex(prng_state *prng, int wprng, ecc_key *key, const ltc_ecc_set_type *dp) 62 /* good prng? */ 79 if (prng_descriptor[wprng].read(buf, (unsigned long)keysize, prng) != (unsigned long)keysize) {
|
ecc_sign_hash.c | 32 @param prng An active PRNG state 33 @param wprng The index of the PRNG you wish to use 39 prng_state *prng, int wprng, ecc_key *key) 74 if ((err = ecc_make_key_ex(prng, wprng, &pubkey, key->dp)) != CRYPT_OK) {
|
ecc_encrypt_key.c | 32 @param prng An active PRNG state 33 @param wprng The index of the PRNG you wish to use 40 prng_state *prng, int wprng, int hash, 67 if ((err = ecc_make_key_ex(prng, wprng, &pubkey, key->dp)) != CRYPT_OK) {
|
/external/dropbear/libtomcrypt/src/pk/dsa/ |
dsa_make_key.c | 22 @param prng An active PRNG state 23 @param wprng The index of the PRNG desired 29 int dsa_make_key(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key) 38 /* check prng */ 62 if ((err = rand_prime(key->q, group_size, prng, wprng)) != CRYPT_OK) { goto error; } 68 if (prng_descriptor[wprng].read(buf+1, modulus_size - group_size, prng) != (unsigned long)(modulus_size - group_size)) { 108 if (prng_descriptor[wprng].read(buf, group_size, prng) != (unsigned long)group_size) {
|
dsa_sign_hash.c | 26 @param prng An active PRNG state 27 @param wprng The index of the PRNG desired 33 prng_state *prng, int wprng, dsa_key *key) 68 if (prng_descriptor[wprng].read(buf, key->qord, prng) != (unsigned long)key->qord) { 117 @param prng An active PRNG state 118 @param wprng The index of the PRNG desired 124 prng_state *prng, int wprng, dsa_key *key) 138 if ((err = dsa_sign_hash_raw(in, inlen, r, s, prng, wprng, key)) != CRYPT_OK) [all...] |
dsa_encrypt_key.c | 26 @param prng An active PRNG state 27 @param wprng The index of the PRNG you wish to use 34 prng_state *prng, int wprng, int hash, 80 if (prng_descriptor[wprng].read(expt, x, prng) != x) {
|
/external/dropbear/libtomcrypt/demos/ |
encrypt.c | 85 printf("Error registering yarrow PRNG\n"); 90 printf("Error registering sprng PRNG\n"); 104 prng_state prng; local 198 if ((errno = rng_make_prng(128, find_prng("yarrow"), &prng, NULL)) != CRYPT_OK) { 199 printf("Error setting up PRNG, %s\n", error_to_string(errno)); 204 x = yarrow_read(IV,ivsize,&prng); 206 printf("Error reading PRNG for IV required.\n");
|