| /optee_os/lib/libmbedtls/core/ |
| H A D | rsa.c | 100 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 …]
|
| /optee_os/lib/libmbedtls/mbedtls/library/ |
| H A D | psa_crypto_rsa.c | 2 * PSA RSA layer on top of Mbed TLS crypto 25 #include <mbedtls/rsa.h> 43 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() 82 /* The size of an RSA key doesn't have to be a multiple of 8. Mbed TLS in mbedtls_psa_rsa_load_representation() 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() 130 * representation in the key slot. Export representation in case of RSA is in mbedtls_psa_rsa_import_key() 134 rsa, in mbedtls_psa_rsa_import_key() [all …]
|
| H A D | rsa_internal.h | 4 * \brief Internal-only RSA public-key cryptosystem API. 6 * This file declares RSA-related functions that are to be used 17 #include "mbedtls/rsa.h" 21 * \brief Parse a PKCS#1 (ASN.1) encoded private RSA key. 23 * \param rsa The RSA context where parsed data will be stored. 29 * \return MBEDTLS_ERR_RSA_xxx in case of RSA internal failures while 34 int mbedtls_rsa_parse_key(mbedtls_rsa_context *rsa, const unsigned char *key, size_t keylen); 37 * \brief Parse a PKCS#1 (ASN.1) encoded public RSA key. 39 * \param rsa The RSA context where parsed data will be stored. 45 * \return MBEDTLS_ERR_RSA_xxx in case of RSA internal failures while [all …]
|
| H A D | rsa_alt_helpers.h | 4 * \brief Context-independent RSA helper functions 6 * This module declares some RSA-related helper functions useful when 7 * implementing the RSA interface. These functions are provided in a separate 8 * compilation unit in order to make it easy for designers of alternative RSA 13 * End-users of Mbed TLS who are not providing their own alternative RSA 15 * use only the functions declared in rsa.h. 27 * Each of these functions takes a set of core RSA parameters and 33 * They take a set of core or CRT related RSA parameters and check their 54 * \brief Compute RSA prime moduli P, Q from public modulus N=PQ 58 * an RSA context. Alternative implementations need not [all …]
|
| H A D | ssl_ciphersuites.c | 214 /* The RSA PSK suites */ 328 "TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256", 344 "TLS-DHE-RSA-WITH-CHACHA20-POLY1305-SHA256", 376 "TLS-RSA-PSK-WITH-CHACHA20-POLY1305-SHA256", 497 { MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, "TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA", 501 { MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, "TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA", 509 { MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, "TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256", 515 { MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, "TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256", 523 { MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, "TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384", 529 { MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, "TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384", [all …]
|
| H A D | psa_crypto_rsa.h | 2 * PSA RSA layer on top of Mbed TLS crypto 13 #include <mbedtls/rsa.h> 15 /** Load the contents of a key buffer into an internal RSA representation 20 * \param[out] p_rsa Returns a pointer to an RSA context on success. 30 /** Import an RSA key in binary format. 49 * \retval #PSA_SUCCESS The RSA key was imported successfully. 62 /** Export an RSA key to export representation 65 * \param[in] rsa The internal RSA representation from which to export 71 mbedtls_rsa_context *rsa, 76 /** Export a public RSA key or the public part of an RSA key pair in binary [all …]
|
| H A D | pk_wrap.c | 18 /* Even if RSA not activated, for the sake of RSA-alt */ 19 #include "mbedtls/rsa.h" 60 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() [all …]
|
| H A D | rsa.c | 2 * The RSA public-key cryptosystem 10 * of the RSA algorithm: 30 #include "mbedtls/rsa.h" 57 * - never a valid value for an RSA parameter 81 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() [all …]
|
| H A D | pkwrite.h | 28 * RSA public keys: 31 * + 1 + 1 + 9 (rsa oid) 42 * RSA private keys: 114 * key types (EC and/or RSA). */
|
| H A D | error.c | 142 #include "mbedtls/rsa.h" 267 return( "PEM - RSA IV is not in hex-format" ); in mbedtls_high_level_strerr() 294 return( "PK - Key algorithm is unsupported (only RSA and EC are supported)" ); in mbedtls_high_level_strerr() 300 return( "PK - The pubkey tag or value is invalid (only RSA and EC are supported)" ); in mbedtls_high_level_strerr() 306 return( "PK - Unavailable feature, e.g. RSA disabled for RSA key" ); in mbedtls_high_level_strerr() 364 return( "RSA - Bad input parameters to function" ); in mbedtls_high_level_strerr() 366 return( "RSA - Input data contains invalid padding and is rejected" ); in mbedtls_high_level_strerr() 368 return( "RSA - Something failed during generation of a key" ); in mbedtls_high_level_strerr() 370 return( "RSA - Key failed to pass the validity check of the library" ); in mbedtls_high_level_strerr() 372 return( "RSA - The public key operation failed" ); in mbedtls_high_level_strerr() [all …]
|
| /optee_os/core/drivers/crypto/crypto_api/acipher/ |
| H A D | rsa.c | 5 * Crypto RSA interface implementation to enable HW driver. 22 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() 34 CRYPTO_TRACE("RSA Keypair (%zu bits) alloc ret = 0x%" PRIx32, 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() [all …]
|
| H A D | rsassa.c | 5 * RSA Signature Software common implementation. 9 * PKCS #1 v2.1: RSA Cryptography Standard 30 * @ssa_data RSA data to encode 121 * @ssa_data RSA data to encode 173 * PKCS#1 V1.5 - Signature of RSA message and encodes the signature. 176 * @ssa_data [in/out] RSA data to sign / Signature 183 struct drvcrypt_rsa *rsa = NULL; in rsassa_pkcs1_v1_5_sign() local 200 * RSA Encrypt/Decrypt are doing the same operation except in rsassa_pkcs1_v1_5_sign() 201 * that decrypt takes a RSA Private key in parameter in rsassa_pkcs1_v1_5_sign() 207 rsa = drvcrypt_get_ops(CRYPTO_RSA); in rsassa_pkcs1_v1_5_sign() [all …]
|
| H A D | local.h | 21 * PKCS#1 - Signature of RSA message and encodes the signature. 23 * @ssa_data [in/out] RSA data to sign / Signature 28 * PKCS#1 - Verification the encoded signature of RSA message. 30 * @ssa_data RSA Encoded signature data
|
| /optee_os/core/lib/libtomcrypt/src/pk/rsa/ |
| H A D | rsa_set.c | 9 Import RSA key from raw numbers 11 @param N RSA's N 12 @param Nlen RSA's N's length 13 @param e RSA's e 14 @param elen RSA's e's length 15 @param d RSA's d (only private key, NULL for public key) 16 @param dlen RSA's d's length 51 Import factors of an RSA key from raw numbers 55 @param p RSA's p 56 @param plen RSA's p's length [all …]
|
| H A D | rsa_key.c | 7 Free an RSA key, Tom St Denis 8 Basic operations on an RSA key, Steffen Jaeckel 64 This shrinks the allocated memory of a RSA key 74 @param key The RSA key to shrink 83 Init an RSA key 84 @param key The RSA key to free 94 Free an RSA key from memory 95 @param key The RSA key to free
|
| H A D | rsa_get_size.c | 7 Retrieve the size of an RSA key, Steffen Jaeckel. 13 Retrieve the size in bytes of an RSA key. 14 @param key The RSA key 15 @return The size in bytes of the RSA key or INT_MAX on error.
|
| H A D | rsa_import.c | 7 Import a PKCS RSA key, Tom St Denis 65 /* we don't support multi-prime RSA */ in rsa_import_pkcs1() 75 Import multiple formats of RSA public and private keys. 100 /* see if the OpenSSL DER format RSA public key will work */ in rsa_import()
|
| H A D | rsa_exptmod.c | 7 RSA PKCS exptmod, Tom St Denis 8 Added RSA blinding --nmav 14 Compute an RSA modular exponentiation 15 @param in The input data to send into RSA 20 @param key The RSA key to use
|
| /optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ |
| H A D | rsa.h | 2 * \file rsa.h 4 * \brief This file provides an API for the RSA public-key cryptosystem. 6 * The RSA public-key cryptosystem is defined in <em>Public-Key 7 * Cryptography Standards (PKCS) #1 v1.5: RSA Encryption</em> 9 * RSA Cryptography Specifications</em>. 30 * RSA Error codes 52 * RSA constants 58 #define MBEDTLS_RSA_SIGN 1 /**< Identifier for RSA signature operations. */ 59 #define MBEDTLS_RSA_CRYPT 2 /**< Identifier for RSA encryption and decryption operations. */ 64 * The above constants may be used even if the RSA module is compile out, [all …]
|
| H A D | pk.h | 20 #include "mbedtls/rsa.h" 47 /** Key algorithm is unsupported (only RSA and EC are supported). */ 53 /** The pubkey tag or value is invalid (only RSA and EC are supported). */ 59 /** Unavailable feature, e.g. RSA disabled for RSA key. */ 126 /* For RSA, the signature can be as large as the bignum module allows. 282 * \brief Types for RSA-alt abstraction 355 * \note For contexts holding an RSA-alt key, use 365 * key must be an EC or RSA key pair (DH is not suported in the PK module). 371 * * RSA: 373 * * sign_ext: RSA PSS if the pk_type is #MBEDTLS_PK_RSASSA_PSS, otherwise [all …]
|
| /optee_os/core/drivers/crypto/crypto_api/include/ |
| H A D | drvcrypt_acipher.h | 14 * Assymetric Cipher RSA Algorithm enumerate 17 DRVCRYPT_RSA_NOPAD = 0, /* RSA Algo mode NO PAD */ 18 DRVCRYPT_RSA_OAEP, /* RSA Algo mode OAEP */ 19 DRVCRYPT_RSA_PKCS_V1_5, /* RSA Algo mode PKCSv1.5 */ 20 DRVCRYPT_RSASSA_PKCS_V1_5, /* RSA Signature Algo mode PKCSv1.5 */ 21 DRVCRYPT_RSASSA_PSS, /* RSA Signature Algo mode PSS */ 25 * RSA Key object 34 * RSA Mask Generation data 44 * RSA Encoded Signature data 55 /* RSA Mask Generation function */ [all …]
|
| /optee_os/core/drivers/crypto/caam/acipher/ |
| H A D | caam_rsa.c | 5 * CAAM RSA manager. 6 * Implementation of RSA functions 47 /* Define the maximum number of entries in the RSA Finish Key descriptor */ 54 /* Define the maximum number of entries in the RSA Finish Key descriptor */ 64 * Definition of the local RSA keypair 90 * Free RSA keypair 92 * @key RSA keypair 107 * Free local caam RSA keypair 109 * @key caam RSA keypair 125 * Convert Crypto RSA Key to local RSA Public Key [all …]
|
| /optee_os/core/drivers/crypto/caam/ |
| H A D | crypto.mk | 15 # DBG_RSA BIT32(8) // RSA trace 43 caam-crypto-drivers += RSA DSA ECC DH MATH AE_GCM 53 caam-crypto-drivers += RSA DSA ECC DH MATH AE_GCM 64 caam-crypto-drivers += RSA DSA ECC DH MATH AE_GCM 71 caam-crypto-drivers += RSA DSA ECC DH MATH AE_GCM 79 caam-crypto-drivers += RSA DSA ECC DH MATH AE_GCM 93 caam-crypto-drivers += RSA DSA ECC DH MATH AE_GCM 115 caam-crypto-drivers += RSA DSA ECC DH MATH AE_GCM 142 # Define the RSA Private Key Format used by the CAAM 155 # 4096 (RSA Max key size) + 12 * 8 (Header serialization) + [all …]
|
| /optee_os/core/drivers/crypto/hisilicon/ |
| H A D | hpre_rsa.c | 4 * Kunpeng hardware accelerator hpre rsa algorithm implementation. 13 #include <mbedtls/rsa.h> 68 EMSG("HPRE do rsa fail! done=0x%"PRIX16", etype=0x%"PRIX16, in hpre_rsa_parse_sqe() 84 EMSG("Fail to create rsa qp"); in hpre_rsa_do_task() 190 EMSG("Fail to alloc rsa ncrt buf"); in hpre_rsa_encrypt_alloc() 226 EMSG("Fail to transfer rsa ncrt e from crypto_bin to hpre_bin"); in hpre_rsa_encrypt_bn2bin() 232 EMSG("Fail to transfer rsa ncrt n from crypto_bin to hpre_bin"); in hpre_rsa_encrypt_bn2bin() 240 EMSG("Fail to transfer rsa plaintext from crypto_bin to hpre_bin"); in hpre_rsa_encrypt_bn2bin() 283 EMSG("Fail to init rsa msg"); in rsa_nopad_encrypt() 512 EMSG("Invalid rsa encrypt input parameter"); in hpre_rsa_encrypt() [all …]
|
| /optee_os/ta/pkcs11/ |
| H A D | sub.mk | 16 # When enabled, embed support for CKM_RSA_X_509 (a.k.a. Raw RSA) ciphering 18 # Raw RSA can be unsafe if client uses a weak clear data padding scheme.
|