Home
last modified time | relevance | path

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

12

/optee_os-3.20.0/core/lib/libtomcrypt/src/prngs/
A Dyarrow.c34 LTC_ARGCHK(prng != NULL); in yarrow_start()
35 prng->ready = 0; in yarrow_start()
115 zeromem(prng->u.yarrow.pool, sizeof(prng->u.yarrow.pool)); in yarrow_start()
133 LTC_ARGCHK(prng != NULL); in yarrow_add_entropy()
149 if ((err = hash_descriptor[prng->u.yarrow.hash]->process(&md, prng->u.yarrow.pool, in yarrow_add_entropy()
160 err = hash_descriptor[prng->u.yarrow.hash]->done(&md, prng->u.yarrow.pool); in yarrow_add_entropy()
176 LTC_ARGCHK(prng != NULL); in yarrow_ready()
202 prng->ready = 1; in yarrow_ready()
222 if (!prng->ready) { in yarrow_read()
251 prng->ready = 0; in yarrow_done()
[all …]
A Dfortuna.c61 IV = prng->u.fortuna.IV; in s_fortuna_update_iv()
223 prng->ready = 0; in fortuna_start()
234 prng->u.fortuna.pool_idx = prng->u.fortuna.pool0_len = 0; in fortuna_start()
235 prng->u.fortuna.reset_cnt = prng->u.fortuna.wd = 0; in fortuna_start()
323 err = s_fortuna_add(0, prng->u.fortuna.pool_idx, in, inlen, prng); in fortuna_add_entropy()
376 if (!prng->ready) { in fortuna_read()
398 rijndael_ecb_encrypt(prng->u.fortuna.IV, out, &prng->u.fortuna.skey); in fortuna_read()
406 rijndael_ecb_encrypt(prng->u.fortuna.IV, tmp, &prng->u.fortuna.skey); in fortuna_read()
412 rijndael_ecb_encrypt(prng->u.fortuna.IV, prng->u.fortuna.K , &prng->u.fortuna.skey); in fortuna_read()
415 rijndael_ecb_encrypt(prng->u.fortuna.IV, prng->u.fortuna.K+16, &prng->u.fortuna.skey); in fortuna_read()
[all …]
A Dchacha20.c33 LTC_ARGCHK(prng != NULL); in chacha20_prng_start()
34 prng->ready = 0; in chacha20_prng_start()
35 XMEMSET(&prng->u.chacha.ent, 0, sizeof(prng->u.chacha.ent)); in chacha20_prng_start()
36 prng->u.chacha.idx = 0; in chacha20_prng_start()
54 LTC_ARGCHK(prng != NULL); in chacha20_prng_add_entropy()
59 if (prng->ready) { in chacha20_prng_add_entropy()
72 … while (inlen--) prng->u.chacha.ent[prng->u.chacha.idx++ % sizeof(prng->u.chacha.ent)] ^= *in++; in chacha20_prng_add_entropy()
97 XMEMSET(&prng->u.chacha.ent, 0, sizeof(prng->u.chacha.ent)); in chacha20_prng_ready()
98 prng->u.chacha.idx = 0; in chacha20_prng_ready()
99 prng->ready = 1; in chacha20_prng_ready()
[all …]
A Dsober128.c35 LTC_ARGCHK(prng != NULL); in sober128_start()
36 prng->ready = 0; in sober128_start()
37 XMEMSET(&prng->u.sober128.ent, 0, sizeof(prng->u.sober128.ent)); in sober128_start()
38 prng->u.sober128.idx = 0; in sober128_start()
39 LTC_MUTEX_INIT(&prng->lock) in sober128_start()
56 LTC_ARGCHK(prng != NULL); in sober128_add_entropy()
61 if (prng->ready) { in sober128_add_entropy()
74 …while (inlen--) prng->u.sober128.ent[prng->u.sober128.idx++ % sizeof(prng->u.sober128.ent)] ^= *in… in sober128_add_entropy()
99 XMEMSET(&prng->u.sober128.ent, 0, sizeof(prng->u.sober128.ent)); in sober128_ready()
101 prng->ready = 1; in sober128_ready()
[all …]
A Drc4.c31 int rc4_start(prng_state *prng) in rc4_start() argument
33 LTC_ARGCHK(prng != NULL); in rc4_start()
34 prng->ready = 0; in rc4_start()
36 prng->u.rc4.s.x = 0; in rc4_start()
38 XMEMSET(&prng->u.rc4.s.buf, 0, sizeof(prng->u.rc4.s.buf)); in rc4_start()
39 LTC_MUTEX_INIT(&prng->lock) in rc4_start()
56 LTC_ARGCHK(prng != NULL); in rc4_add_entropy()
61 if (prng->ready) { in rc4_add_entropy()
73 while (inlen--) prng->u.rc4.s.buf[prng->u.rc4.s.x++ % sizeof(prng->u.rc4.s.buf)] ^= *in++; in rc4_add_entropy()
102 prng->ready = 1; in rc4_ready()
[all …]
A Dsprng.c35 int sprng_start(prng_state *prng) in sprng_start() argument
37 LTC_UNUSED_PARAM(prng); in sprng_start()
52 LTC_UNUSED_PARAM(prng); in sprng_add_entropy()
61 int sprng_ready(prng_state *prng) in sprng_ready() argument
63 LTC_UNUSED_PARAM(prng); in sprng_ready()
77 LTC_UNUSED_PARAM(prng); in sprng_read()
86 int sprng_done(prng_state *prng) in sprng_done() argument
88 LTC_UNUSED_PARAM(prng); in sprng_done()
100 int sprng_export(unsigned char *out, unsigned long *outlen, prng_state *prng) in sprng_export() argument
104 LTC_UNUSED_PARAM(prng); in sprng_export()
[all …]
A Drng_make_prng.c24 int rng_make_prng(int bits, int wprng, prng_state *prng, in rng_make_prng() argument
31 LTC_ARGCHK(prng != NULL); in rng_make_prng()
46 if ((err = prng_descriptor[wprng]->start(prng)) != CRYPT_OK) { in rng_make_prng()
61 if ((err = prng_descriptor[wprng]->pimport(buf, bytes, prng)) != CRYPT_OK) { in rng_make_prng()
65 if ((err = prng_descriptor[wprng]->add_entropy(buf, bytes, prng)) != CRYPT_OK) { in rng_make_prng()
69 if ((err = prng_descriptor[wprng]->ready(prng)) != CRYPT_OK) { in rng_make_prng()
/optee_os-3.20.0/core/lib/libtomcrypt/src/headers/
A Dtomcrypt_prng.h84 int (*start)(prng_state *prng);
96 int (*ready)(prng_state *prng);
108 int (*done)(prng_state *prng);
130 int yarrow_start(prng_state *prng);
134 int yarrow_done(prng_state *prng);
156 int rc4_start(prng_state *prng);
158 int rc4_ready(prng_state *prng);
160 int rc4_done(prng_state *prng);
180 int sprng_start(prng_state *prng);
182 int sprng_ready(prng_state *prng);
[all …]
A Dtomcrypt_pk.h20 int rand_prime(void *N, long len, prng_state *prng, int wprng);
47 int rsa_make_key(prng_state *prng, int wprng, int size, long e, rsa_key *key);
48 int rsa_make_key_ubin_e(prng_state *prng, int wprng, int size,
91 prng_state *prng, int prng_idx,
147 int dh_generate_key(prng_state *prng, int wprng, dh_key *key);
262 int ecc_generate_key(prng_state *prng, int wprng, ecc_key *key);
289 prng_state *prng, int wprng, int hash,
345 int ed25519_make_key(prng_state *prng, int wprng, curve25519_key *key);
385 int x25519_make_key(prng_state *prng, int wprng, curve25519_key *key);
449 int dsa_generate_key(prng_state *prng, int wprng, dsa_key *key);
[all …]
A Dtomcrypt_pkcs.h35 prng_state *prng,
51 unsigned long modulus_bitlen, prng_state *prng,
62 unsigned long saltlen, prng_state *prng,
/optee_os-3.20.0/core/lib/libtomcrypt/src/misc/crypt/
A Dcrypt_register_prng.c15 int register_prng(const struct ltc_prng_descriptor *prng) in register_prng() argument
19 LTC_ARGCHK(prng != NULL); in register_prng()
24 if (prng_descriptor[x] == prng) { in register_prng()
33 prng_descriptor[x] = prng; in register_prng()
A Dcrypt_unregister_prng.c15 int unregister_prng(const struct ltc_prng_descriptor *prng) in unregister_prng() argument
19 LTC_ARGCHK(prng != NULL); in unregister_prng()
24 if (prng_descriptor[x] == prng) { in unregister_prng()
/optee_os-3.20.0/core/lib/libtomcrypt/
A Dtomcrypt.c21 static int prng_crypto_start(prng_state *prng __unused) in prng_crypto_start()
28 prng_state *prng __unused) in prng_crypto_add_entropy()
34 static int prng_crypto_ready(prng_state *prng __unused) in prng_crypto_ready()
40 prng_state *prng __unused) in prng_crypto_read()
48 static int prng_crypto_done(prng_state *prng __unused) in prng_crypto_done()
55 prng_state *prng __unused) in prng_crypto_export()
62 prng_state *prng __unused) in prng_crypto_import()
/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/ecc/
A Decc_make_key.c21 int ecc_make_key(prng_state *prng, int wprng, int keysize, ecc_key *key) in ecc_make_key() argument
26 if ((err = ecc_generate_key(prng, wprng, key)) != CRYPT_OK) { return err; } in ecc_make_key()
30 int ecc_make_key_ex(prng_state *prng, int wprng, ecc_key *key, const ltc_ecc_curve *cu) in ecc_make_key_ex() argument
34 if ((err = ecc_generate_key(prng, wprng, key)) != CRYPT_OK) { return err; } in ecc_make_key_ex()
38 int ecc_generate_key(prng_state *prng, int wprng, ecc_key *key) in ecc_generate_key() argument
53 if ((err = rand_bn_upto(key->k, key->dp.order, prng, wprng)) != CRYPT_OK) { in ecc_generate_key()
/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/dsa/
A Ddsa_make_key.c21 int dsa_make_key(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key) in dsa_make_key() argument
25 …if ((err = dsa_generate_pqg(prng, wprng, group_size, modulus_size, key)) != CRYPT_OK) { return err… in dsa_make_key()
26 if ((err = dsa_generate_key(prng, wprng, key)) != CRYPT_OK) { return err; } in dsa_make_key()
A Ddsa_generate_key.c19 int dsa_generate_key(prng_state *prng, int wprng, dsa_key *key) in dsa_generate_key() argument
30 if ((err = rand_bn_upto(key->x, key->q, prng, wprng)) != CRYPT_OK) { return err; } in dsa_generate_key()
A Ddsa_sign_hash.c25 prng_state *prng, int wprng, const dsa_key *key) in dsa_sign_hash_raw() argument
61 … if ((err = rand_bn_bits(k, qbits, prng, wprng)) != CRYPT_OK) { goto error; } in dsa_sign_hash_raw()
114 prng_state *prng, int wprng, const dsa_key *key) in dsa_sign_hash() argument
128 if ((err = dsa_sign_hash_raw(in, inlen, r, s, prng, wprng, key)) != CRYPT_OK) { in dsa_sign_hash()
/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/rsa/
A Drsa_make_key.c12 static int s_rsa_make_key(prng_state *prng, int wprng, int size, void *e, rsa_key *key) in s_rsa_make_key() argument
33 if ((err = rand_prime( p, size/2, prng, wprng)) != CRYPT_OK) { goto cleanup; } in s_rsa_make_key()
40 if ((err = rand_prime( q, size/2, prng, wprng)) != CRYPT_OK) { goto cleanup; } in s_rsa_make_key()
92 int rsa_make_key(prng_state *prng, int wprng, int size, long e, rsa_key *key) in rsa_make_key() argument
106 err = s_rsa_make_key(prng, wprng, size, tmp_e, key); in rsa_make_key()
123 int rsa_make_key_ubin_e(prng_state *prng, int wprng, int size, in rsa_make_key_ubin_e() argument
134 err = rsa_make_key_bn_e(prng, wprng, size, tmp_e, key); in rsa_make_key_ubin_e()
150 int rsa_make_key_bn_e(prng_state *prng, int wprng, int size, void *e, rsa_key *key) in rsa_make_key_bn_e() argument
157 err = s_rsa_make_key(prng, wprng, size, e, key); in rsa_make_key_bn_e()
A Drsa_encrypt_key.c30 prng_state *prng, int prng_idx, in rsa_encrypt_key_ex() argument
74 lparamlen, modulus_bitlen, prng, prng_idx, hash_idx, in rsa_encrypt_key_ex()
82 modulus_bitlen, prng, prng_idx, in rsa_encrypt_key_ex()
/optee_os-3.20.0/core/lib/libtomcrypt/src/math/
A Drand_bn.c10 int rand_bn_bits(void *N, int bits, prng_state *prng, int wprng) in rand_bn_bits() argument
28 if (prng_descriptor[wprng]->read(buf, bytes, prng) != (unsigned long)bytes) { in rand_bn_bits()
50 int rand_bn_upto(void *N, void *limit, prng_state *prng, int wprng) in rand_bn_upto() argument
59 res = rand_bn_bits(N, bits, prng, wprng); in rand_bn_upto()
A Drand_prime.c14 int rand_prime(void *N, long len, prng_state *prng, int wprng) in rand_prime() argument
47 if (prng_descriptor[wprng]->read(buf, len, prng) != (unsigned long)len) { in rand_prime()
/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/pkcs1/
A Dpkcs_1_v1_5_encode.c29 prng_state *prng, in pkcs_1_v1_5_encode() argument
69 if (prng_descriptor[prng_idx]->read(ps, ps_len, prng) != ps_len) { in pkcs_1_v1_5_encode()
77 if (prng_descriptor[prng_idx]->read(&ps[i], 1, prng) != 1) { in pkcs_1_v1_5_encode()
/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/ed25519/
A Ded25519_make_key.c19 int ed25519_make_key(prng_state *prng, int wprng, curve25519_key *key) in ed25519_make_key() argument
25 if ((err = tweetnacl_crypto_sign_keypair(prng, wprng, key->pub, key->priv)) != CRYPT_OK) { in ed25519_make_key()
/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/x25519/
A Dx25519_make_key.c19 int x25519_make_key(prng_state *prng, int wprng, curve25519_key *key) in x25519_make_key() argument
29 if (prng_descriptor[wprng]->read(key->priv, sizeof(key->priv), prng) != sizeof(key->priv)) { in x25519_make_key()
/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/dh/
A Ddh_generate_key.c37 int dh_generate_key(prng_state *prng, int wprng, dh_key *key) in dh_generate_key() argument
67 if (prng_descriptor[wprng]->read(buf, keysize, prng) != keysize) { in dh_generate_key()

Completed in 22 milliseconds

12