Function esp_idf_hal::sys::mbedtls_rsa_import_raw
source ยท pub unsafe extern "C" fn mbedtls_rsa_import_raw(
ctx: *mut mbedtls_rsa_context,
N: *const u8,
N_len: usize,
P: *const u8,
P_len: usize,
Q: *const u8,
Q_len: usize,
D: *const u8,
D_len: usize,
E: *const u8,
E_len: usize,
) -> i32
Expand description
\brief This function imports core RSA parameters, in raw big-endian binary format, into an RSA context.
\note This function can be called multiple times for successive imports, if the parameters are not simultaneously present.
Any sequence of calls to this function should be followed
by a call to mbedtls_rsa_complete(), which checks and
completes the provided information to a ready-for-use
public or private RSA key.
\note See mbedtls_rsa_complete() for more information on which parameters are necessary to set up a private or public RSA key.
\note The imported parameters are copied and need not be preserved for the lifetime of the RSA context being set up.
\param ctx The initialized RSA context to store the parameters in. \param N The RSA modulus. This may be \c NULL. \param N_len The Byte length of \p N; it is ignored if \p N == NULL. \param P The first prime factor of \p N. This may be \c NULL. \param P_len The Byte length of \p P; it is ignored if \p P == NULL. \param Q The second prime factor of \p N. This may be \c NULL. \param Q_len The Byte length of \p Q; it is ignored if \p Q == NULL. \param D The private exponent. This may be \c NULL. \param D_len The Byte length of \p D; it is ignored if \p D == NULL. \param E The public exponent. This may be \c NULL. \param E_len The Byte length of \p E; it is ignored if \p E == NULL.
\return \c 0 on success. \return A non-zero error code on failure.