/optee_os/core/lib/libtomcrypt/src/pk/dh/ |
A D | dh_shared_secret.c | 23 int dh_shared_secret(const dh_key *private_key, const dh_key *public_key, in dh_shared_secret() argument 30 LTC_ARGCHK(private_key != NULL); in dh_shared_secret() 36 if (private_key->type != PK_PRIVATE) { in dh_shared_secret() 41 … if (mp_cmp(private_key->prime, public_key->prime) != LTC_MP_EQ) { return CRYPT_PK_TYPE_MISMATCH; } in dh_shared_secret() 42 … if (mp_cmp(private_key->base, public_key->base) != LTC_MP_EQ) { return CRYPT_PK_TYPE_MISMATCH; } in dh_shared_secret() 55 if ((err = mp_exptmod(public_key->y, private_key->x, private_key->prime, tmp)) != CRYPT_OK) { in dh_shared_secret()
|
/optee_os/core/lib/libtomcrypt/src/pk/ed25519/ |
A D | ed25519_sign.c | 29 const curve25519_key *private_key) in ed25519_sign() argument 38 LTC_ARGCHK(private_key != NULL); in ed25519_sign() 40 if (private_key->algo != PKA_ED25519) return CRYPT_PK_INVALID_TYPE; in ed25519_sign() 41 if (private_key->type != PK_PRIVATE) return CRYPT_PK_INVALID_TYPE; in ed25519_sign() 54 private_key->priv, private_key->pub); in ed25519_sign()
|
/optee_os/core/lib/libtomcrypt/src/pk/ec25519/ |
A D | ec25519_import_pkcs8.c | 37 unsigned char private_key[34]; in ec25519_import_pkcs8() local 49 key_len = sizeof(private_key); in ec25519_import_pkcs8() 53 LTC_ASN1_OCTET_STRING, key_len, private_key, in ec25519_import_pkcs8() 76 …if ((err = der_decode_octet_string(private_key, sizeof(private_key), key->priv, &key_len)) == CRYP… in ec25519_import_pkcs8() 88 zeromem(private_key, sizeof(private_key)); in ec25519_import_pkcs8()
|
A D | ec25519_export.c | 35 unsigned char private_key[34]; in ec25519_export() local 36 unsigned long version, private_key_len = sizeof(private_key); in ec25519_export() 60 … if ((err = der_encode_octet_string(key->priv, 32uL, private_key, &private_key_len)) != CRYPT_OK) { in ec25519_export() 68 LTC_ASN1_OCTET_STRING, private_key_len, private_key, in ec25519_export()
|
/optee_os/core/lib/libtomcrypt/src/pk/ecc/ |
A D | ecc_shared_secret.c | 28 int ecc_shared_secret(const ecc_key *private_key, const ecc_key *public_key, in ecc_shared_secret() argument 36 LTC_ARGCHK(private_key != NULL); in ecc_shared_secret() 42 if (private_key->type != PK_PRIVATE) { in ecc_shared_secret() 52 prime = private_key->dp.prime; in ecc_shared_secret() 53 a = private_key->dp.A; in ecc_shared_secret() 55 …if ((err = ltc_mp.ecc_ptmul(private_key->k, &public_key->pubkey, result, a, prime, 1)) != CRYPT_OK… in ecc_shared_secret()
|
/optee_os/core/lib/libtomcrypt/src/pk/x25519/ |
A D | x25519_shared_secret.c | 27 int x25519_shared_secret(const curve25519_key *private_key, in x25519_shared_secret() argument 31 LTC_ARGCHK(private_key != NULL); in x25519_shared_secret() 36 if(private_key->type != PK_PRIVATE) return CRYPT_PK_INVALID_TYPE; in x25519_shared_secret() 43 tweetnacl_crypto_scalarmult(out, private_key->priv, public_key->pub); in x25519_shared_secret()
|
/optee_os/lib/libmbedtls/core/ |
A D | dh.c | 96 TEE_Result crypto_acipher_dh_shared_secret(struct dh_keypair *private_key, in crypto_acipher_dh_shared_secret() argument 109 dhm.G = *(mbedtls_mpi *)private_key->g; in crypto_acipher_dh_shared_secret() 110 dhm.P = *(mbedtls_mpi *)private_key->p; in crypto_acipher_dh_shared_secret() 111 dhm.GX = *(mbedtls_mpi *)private_key->y; in crypto_acipher_dh_shared_secret() 112 dhm.X = *(mbedtls_mpi *)private_key->x; in crypto_acipher_dh_shared_secret() 115 dhm.len = crypto_bignum_num_bytes(private_key->p); in crypto_acipher_dh_shared_secret()
|
A D | ecc.c | 309 static TEE_Result ecc_shared_secret(struct ecc_keypair *private_key, in ecc_shared_secret() argument 321 lmd_res = mbedtls_ecp_group_load(&ecdh.grp, private_key->curve); in ecc_shared_secret() 327 ecdh.d = *(mbedtls_mpi *)private_key->d; in ecc_shared_secret()
|
/optee_os/core/lib/libtomcrypt/ |
A D | dh.c | 69 TEE_Result crypto_acipher_dh_shared_secret(struct dh_keypair *private_key, in crypto_acipher_dh_shared_secret() argument 75 if (!private_key || !public_key || !secret) in crypto_acipher_dh_shared_secret() 78 err = mp_exptmod(public_key, private_key->x, private_key->p, secret); in crypto_acipher_dh_shared_secret()
|
A D | ecc.c | 315 static TEE_Result _ltc_ecc_shared_secret(struct ecc_keypair *private_key, in _ltc_ecc_shared_secret() argument 327 if (private_key->curve != public_key->curve) in _ltc_ecc_shared_secret() 330 res = ecc_populate_ltc_private_key(<c_private_key, private_key, in _ltc_ecc_shared_secret()
|
/optee_os/core/lib/libtomcrypt/src/pk/dsa/ |
A D | dsa_shared_secret.c | 28 int dsa_shared_secret(void *private_key, void *base, in dsa_shared_secret() argument 36 LTC_ARGCHK(private_key != NULL); in dsa_shared_secret() 46 if ((err = mp_exptmod(base, private_key, public_key->p, res)) != CRYPT_OK) { in dsa_shared_secret()
|
/optee_os/core/drivers/crypto/crypto_api/acipher/ |
A D | dh.c | 57 TEE_Result crypto_acipher_dh_shared_secret(struct dh_keypair *private_key, in crypto_acipher_dh_shared_secret() argument 66 if (!private_key || !public_key || !secret) { in crypto_acipher_dh_shared_secret() 80 sdata.key_priv = private_key; in crypto_acipher_dh_shared_secret()
|
A D | ecc.c | 261 static TEE_Result ecc_shared_secret(struct ecc_keypair *private_key, in ecc_shared_secret() argument 271 if (!private_key || !public_key || !secret_len) { in ecc_shared_secret() 276 if (private_key->curve != public_key->curve) { in ecc_shared_secret() 278 private_key->curve, public_key->curve); in ecc_shared_secret() 301 sdata.key_priv = private_key; in ecc_shared_secret()
|
/optee_os/core/crypto/ |
A D | crypto.c | 668 crypto_acipher_dh_shared_secret(struct dh_keypair *private_key __unused, in crypto_acipher_dh_shared_secret() 751 TEE_Result crypto_acipher_ecc_shared_secret(struct ecc_keypair *private_key, in crypto_acipher_ecc_shared_secret() argument 756 assert(private_key->ops); in crypto_acipher_ecc_shared_secret() 758 if (!private_key->ops->shared_secret) in crypto_acipher_ecc_shared_secret() 761 return private_key->ops->shared_secret(private_key, public_key, secret, in crypto_acipher_ecc_shared_secret()
|
/optee_os/core/drivers/crypto/se050/core/ |
A D | ecc.c | 348 static TEE_Result shared_secret(struct ecc_keypair *private_key, in shared_secret() argument 360 if (private_key->curve != public_key->curve) in shared_secret() 363 ret = ecc_get_key_size(private_key->curve, 0, &key_bytes, &key_bits); in shared_secret() 367 ret = se050_inject_keypair(&kobject, private_key, key_bytes); in shared_secret() 399 if (!se050_ecc_keypair_from_nvm(private_key)) in shared_secret()
|
/optee_os/core/lib/libtomcrypt/src/headers/ |
A D | tomcrypt_pk.h | 156 int dh_shared_secret(const dh_key *private_key, const dh_key *public_key, 291 int ecc_shared_secret(const ecc_key *private_key, const ecc_key *public_key, 370 const curve25519_key *private_key); 393 int x25519_shared_secret(const curve25519_key *private_key, 473 int dsa_shared_secret(void *private_key, void *base,
|
/optee_os/core/include/crypto/ |
A D | crypto.h | 204 TEE_Result crypto_acipher_dh_shared_secret(struct dh_keypair *private_key, 245 TEE_Result crypto_acipher_ecc_shared_secret(struct ecc_keypair *private_key,
|
A D | crypto_impl.h | 350 TEE_Result (*shared_secret)(struct ecc_keypair *private_key,
|
/optee_os/lib/libmbedtls/mbedtls/library/ |
A D | ssl_srv.c | 3860 mbedtls_pk_context *private_key = mbedtls_ssl_own_key( ssl ); in ssl_decrypt_encrypted_pms() local 3931 if( ! mbedtls_pk_can_do( private_key, MBEDTLS_PK_RSA ) ) in ssl_decrypt_encrypted_pms() 3937 ret = mbedtls_pk_decrypt( private_key, p, len, in ssl_decrypt_encrypted_pms()
|