/optee_os-3.20.0/core/lib/libtomcrypt/src/prngs/ |
A D | rng_make_prng.c | 24 int rng_make_prng(int bits, int wprng, prng_state *prng, in rng_make_prng() argument 34 if ((err = prng_is_valid(wprng)) != CRYPT_OK) { in rng_make_prng() 39 bytes = prng_descriptor[wprng]->export_size; 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/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()
|
A D | ecc_encrypt_key.c | 27 prng_state *prng, int wprng, int hash, in ecc_encrypt_key() argument 50 if ((err = ecc_generate_key(prng, wprng, &pubkey)) != CRYPT_OK) { return err; } in ecc_encrypt_key()
|
A D | ecc_sign_hash.c | 28 prng_state *prng, int wprng, ecc_signature_type sigformat, in ecc_sign_hash_ex() argument 76 if ((err = ecc_generate_key(prng, wprng, &pubkey)) != CRYPT_OK) { goto errnokey; } in ecc_sign_hash_ex() 96 …if ((err = rand_bn_upto(b, p, prng, wprng)) != CRYPT_OK) { goto error; } /* b = blinding … in ecc_sign_hash_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 19 if ((res = prng_is_valid(wprng)) != CRYPT_OK) return res; in rand_bn_bits() 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 35 if ((err = prng_is_valid(wprng)) != CRYPT_OK) { in rand_prime() 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/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 21 if ((err = prng_is_valid(wprng)) != CRYPT_OK) { in s_rsa_make_key() 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()
|
/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_sign_hash.c | 25 prng_state *prng, int wprng, const dsa_key *key) in dsa_sign_hash_raw() argument 36 if ((err = prng_is_valid(wprng)) != CRYPT_OK) { in dsa_sign_hash_raw() 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()
|
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_encrypt_key.c | 26 prng_state *prng, int wprng, int hash, in dsa_encrypt_key() argument 40 if ((err = prng_is_valid(wprng)) != CRYPT_OK) { in dsa_encrypt_key() 73 if ((err = rand_bn_upto(g_priv, key->q, prng, wprng)) != CRYPT_OK) { in dsa_encrypt_key()
|
A D | dsa_generate_pqg.c | 23 static int s_dsa_make_params(prng_state *prng, int wprng, int group_size, int modulus_size, void *p… in s_dsa_make_params() argument 124 …if (prng_descriptor[wprng]->read(sbuf, seedbytes, prng) != seedbytes) { err = CRYPT_ERROR_RE… in s_dsa_make_params() 181 if ((err = rand_bn_bits(h, i, prng, wprng)) != CRYPT_OK) { goto cleanup; } in s_dsa_make_params() 208 int dsa_generate_pqg(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key) in dsa_generate_pqg() argument 220 err = s_dsa_make_params(prng, wprng, group_size, modulus_size, key->p, key->q, key->g); in dsa_generate_pqg()
|
/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 25 if ((err = prng_is_valid(wprng)) != CRYPT_OK) { in x25519_make_key() 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/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/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 47 if ((err = prng_is_valid(wprng)) != CRYPT_OK) { in dh_generate_key() 67 if (prng_descriptor[wprng]->read(buf, keysize, prng) != keysize) { in dh_generate_key()
|
A D | dh_make_key.c | 49 int dh_make_key(prng_state *prng, int wprng, void *q, int xbits, dh_key *key) in dh_make_key() argument 64 err = prng_is_valid(wprng); in dh_make_key() 110 if (prng_descriptor[wprng]->read(buf, key_size, prng) != in dh_make_key()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/headers/ |
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, 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); 267 int ecc_make_key(prng_state *prng, int wprng, int keysize, 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_private.h | 258 int rand_bn_bits(void *N, int bits, prng_state *prng, int wprng); 259 int rand_bn_upto(void *N, void *limit, prng_state *prng, int wprng); 269 int rsa_make_key_bn_e(prng_state *prng, int wprng, int size, void *e, 373 int tweetnacl_crypto_sign_keypair(prng_state *prng, int wprng, unsigned char *pk,unsigned char *sk);
|
A D | tomcrypt_math.h | 461 int wprng,
|
A D | tomcrypt_prng.h | 217 int rng_make_prng(int bits, int wprng, prng_state *prng, void (*callback)(void));
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/ec25519/ |
A D | tweetnacl.c | 325 int tweetnacl_crypto_sign_keypair(prng_state *prng, int wprng, u8 *pk, u8 *sk) in tweetnacl_crypto_sign_keypair() argument 330 if ((err = prng_is_valid(wprng)) != CRYPT_OK) { in tweetnacl_crypto_sign_keypair() 334 if (prng_descriptor[wprng]->read(sk,32, prng) != 32) { in tweetnacl_crypto_sign_keypair()
|