/optee_os-3.20.0/core/lib/libtomcrypt/src/prngs/ |
A D | yarrow.c | 34 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 D | fortuna.c | 61 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 D | chacha20.c | 33 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 D | sober128.c | 35 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 D | rc4.c | 31 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 D | sprng.c | 35 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 D | rng_make_prng.c | 24 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 D | tomcrypt_prng.h | 84 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 D | tomcrypt_pk.h | 20 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 D | tomcrypt_pkcs.h | 35 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 D | crypt_register_prng.c | 15 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 D | crypt_unregister_prng.c | 15 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 D | tomcrypt.c | 21 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 D | ecc_make_key.c | 21 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 D | dsa_make_key.c | 21 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 D | dsa_generate_key.c | 19 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 D | dsa_sign_hash.c | 25 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 D | rsa_make_key.c | 12 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 D | rsa_encrypt_key.c | 30 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 D | rand_bn.c | 10 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 D | rand_prime.c | 14 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 D | pkcs_1_v1_5_encode.c | 29 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 D | ed25519_make_key.c | 19 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 D | x25519_make_key.c | 19 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 D | dh_generate_key.c | 37 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()
|