mbedtls/include/mbedtls
Hanno Becker cbb59bc2a8 Extend RSA interface to allow structure-independent setup
This commit extends the RSA interface by import/export calls that can be used to
setup an RSA context from a subset of the core RSA parameters (N,P,Q,D,E).

The intended workflow is the following:
1. Call mbedtls_rsa_import one or multiple times to import the core parameters.
2. Call mbedtls_rsa_complete to deduce remaining core parameters as well as any
   implementation-defined internal helper variables.

The RSA context is ready for use after this call.

The import function comes in two variants mbedtls_rsa_import and
mbedtls_rsa_import_raw, the former taking pointers to MPI's as input, the latter
pointers buffers holding to big-endian encoded MPI's.
The reason for this splitting is the following: When only providing an import
function accepting const MPI's, a user trying to import raw binary data into an
RSA context has to convert these to MPI's first which before passing them to the
import function, introducing an unnecessary copy of the data in memory. The
alternative would be to have another MPI-based import-function with
move-semantics, but this would be in contrast to the rest of the library's
interfaces.

Similarly, there are functions mbedtls_rsa_export and mbedtls_rsa_export_raw for
exporting the core RSA parameters, either as MPI's or in big-endian binary
format.

The main import/export functions deliberately do not include the additional
helper values DP, DQ and QP present in ASN.1-encoded RSA private keys. To
nonetheless be able to check whether given parameters DP, DQ and QP are in
accordance with a given RSA private key, the interface is extended by a function
mbedtls_rsa_check_opt (in line with mbedtls_rsa_check_privkey,
mbedtls_rsa_check_pubkey and mbedtls_rsa_check_pub_priv). Exporting the optional
parameters is taken care of by mbedtls_export_opt (currently MPI format only).
2017-08-23 14:44:36 +01:00
..
aes.h Make minor changes to documentation 2017-07-20 12:36:53 +02:00
aesni.h Change main license to Apache 2.0 2015-09-04 14:21:07 +02:00
arc4.h Change main license to Apache 2.0 2015-09-04 14:21:07 +02:00
asn1.h Change main license to Apache 2.0 2015-09-04 14:21:07 +02:00
asn1write.h Add mbedtls_asn1_write_len() support for 3 and 4 byte lengths 2016-08-25 15:42:27 +01:00
base64.h Fix references to non-standard SIZE_T_MAX 2015-10-05 15:23:11 +01:00
bignum.h Remove MBEDTLS_TYPE_UDBL option 2017-07-22 11:53:56 +02:00
blowfish.h Change main license to Apache 2.0 2015-09-04 14:21:07 +02:00
bn_mul.h Fix segfault on x32 by using better register constraints in bn_mul.h 2016-05-23 14:29:28 +01:00
camellia.h Change main license to Apache 2.0 2015-09-04 14:21:07 +02:00
ccm.h Change main license to Apache 2.0 2015-09-04 14:21:07 +02:00
certs.h Change main license to Apache 2.0 2015-09-04 14:21:07 +02:00
check_config.h Fix check_config.h #error directive 2017-07-22 11:53:56 +02:00
cipher_internal.h Change main license to Apache 2.0 2015-09-04 14:21:07 +02:00
cipher.h Refactor and change CMAC interface 2016-10-13 13:51:11 +01:00
cmac.h Clarify CMAC API 2016-12-14 15:27:22 +00:00
compat-1.3.h Remove obsolete macros from compat-1.3.h 2017-05-16 10:22:37 +01:00
config.h Improve MBEDTLS_NO_UDBL_DIVISION description 2017-07-22 11:53:56 +02:00
ctr_drbg.h Fix a fairly common typo in comments 2015-09-25 04:27:22 +02:00
debug.h Fix a typo that confuses check-names.sh 2016-03-18 16:47:10 +00:00
des.h Change main license to Apache 2.0 2015-09-04 14:21:07 +02:00
dhm.h Clarified function param in dhm.h 2016-05-25 00:59:37 +01:00
ecdh.h Change main license to Apache 2.0 2015-09-04 14:21:07 +02:00
ecdsa.h Clarify the use of ECDSA API 2017-03-10 11:31:41 +00:00
ecjpake.h Fix check-doxy-blocks.pl errors (cmac.c ecjpake.h) 2017-05-12 00:18:04 +01:00
ecp_internal.h Apply feedback to ECP internal interface documentation 2017-05-11 22:42:14 +01:00
ecp.h Apply review feedback on ECP interface 2017-05-11 22:42:14 +01:00
entropy_poll.h Add config macro for min bytes hw entropy 2016-10-13 13:48:48 +01:00
entropy.h Documentation and entropy self test changes (#610) 2016-09-13 13:30:02 +01:00
error.h Remove CMAC as a separate and independent error group 2016-10-13 13:51:12 +01:00
gcm.h Fix documentation for mbedtls_gcm_finish() 2016-10-13 13:54:47 +01:00
havege.h Change main license to Apache 2.0 2015-09-04 14:21:07 +02:00
hmac_drbg.h Fix a fairly common typo in comments 2015-09-25 04:27:22 +02:00
md2.h Various fixes to doxygen API generation 2016-01-03 16:14:14 +00:00
md4.h Various fixes to doxygen API generation 2016-01-03 16:14:14 +00:00
md5.h Various fixes to doxygen API generation 2016-01-03 16:14:14 +00:00
md_internal.h Change main license to Apache 2.0 2015-09-04 14:21:07 +02:00
md.h Clean up comment formatting in md.h 2016-10-13 13:51:12 +01:00
memory_buffer_alloc.h Clarifies documentation on reported memory statistics 2016-05-23 14:29:29 +01:00
net_sockets.h Rename net.{c,h} to net_sockets.{c,h} 2016-10-13 13:48:48 +01:00
net.h Rename net.{c,h} to net_sockets.{c,h} 2016-10-13 13:48:48 +01:00
oid.h Change main license to Apache 2.0 2015-09-04 14:21:07 +02:00
padlock.h Change main license to Apache 2.0 2015-09-04 14:21:07 +02:00
pem.h Change main license to Apache 2.0 2015-09-04 14:21:07 +02:00
pk_internal.h Change main license to Apache 2.0 2015-09-04 14:21:07 +02:00
pk.h Fixes minor typos in comments in pk.h and ctr_drbg.c 2016-05-23 14:29:30 +01:00
pkcs5.h Change main license to Apache 2.0 2015-09-04 14:21:07 +02:00
pkcs11.h Fix macroization of inline in C++ 2015-10-05 11:41:36 +01:00
pkcs12.h Change main license to Apache 2.0 2015-09-04 14:21:07 +02:00
platform_time.h Puts platform time abstraction into its own header 2016-07-13 14:46:18 +01:00
platform.h Fix platform setup/teardown feature and comments 2017-07-21 23:48:55 +01:00
ripemd160.h Various fixes to doxygen API generation 2016-01-03 16:14:14 +00:00
rsa.h Extend RSA interface to allow structure-independent setup 2017-08-23 14:44:36 +01:00
sha1.h Various fixes to doxygen API generation 2016-01-03 16:14:14 +00:00
sha256.h Various fixes to doxygen API generation 2016-01-03 16:14:14 +00:00
sha512.h Various fixes to doxygen API generation 2016-01-03 16:14:14 +00:00
ssl_cache.h Abstracts away time()/stdlib.h into platform 2016-04-26 14:49:59 +01:00
ssl_ciphersuites.h Undo API change 2017-07-20 12:36:53 +02:00
ssl_cookie.h Change main license to Apache 2.0 2015-09-04 14:21:07 +02:00
ssl_internal.h Fix mbedtls_ssl_read 2017-06-08 10:12:16 +01:00
ssl_ticket.h Change main license to Apache 2.0 2015-09-04 14:21:07 +02:00
ssl.h Simplify retaining of messages for future processing 2017-06-08 10:12:16 +01:00
threading.h Remove mutexes from ECP hardware acceleration 2017-07-19 02:07:59 +01:00
timing.h Fix a fairly common typo in comments 2015-09-25 04:27:22 +02:00
version.h Update the version number to 2.5.1 2017-06-20 23:08:10 +01:00
x509_crl.h Reintroduce line deleted by accident 2016-01-04 12:40:15 +01:00
x509_crt.h Cleaned up negative test predicate for test case 2017-06-06 19:16:18 +02:00
x509_csr.h Fix typo in docs for mbedtls_x509write_csr_der() 2016-10-13 13:53:56 +01:00
x509.h Clarify Comments and Fix Typos (#651) 2016-11-06 12:45:15 +00:00
xtea.h Change main license to Apache 2.0 2015-09-04 14:21:07 +02:00