/external/dropbear/libtomcrypt/src/prngs/ |
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...] |
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...] |
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.h | 42 CRYPT_INVALID_PRNGSIZE, /* Invalid number of bits for a PRNG */ 43 CRYPT_ERROR_READPRNG, /* Could not read enough from PRNG */ 47 CRYPT_INVALID_PRNG, /* Invalid PRNG specified */
|
/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) {
|
crypt_prng_is_valid.c | 15 Determine if PRNG is valid, Tom St Denis 19 Test if a PRNG index is valid 20 @param idx The index of the PRNG to search for
|
crypt_find_prng.c | 15 Find a PRNG, Tom St Denis 19 Find a registered PRNG by name 20 @param name The name of the PRNG to look for
|
/external/srtp/crypto/include/ |
prng.h | 2 * prng.h 20 * x917_prng is an ANSI X9.17-like AES-based PRNG 38 * ctr_prng is an AES-CTR based PRNG
|
/external/dropbear/libtomcrypt/demos/ |
small.c | 1 /* small demo app that just includes a cipher/hash/prng */
|
/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,
|
/external/dropbear/libtomcrypt/notes/ |
tech0001.txt | 8 This tech note explains a relatively simple way to gather entropy for a PRNG (Yarrow in this case) in embedded systems 12 deterministic state of the PRNG is not known or predetermined with respect to an attacker. 17 First we shall begin by taking an overview of how the Yarrow PRNG works within libtomcrypt. At the heart of all 18 PRNGs is the "prng_state" data type. This is a union of structures that hold the PRNG state for the various prngs. The 29 At this point the PRNG is ready to accept fresh entropy which is added with 31 int yarrow_add_entropy(const unsigned char *buf, unsigned long len, prng_state *prng) 33 This function is **NOT** thread safe which will come under consideration later. To add entropy to our PRNG we must 63 int yarrow_ready(prng_state *prng) 65 Now the PRNG is ready to read via the 67 unsigned long yarrow_read(unsigned char *buf, unsigned long len, prng_state *prng) [all...] |
tech0004.txt | 21 Simply dump bits into the PRNG via yarrow_add_entropy() and call yarrow_ready() when you want to 22 put them to use. This PRNG while simple is not entirely safe. An attacker who learns the state 23 of the pool and can control future events can control the PRNG. This requires an active attacker but 41 Here's the main catch though. When the PRNG must be reseeded [so that you can extract bits from it] only 50 compromised and the PRNG will still eventually recover. The value FORTUNA_WD is the "WatchDog" counter. 52 means after 10 calls the PRNG will reseed itself. 59 Fortuna is really meant for a kernel-level PRNG. The more sources [and often] you feed into it the 66 SOBER-128 is actually a stream cipher but like most ciphers can easily be modelled in the context of a PRNG. 67 This PRNG is extremely fast [4 cycles/byte on a P4] and was designed by a well known cryptographer [Greg Rose]. 70 required. In such a sense it isn't a "system PRNG" but useful short term purposes. In particula [all...] |
/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/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) {
|
/external/dropbear/libtomcrypt/src/pk/dsa/ |
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...] |
/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/misc/ |
error_to_string.c | 32 "Invalid number of bits for a PRNG.", 33 "Error reading the PRNG.", 37 "Invalid PRNG specified.",
|