Home
last modified time | relevance | path

Searched refs:rsa (Results 1 – 23 of 23) sorted by relevance

/optee_os/lib/libmbedtls/core/
H A Drsa.c100 static TEE_Result rsa_complete_from_key_pair(mbedtls_rsa_context *rsa, in rsa_complete_from_key_pair() argument
105 rsa->E = *(mbedtls_mpi *)key->e; in rsa_complete_from_key_pair()
106 rsa->N = *(mbedtls_mpi *)key->n; in rsa_complete_from_key_pair()
107 rsa->D = *(mbedtls_mpi *)key->d; in rsa_complete_from_key_pair()
108 rsa->len = mbedtls_mpi_size(&rsa->N); in rsa_complete_from_key_pair()
111 rsa->P = *(mbedtls_mpi *)key->p; in rsa_complete_from_key_pair()
112 rsa->Q = *(mbedtls_mpi *)key->q; in rsa_complete_from_key_pair()
113 rsa->QP = *(mbedtls_mpi *)key->qp; in rsa_complete_from_key_pair()
114 rsa->DP = *(mbedtls_mpi *)key->dp; in rsa_complete_from_key_pair()
115 rsa->DQ = *(mbedtls_mpi *)key->dq; in rsa_complete_from_key_pair()
[all …]
H A Dsub.mk28 srcs-$(CFG_CRYPTO_RSA) += rsa.c
/optee_os/lib/libmbedtls/mbedtls/library/
H A Dpsa_crypto_rsa.c43 const mbedtls_rsa_context *rsa) in psa_check_rsa_key_byte_aligned() argument
49 mbedtls_rsa_export(rsa, &n, NULL, NULL, NULL, NULL)); in psa_check_rsa_key_byte_aligned()
116 mbedtls_rsa_context *rsa = NULL; in mbedtls_psa_rsa_import_key() local
122 &rsa); in mbedtls_psa_rsa_import_key()
127 *bits = (psa_key_bits_t) PSA_BYTES_TO_BITS(mbedtls_rsa_get_len(rsa)); in mbedtls_psa_rsa_import_key()
134 rsa, in mbedtls_psa_rsa_import_key()
140 mbedtls_rsa_free(rsa); in mbedtls_psa_rsa_import_key()
141 mbedtls_free(rsa); in mbedtls_psa_rsa_import_key()
152 mbedtls_rsa_context *rsa, in mbedtls_psa_rsa_export_key() argument
164 ret = mbedtls_rsa_write_key(rsa, data, &end); in mbedtls_psa_rsa_export_key()
[all …]
H A Drsa_internal.h34 int mbedtls_rsa_parse_key(mbedtls_rsa_context *rsa, const unsigned char *key, size_t keylen);
50 int mbedtls_rsa_parse_pubkey(mbedtls_rsa_context *rsa, const unsigned char *key, size_t keylen);
72 int mbedtls_rsa_write_key(const mbedtls_rsa_context *rsa, unsigned char *start,
95 int mbedtls_rsa_write_pubkey(const mbedtls_rsa_context *rsa, unsigned char *start,
H A Dpk_wrap.c60 const mbedtls_rsa_context *rsa = (const mbedtls_rsa_context *) pk->pk_ctx; in rsa_get_bitlen() local
61 return mbedtls_rsa_get_bitlen(rsa); in rsa_get_bitlen()
69 mbedtls_rsa_context *rsa = (mbedtls_rsa_context *) pk->pk_ctx; in rsa_verify_wrap() local
78 size_t rsa_len = mbedtls_rsa_get_len(rsa); in rsa_verify_wrap()
86 if (mbedtls_rsa_get_padding_mode(rsa) == MBEDTLS_RSA_PKCS_V21) { in rsa_verify_wrap()
96 key_len = mbedtls_rsa_write_pubkey(rsa, buf, &p); in rsa_verify_wrap()
135 mbedtls_rsa_context *rsa = (mbedtls_rsa_context *) pk->pk_ctx; in rsa_verify_wrap() local
136 size_t rsa_len = mbedtls_rsa_get_len(rsa); in rsa_verify_wrap()
148 if ((ret = mbedtls_rsa_pkcs1_verify(rsa, md_alg, in rsa_verify_wrap()
259 mbedtls_rsa_context *rsa = (mbedtls_rsa_context *) pk->pk_ctx; in rsa_sign_wrap() local
[all …]
H A Drsa.c81 int mbedtls_rsa_parse_key(mbedtls_rsa_context *rsa, const unsigned char *key, size_t keylen) in mbedtls_rsa_parse_key() argument
128 (ret = mbedtls_rsa_import(rsa, &T, NULL, NULL, in mbedtls_rsa_parse_key()
135 (ret = mbedtls_rsa_import(rsa, NULL, NULL, NULL, in mbedtls_rsa_parse_key()
142 (ret = mbedtls_rsa_import(rsa, NULL, NULL, NULL, in mbedtls_rsa_parse_key()
149 (ret = mbedtls_rsa_import(rsa, NULL, &T, NULL, in mbedtls_rsa_parse_key()
156 (ret = mbedtls_rsa_import(rsa, NULL, NULL, &T, in mbedtls_rsa_parse_key()
175 (ret = mbedtls_mpi_copy(&rsa->DP, &T)) != 0) { in mbedtls_rsa_parse_key()
181 (ret = mbedtls_mpi_copy(&rsa->DQ, &T)) != 0) { in mbedtls_rsa_parse_key()
187 (ret = mbedtls_mpi_copy(&rsa->QP, &T)) != 0) { in mbedtls_rsa_parse_key()
209 if ((ret = mbedtls_rsa_complete(rsa)) != 0 || in mbedtls_rsa_parse_key()
[all …]
H A Dpsa_crypto_rsa.h71 mbedtls_rsa_context *rsa,
H A Dpk.c380 static psa_algorithm_t psa_algorithm_for_rsa(const mbedtls_rsa_context *rsa, in psa_algorithm_for_rsa() argument
383 if (mbedtls_rsa_get_padding_mode(rsa) == MBEDTLS_RSA_PKCS_V21) { in psa_algorithm_for_rsa()
385 mbedtls_md_type_t md_type = (mbedtls_md_type_t) mbedtls_rsa_get_md_alg(rsa); in psa_algorithm_for_rsa()
441 mbedtls_rsa_context *rsa = mbedtls_pk_rsa(*pk); in mbedtls_pk_get_psa_attributes() local
442 int has_private = (mbedtls_rsa_check_privkey(rsa) == 0); in mbedtls_pk_get_psa_attributes()
451 psa_algorithm_for_rsa(rsa, want_crypt)); in mbedtls_pk_get_psa_attributes()
/optee_os/core/drivers/crypto/crypto_api/acipher/
H A Drsa.c22 struct drvcrypt_rsa *rsa = NULL; in crypto_acipher_alloc_rsa_keypair() local
30 rsa = drvcrypt_get_ops(CRYPTO_RSA); in crypto_acipher_alloc_rsa_keypair()
31 if (rsa) in crypto_acipher_alloc_rsa_keypair()
32 ret = rsa->alloc_keypair(key, size_bits); in crypto_acipher_alloc_rsa_keypair()
43 struct drvcrypt_rsa *rsa = NULL; in crypto_acipher_alloc_rsa_public_key() local
51 rsa = drvcrypt_get_ops(CRYPTO_RSA); in crypto_acipher_alloc_rsa_public_key()
52 if (rsa) in crypto_acipher_alloc_rsa_public_key()
53 ret = rsa->alloc_publickey(key, size_bits); in crypto_acipher_alloc_rsa_public_key()
62 struct drvcrypt_rsa *rsa = NULL; in crypto_acipher_free_rsa_public_key() local
65 rsa = drvcrypt_get_ops(CRYPTO_RSA); in crypto_acipher_free_rsa_public_key()
[all …]
H A Drsassa.c183 struct drvcrypt_rsa *rsa = NULL; in rsassa_pkcs1_v1_5_sign() local
207 rsa = drvcrypt_get_ops(CRYPTO_RSA); in rsassa_pkcs1_v1_5_sign()
208 if (!rsa) { in rsassa_pkcs1_v1_5_sign()
222 ret = rsa->decrypt(&rsa_data); in rsassa_pkcs1_v1_5_sign()
245 struct drvcrypt_rsa *rsa = NULL; in rsassa_pkcs1_v1_5_verify() local
271 rsa = drvcrypt_get_ops(CRYPTO_RSA); in rsassa_pkcs1_v1_5_verify()
272 if (rsa) { in rsassa_pkcs1_v1_5_verify()
280 ret = rsa->encrypt(&rsa_data); in rsassa_pkcs1_v1_5_verify()
737 struct drvcrypt_rsa *rsa = NULL; in rsassa_pss_sign() local
776 rsa = drvcrypt_get_ops(CRYPTO_RSA); in rsassa_pss_sign()
[all …]
H A Dsub.mk1 srcs-$(CFG_CRYPTO_DRV_RSA) += rsa.c rsamgf.c rsassa.c
/optee_os/core/drivers/crypto/versal/
H A Dsub.mk6 srcs-y += rsa.c
/optee_os/core/drivers/crypto/se050/core/
H A Dsub.mk8 srcs-$(CFG_NXP_SE05X_RSA_DRV) += rsa.c
/optee_os/core/lib/libtomcrypt/
H A Dsub.mk276 srcs-$(_CFG_CORE_LTC_RSA) += rsa.c
286 srcs-$(_CFG_CORE_LTC_RSA) += src/pk/rsa/rsa_decrypt_key.c
287 srcs-$(_CFG_CORE_LTC_RSA) += src/pk/rsa/rsa_encrypt_key.c
288 srcs-$(_CFG_CORE_LTC_RSA) += src/pk/rsa/rsa_export.c
289 srcs-$(_CFG_CORE_LTC_RSA) += src/pk/rsa/rsa_exptmod.c
290 srcs-$(_CFG_CORE_LTC_RSA) += src/pk/rsa/rsa_import.c
291 srcs-$(_CFG_CORE_LTC_RSA) += src/pk/rsa/rsa_key.c
292 srcs-$(_CFG_CORE_LTC_RSA) += src/pk/rsa/rsa_make_key.c
293 srcs-$(_CFG_CORE_LTC_RSA) += src/pk/rsa/rsa_sign_hash.c
294 srcs-$(_CFG_CORE_LTC_RSA) += src/pk/rsa/rsa_verify_hash.c
/optee_os/core/crypto/
H A Dsigned_hdr.c332 res = load_rsa_key(subkey, &key->pub_key.rsa); in shdr_load_pub_key()
351 crypto_acipher_free_rsa_public_key(key->pub_key.rsa); in shdr_free_pub_key()
352 free(key->pub_key.rsa); in shdr_free_pub_key()
390 key->pub_key.rsa, shdr->hash_size, in shdr_verify_signature2()
/optee_os/scripts/
H A Dpem_to_pub_c.py26 from cryptography.hazmat.primitives.asymmetric import rsa
H A Dsign_encrypt.py425 from cryptography.hazmat.primitives.asymmetric import rsa
431 if isinstance(subkey_key, rsa.RSAPrivateKey):
474 from cryptography.hazmat.primitives.asymmetric import rsa
565 self.subkey_key = rsa.RSAPublicNumbers(e, n).public_key()
743 from cryptography.hazmat.primitives.asymmetric import rsa
745 if not isinstance(self.key, rsa.RSAPrivateKey):
771 from cryptography.hazmat.primitives.asymmetric import rsa
774 if isinstance(self.key, rsa.RSAPrivateKey):
H A Dsign_helper_kms.py20 from cryptography.hazmat.primitives.asymmetric.rsa import (
/optee_os/lib/libmbedtls/
H A Dsub.mk62 SRCS_CRYPTO += rsa.c
100 SRCS_CRYPTO += rsa.c
/optee_os/core/include/
H A Dsigned_hdr.h206 struct rsa_public_key *rsa; member
/optee_os/ta/pkcs11/src/
H A Dpkcs11_attributes.c2511 mbedtls_rsa_context *rsa = NULL; in set_private_key_data_rsa() local
2543 rsa = mbedtls_pk_rsa(pk); in set_private_key_data_rsa()
2544 if (!rsa) { in set_private_key_data_rsa()
2549 mbedtls_rc = mbedtls_rsa_export(rsa, &n, &p, &q, &d, &e); in set_private_key_data_rsa()
2709 mbedtls_rsa_context *rsa = NULL; in encode_rsa_private_key_der() local
2739 rsa = mbedtls_pk_rsa(pk); in encode_rsa_private_key_der()
2740 if (!rsa) { in encode_rsa_private_key_der()
2745 mbedtls_rc = mbedtls_rsa_import_raw(rsa, n, n_len, p, p_len, in encode_rsa_private_key_der()
2752 if (mbedtls_rsa_complete(rsa)) { in encode_rsa_private_key_der()
2757 if (mbedtls_rsa_check_privkey(rsa)) { in encode_rsa_private_key_der()
/optee_os/
H A DMAINTAINERS113 F: core/drivers/crypto/versal/rsa.c
/optee_os/lib/libmbedtls/mbedtls/
H A DChangeLog263 ecp.h, rsa.h.
4063 implementations of the RSA interface declared in rsa.h.
4675 https://securityblog.redhat.com/2015/09/02/factoring-rsa-keys-with-tls-perfect-forward-secrecy/